library with useful tools
Provide wrappers for lowe-level syscalls/algorithms, with a high level interface. Interfaces are as close as possible to STL or share a common interface with blc
Pipe without using a syscall in a multithreaded context
Wrap C sockets with STL-like interface based on blc::stream
master interface for quickly implementing server like logic
master interface for implementing actors (without group logic)
_ in front of private class attributes
Actor oriented framework
Multithreaded programs where threads can communicate safely via pipe
bfc::flags // contains argv flags
- make your actor inherit bfc::actor. constructor is
actor(blc::tools::pipe pipe, std::string name)
You must call this->start() at the end of the constructor, to launch a thread containing this actor. - define
void tick()
// function called every few milliseconds throughout prog - define
void masterProto()
// contains all behaviors of the actor depending on communications with masterThread. You can add a protocolFactory tothis->_masterProto
here. you should call this at actor construction yourself
blc::pipe
: You can communicate with static functions that return an end of the pipe
One end is privately owned by the actor.
Note. blc::actor is a parent of bfc::actor
blc::protocolFactory<int, std::string> _masterProto
bfc::initActor() // called first, initialize your actor here bfc::masterThread::readActor // what to do when someone writes to this actor bfc::masterThread::tick() // called regularly (every few milliseconds) throughout prog bfc::closure() // called at program exit bfc::factory(std::string name, Args&& args) // create an actor
.
|-- dep/ dependencies
|-- dev/ your project sources
|-- bfc/ bfc headers
-- src/ bfc cpp files
inter-actor signals