#include <MicoleBus.h>
Inherits lo2k::Thread.
Collaboration diagram for MicoleBus:
this class define Micole Bus machanism, bind method etc...
Definition at line 71 of file MicoleBus.h.
Public Member Functions | |
MicoleBus (bool sync) | |
Default constructor. | |
MicoleBus (const MicoleBus &mb) | |
copy constructor | |
virtual | ~MicoleBus () |
void | stop () |
stop the bus | |
void | interpret (string) |
ask interpretation of a string | |
void | sendMsg (string s) |
send a string on the bus | |
int | bindMsg (string regexp, MicoleCallback *cb) |
Bind a message. | |
void | lockSlot () |
void | lockAllSlots () |
void | unlockSlot () |
void | unlockAllSlots () |
void | unbindMsg (MicoleCallback *cb) |
Unbind a MicoleCallback. | |
Protected Member Functions | |
virtual void | run () |
run method you need to implement these function if you inherit lo2k.net::Thread this function must be a loop | |
Protected Attributes | |
int | _regexpNumber |
number of regexp (for stat) | |
int | _bindNumber |
bool | _run |
map< string, MicoleBusRegexp > | _regexpList |
regexp List | |
queue< string > | _buffer |
MicoleBus::MicoleBus | ( | bool | sync | ) |
Default constructor.
sync | define if bus is synchronous (immediate interpretation) or not |
Definition at line 35 of file MicoleBus.cpp.
MicoleBus::MicoleBus | ( | const MicoleBus & | mb | ) |
MicoleBus::~MicoleBus | ( | ) | [virtual] |
Definition at line 48 of file MicoleBus.cpp.
int MicoleBus::bindMsg | ( | string | regexp, | |
MicoleCallback * | cb | |||
) |
Bind a message.
regexp | regular expressions | |
cb | CallBack method |
Definition at line 139 of file MicoleBus.cpp.
void MicoleBus::interpret | ( | string | ) |
ask interpretation of a string
crawl all regular expression registered in micole bus each regular expression as a list of callbacks (to avoir reparse of similar regulars expressions)
Definition at line 81 of file MicoleBus.cpp.
void MicoleBus::lockAllSlots | ( | ) | [inline] |
Definition at line 127 of file MicoleBus.h.
void MicoleBus::lockSlot | ( | ) | [inline] |
Definition at line 125 of file MicoleBus.h.
void MicoleBus::run | ( | ) | [protected, virtual] |
run method you need to implement these function if you inherit lo2k.net::Thread this function must be a loop
Implements lo2k::Thread.
Definition at line 52 of file MicoleBus.cpp.
void MicoleBus::sendMsg | ( | string | s | ) |
void MicoleBus::stop | ( | ) |
void MicoleBus::unbindMsg | ( | MicoleCallback * | cb | ) |
void MicoleBus::unlockAllSlots | ( | ) | [inline] |
Definition at line 136 of file MicoleBus.h.
void MicoleBus::unlockSlot | ( | ) | [inline] |
Definition at line 134 of file MicoleBus.h.
int MicoleBus::_bindNumber [protected] |
Definition at line 82 of file MicoleBus.h.
queue<string> MicoleBus::_buffer [protected] |
Definition at line 88 of file MicoleBus.h.
map<string, MicoleBusRegexp> MicoleBus::_regexpList [protected] |
int MicoleBus::_regexpNumber [protected] |
bool MicoleBus::_run [protected] |
Definition at line 83 of file MicoleBus.h.