tcEDDMsgLoop Class Reference

EDD Server Protocol Handler. More...

#include <EDDMsgLoop.h>

Collaboration diagram for tcEDDMsgLoop:

Collaboration graph
[legend]

List of all members.

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 tcEDDMsgLoopGetInstance (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 tcEDDMsgLoopgpMsgLoop = 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

tcEDDDataPipemaDataPipes [gnMaxDataPipes]
 table of physical layer interfaces
tcEDDDataSourcemaDataSources [gnMaxDataSources]
 table of data sources
unsigned int maSubscriptionTable [gnMaxDataPipes][gnMaxDataSources]
 subscription table
unsigned int maRcvThreadHandles [gnMaxDataPipes]
 receive thread handles for each physical layer
tcEDDThreadManagermpThreadManager
 pointer to OS layer thread abstraction
tcEDDLockManagermpLockManager
 pointer to OS layer thread lock abstraction
int mhTableLock
 Table lock for thread safety.
volatile bool maShutdownThread [gnMaxDataPipes]
 flag for receive threads to shutdown


Detailed Description

EDD Server Protocol Handler.

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.


Member Enumeration Documentation

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)

Enumerator:
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.


Constructor & Destructor Documentation

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.


Member Function Documentation

int tcEDDMsgLoop::AddDataPipe ( tcEDDDataPipe apDataPipe  ) 

Add a data pipe (a virtual device) to the message handling loop abstraction layer.

Parameters:
apDataPipe pointer to a valid data pipe interface
Returns:
-1 on error, or the data pipe ID registered with the loop handler ( used for RemoveDataPipe )

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.

Returns:
valid tcEDDMsgLoop class pointer.

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.


Member Data Documentation

const unsigned int tcEDDMsgLoop::gnMaxDataPipes = 10 [static]

maximum number of physical interfaces to poll

Definition at line 39 of file EDDMsgLoop.h.

const unsigned int tcEDDMsgLoop::gnMaxDataSources = 128 [static]

maximum number of data sources on server

Definition at line 40 of file EDDMsgLoop.h.

the singleton

Definition at line 45 of file EDDMsgLoop.h.

table of physical layer interfaces

Definition at line 69 of file EDDMsgLoop.h.

table of data sources

Definition at line 70 of file EDDMsgLoop.h.

receive thread handles for each physical layer

Definition at line 72 of file EDDMsgLoop.h.

volatile bool tcEDDMsgLoop::maShutdownThread[gnMaxDataPipes] [protected]

flag for receive threads to shutdown

Definition at line 76 of file EDDMsgLoop.h.

subscription table

Definition at line 71 of file EDDMsgLoop.h.

int tcEDDMsgLoop::mhTableLock [protected]

Table lock for thread safety.

Definition at line 75 of file EDDMsgLoop.h.

pointer to OS layer thread lock abstraction

Definition at line 74 of file EDDMsgLoop.h.

pointer to OS layer thread abstraction

Definition at line 73 of file EDDMsgLoop.h.


The documentation for this class was generated from the following files:

Generated on Sat Apr 25 17:20:45 2009 for EDD by  doxygen 1.5.8