#include <EDDMsgLoop.h>
Public Member Functions | |
int | AddDataPipe (tcEDDDataPipe *apDataPipe) |
int | RemoveDataPipe (int anPipeID) |
int | AddDataSource (tcEDDDataSource *apDataSource) |
int | RemoveDataSource (int anSourceID) |
int | SendMsg (tsEDDMsgHdr *apBuffer, bool BrdCast=false) |
int | GetMaxMessageLen (int anSourceID) |
bool | IsSubscribed (uint16_t anSourceId) |
Static Public Member Functions | |
static tcEDDMsgLoop * | GetInstance (void) |
Static Public Attributes | |
static const unsigned int | gnMaxDataPipes = 10 |
maximum number of physical interfaces to poll | |
static const unsigned int | gnMaxDataSources = 128 |
maximum number of data sources on server | |
static tcEDDMsgLoop * | gpMsgLoop = NULL |
the singleton | |
Protected Types | |
enum | teParseState { eeWaitSync, eeGetHeader, eeGetBytes } |
Protected Member Functions | |
virtual | ~tcEDDMsgLoop (void) |
tcEDDMsgLoop (void) | |
void | InitOSDependencies (void) |
void | HandleMessage (tsEDDMsgHdr *apMsg, int anPipeID) |
int | ReceiverThread (int anPipeID) |
Static Protected Member Functions | |
static int | DispatchReceiverThread (void *anPipeID, void *apFoo, void *apGoo) |
Protected Attributes | |
tcEDDDataPipe * | maDataPipes [gnMaxDataPipes] |
table of physical layer interfaces | |
tcEDDDataSource * | maDataSources [gnMaxDataSources] |
table of data sources | |
unsigned int | maSubscriptionTable [gnMaxDataPipes][gnMaxDataSources] |
subscription table | |
unsigned int | maRcvThreadHandles [gnMaxDataPipes] |
receive thread handles for each physical layer | |
tcEDDThreadManager * | mpThreadManager |
pointer to OS layer thread abstraction | |
tcEDDLockManager * | mpLockManager |
pointer to OS layer thread lock abstraction | |
int | mhTableLock |
Table lock for thread safety. | |
volatile bool | maShutdownThread [gnMaxDataPipes] |
flag for receive threads to shutdown |
The tcEDDMsgLoop class provides a thread safe data handling loop that may be used to process EDD Client requests as well as route posted data messages from tcEDDDataSource derived object to subscribed EDD Clients.
The tcEDDMsgLoop is a system wide singleton.
Definition at line 29 of file EDDMsgLoop.h.
enum tcEDDMsgLoop::teParseState [protected] |
This enumeration represents the state machine used for receiving data from an EDD client. (this is the parser state machine states)
eeWaitSync | waiting for the sync word |
eeGetHeader | read the tcEDDMsgHdr structure |
eeGetBytes | read the message payload following the tcEDDMsgHdr |
Definition at line 59 of file EDDMsgLoop.h.
tcEDDMsgLoop::~tcEDDMsgLoop | ( | void | ) | [protected, virtual] |
Definition at line 348 of file EDDMsgLoop.cpp.
tcEDDMsgLoop::tcEDDMsgLoop | ( | void | ) | [protected] |
Definition at line 323 of file EDDMsgLoop.cpp.
int tcEDDMsgLoop::AddDataPipe | ( | tcEDDDataPipe * | apDataPipe | ) |
Add a data pipe (a virtual device) to the message handling loop abstraction layer.
apDataPipe | pointer to a valid data pipe interface |
Definition at line 46 of file EDDMsgLoop.cpp.
int tcEDDMsgLoop::AddDataSource | ( | tcEDDDataSource * | apDataSource | ) |
Definition at line 98 of file EDDMsgLoop.cpp.
int tcEDDMsgLoop::DispatchReceiverThread | ( | void * | anPipeID, | |
void * | apFoo, | |||
void * | apGoo | |||
) | [static, protected] |
Definition at line 189 of file EDDMsgLoop.cpp.
tcEDDMsgLoop * tcEDDMsgLoop::GetInstance | ( | void | ) | [static] |
Get a copy of a pointer to the singlton tcEDDMsgLoop object. If the object has not yet been created, it will be constructed in this call.
Definition at line 27 of file EDDMsgLoop.cpp.
int tcEDDMsgLoop::GetMaxMessageLen | ( | int | anSourceID | ) |
Definition at line 169 of file EDDMsgLoop.cpp.
void tcEDDMsgLoop::HandleMessage | ( | tsEDDMsgHdr * | apMsg, | |
int | anPipeID | |||
) | [protected] |
Definition at line 354 of file EDDMsgLoop.cpp.
void tcEDDMsgLoop::InitOSDependencies | ( | void | ) | [protected] |
bool tcEDDMsgLoop::IsSubscribed | ( | uint16_t | anSourceId | ) |
Definition at line 152 of file EDDMsgLoop.cpp.
int tcEDDMsgLoop::ReceiverThread | ( | int | anPipeID | ) | [protected] |
Definition at line 198 of file EDDMsgLoop.cpp.
int tcEDDMsgLoop::RemoveDataPipe | ( | int | anPipeID | ) |
Definition at line 74 of file EDDMsgLoop.cpp.
int tcEDDMsgLoop::RemoveDataSource | ( | int | anSourceID | ) |
Definition at line 116 of file EDDMsgLoop.cpp.
int tcEDDMsgLoop::SendMsg | ( | tsEDDMsgHdr * | apBuffer, | |
bool | BrdCast = false | |||
) |
Definition at line 134 of file EDDMsgLoop.cpp.
const unsigned int tcEDDMsgLoop::gnMaxDataPipes = 10 [static] |
const unsigned int tcEDDMsgLoop::gnMaxDataSources = 128 [static] |
tcEDDMsgLoop * tcEDDMsgLoop::gpMsgLoop = NULL [static] |
tcEDDDataPipe* tcEDDMsgLoop::maDataPipes[gnMaxDataPipes] [protected] |
tcEDDDataSource* tcEDDMsgLoop::maDataSources[gnMaxDataSources] [protected] |
unsigned int tcEDDMsgLoop::maRcvThreadHandles[gnMaxDataPipes] [protected] |
volatile bool tcEDDMsgLoop::maShutdownThread[gnMaxDataPipes] [protected] |
unsigned int tcEDDMsgLoop::maSubscriptionTable[gnMaxDataPipes][gnMaxDataSources] [protected] |
int tcEDDMsgLoop::mhTableLock [protected] |
tcEDDLockManager* tcEDDMsgLoop::mpLockManager [protected] |
tcEDDThreadManager* tcEDDMsgLoop::mpThreadManager [protected] |