|
EpcTools
An event based multi-threaded C++ development framework.
|
The application worker thread class. The various virtual methods should be overridden to implement application specific behavior. Any additional event handlers can be added to handle application specific (non PFCP) events. More...
#include <epfcp.h>
Public Member Functions | |
| virtual Void | onInit () |
| Called when the worker thread is initialized. When overriding, the overriding method should call the associated base class method. More... | |
| virtual Void | onQuit () |
| Called when the worker thread is has received the EM_QUIT event. When overriding, the overriding method should call the associated base class method. More... | |
| virtual Void | onRcvdReq (AppMsgReqPtr req) |
| Called when a PFCP request message has been received. More... | |
| virtual Void | onRcvdRsp (AppMsgRspPtr rsp) |
| Called when a PFCP response message has been received. More... | |
| virtual Void | onReqTimeout (AppMsgReqPtr req) |
| Called when a PFCP request message has timed out waiting for the associated response message. More... | |
| virtual Void | onLocalNodeStateChange (LocalNodeSPtr &ln, LocalNode::State oldState, LocalNode::State newState) |
| Called when the local node state changes. More... | |
| virtual Void | onRemoteNodeStateChange (RemoteNodeSPtr &rn, RemoteNode::State oldState, RemoteNode::State newState) |
| Called when a new remote node/peer has been added. More... | |
| virtual Void | onRemoteNodeRestart (RemoteNodeSPtr &rn, const ETime &restartTime) |
| Called when a new remote node/peer has been added. More... | |
| virtual Void | onSndReqError (AppMsgReqPtr req, SndReqException &err) |
| Called when a remote node/peer object is removed. More... | |
| virtual Void | onSndRspError (AppMsgRspPtr rsp, SndRspException &err) |
| Called when an error is encountered while sending a response message. More... | |
| virtual Void | onEncodeReqError (AppMsgReqPtr req, EncodeReqException &err) |
| Called when an error is encountered while encoding a request message. More... | |
| virtual Void | onEncodeRspError (AppMsgRspPtr rsp, EncodeRspException &err) |
| Called when an error is encountered while encoding a response message. More... | |
Public Member Functions inherited from EThreadEventWorker< TQueue, TMessage > | |
| Int | workerId () const |
| virtual Void | onTimer (EThreadEventTimer *ptimer) |
| Called in the context of the thread when th EM_TIMER event is processed. More... | |
| ESemaphoreData & | getMsgSemaphore () |
| Returns the semaphore associated with this work groups' event queue. More... | |
| Bool | sendMessage (UInt message, Bool wait=True) |
| Sends event message to this work group. More... | |
| Bool | sendMessage (UInt message, pVoid voidptr, Bool wait=True) |
| Sends event message to this work group. More... | |
| Bool | sendMessage (const TMessage &msg, Bool wait=True) |
| Sends event message to this work group. More... | |
Public Member Functions inherited from EThreadBasic | |
| EThreadBasic () | |
| Class constructor. More... | |
| virtual | ~EThreadBasic () |
| Class destructor. More... | |
| Void | init (pVoid arg, size_t stackSize=0) |
| Initialize and start the thread. More... | |
| Void | join () |
| Waits for the thread to terminate. More... | |
| Bool | isInitialized () |
| Returns the thread initialization state. More... | |
| RunState | getRunState () |
| Returns the current thread run state. More... | |
| Bool | isWaitingToRun () |
| Determines if the thread is waiting to run. More... | |
| Bool | isRunning () |
| Determines if the thread is running. More... | |
| Bool | isDoneRunning () |
| Determines if the thread has finished running. More... | |
| Int | cancelWait () |
| Sends a cancellation request to the thread. More... | |
| Void | signal (Int sig) |
Friends | |
| Void | Uninitialize () |
| Uninitializes/stops the PFCP stack. More... | |
Additional Inherited Members | |
Public Types inherited from EThreadBasic | |
| enum | RunState { rsWaitingToRun, rsRunning, rsDoneRunning } |
| EThreadBasic run states. More... | |
Static Public Member Functions inherited from EThreadBasic | |
| static Void | sleep (Int milliseconds) |
| Sleeps for the specified number of milliseconds. More... | |
| static Void | yield () |
| Relinquishes the CPU. More... | |
Protected Member Functions inherited from EThreadEventWorker< TQueue, TMessage > | |
| EThreadEventWorker () | |
| Default class constructor. More... | |
| ~EThreadEventWorker () | |
| The class destructor. More... | |
| virtual Void | onMessageQueued (const TMessage &msg) |
| Called when an event message is queued. More... | |
| virtual Void | init (TQueue &queue, Int workerid, pVoid arg, Dword stackSize=0) |
| Initializes the thread object. More... | |
| Void | start () |
| Initializes the thread when it was suspended at init(). More... | |
| Bool | pumpMessage (TMessage &msg, Bool wait=true) |
| Dispatches the next thread event message. More... | |
| virtual Void | pumpMessages () |
| Process event messages. More... | |
| virtual Void | defaultMessageHandler (TMessage &msg) |
| The default event message handler. More... | |
| pid_t | getThreadId () |
| Retrieves the internal thread ID. More... | |
Static Protected Member Functions inherited from EThreadBasic | |
| static Void | Initialize () |
| performs internal initialization *** DO NOT CALL *** More... | |
| static Void | UnInitialize () |
| performs internal de-initialization *** DO NOT CALL *** More... | |
The application worker thread class. The various virtual methods should be overridden to implement application specific behavior. Any additional event handlers can be added to handle application specific (non PFCP) events.
|
virtual |
Called when an error is encountered while encoding a request message.
| req | the appication request message that failed. |
| err | a reference to the associated exception. |
|
virtual |
Called when an error is encountered while encoding a response message.
| rsp | the appication response message that failed. |
| err | a reference to the associated exception. |
|
virtual |
Called when the worker thread is initialized. When overriding, the overriding method should call the associated base class method.
Reimplemented from EThreadEventWorker< TQueue, TMessage >.
|
virtual |
Called when the local node state changes.
| ln | a shared pointer to the local node object. |
| oldState | the previous state of the local node. |
| newState | the new state of the local node. |
|
virtual |
Called when the worker thread is has received the EM_QUIT event. When overriding, the overriding method should call the associated base class method.
Reimplemented from EThreadEventWorker< TQueue, TMessage >.
|
virtual |
Called when a PFCP request message has been received.
| req | a pointer to the request message. |
|
virtual |
Called when a PFCP response message has been received.
| rsp | a pointer to the response message. |
|
virtual |
Called when a new remote node/peer has been added.
| rmtNode | a shared pointer to the remote node object. |
|
virtual |
Called when a new remote node/peer has been added.
| rn | a shared pointer to the remote node object. |
| oldState | the previous state of the remote node. |
| newState | the new state of the remote node. |
|
virtual |
Called when a PFCP request message has timed out waiting for the associated response message.
| req | a pointer to the request message that did not receive a response. |
|
virtual |
Called when a remote node/peer object is removed.
| rn | a shared pointer to the remote node object. |
| restartTime | the time the remote node restarted. |
|
virtual |
Called when an error is encountered while sending a response message.
| rsp | the appication response message that failed. |
| err | a reference to the associated exception. |
|
friend |
Uninitializes/stops the PFCP stack.
1.8.11