EpcTools
An event based multi-threaded C++ development framework.
Public Member Functions | List of all members
PFCP::ApplicationWorkGroup< TWorker > Class Template Reference

The PFCP application work group template. This template contains the common event queue for the application worker threads. More...

#include <epfcp.h>

Inheritance diagram for PFCP::ApplicationWorkGroup< TWorker >:
EThreadEventWorkGroup< TQueue, TMessage, TWorker > PFCP::ApplicationWorkGroupBase

Public Member Functions

LocalNodeSPtr createLocalNode (ESocket::Address &addr, Bool start=True)
 Creates a local node. More...
 
Void startLocalNode (LocalNodeSPtr &ln)
 Startes an externally constructed local node. More...
 
Void stopLocalNode (LocalNodeSPtr &ln)
 Stops the local node. More...
 
LocalNodeSPtr createLocalNode (cpStr ipaddr, UShort port=PFCP::Configuration::port(), Bool start=True)
 Creates a local node. More...
 
LocalNodeSPtr createLocalNode (const EIpAddress &ipaddr, UShort port=PFCP::Configuration::port(), Bool start=True)
 
- Public Member Functions inherited from EThreadEventWorkGroup< TQueue, TMessage, TWorker >
 EThreadEventWorkGroup ()
 Default class constructor. More...
 
 ~EThreadEventWorkGroup ()
 The class destructor. More...
 
Bool isInitialized ()
 Retrieves indication if this work group object has been initialized. 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...
 
virtual Void init (Short appId, UShort workGroupId, Int minWorkers, Int maxWorkers=-1, Int queueSize=16384, pVoid arg=nullptr, Bool suspended=False, Dword stackSize=0)
 Initializes the thread object. More...
 
Void join ()
 Returns after successfully joining each worker thread. More...
 
Void quit ()
 Posts the quit message to all of the worker threads. More...
 
Void start ()
 Initializes the thread when it was suspended at init(). More...
 
Bool addWorker ()
 Creates a new worker thread if the current number of workers is less than the maximum configured. More...
 
Void initTimer (EThreadEventTimer &t)
 Intializes an EThreadEvent::Timer object and associates it with this work group. More...
 
ESemaphoreDatagetMsgSemaphore ()
 Returns the semaphore associated with this thread's event queue. More...
 

Additional Inherited Members

- Protected Member Functions inherited from EThreadEventWorkGroup< TQueue, TMessage, TWorker >
virtual Void onMessageQueued (const TMessage &msg)
 Called when an event message is queued. More...
 
virtual Void onCreateWorker (TWorker &worker)
 Called when a new worker thread object is created. More...
 
- Protected Member Functions inherited from PFCP::ApplicationWorkGroupBase
virtual LocalNodeSPtr _createLocalNode ()=0
 Creates a local node. More...
 
virtual RemoteNodeSPtr _createRemoteNode ()=0
 Creates a remote node. More...
 
virtual SessionBaseSPtr _createSession (LocalNodeSPtr &ln, RemoteNodeSPtr &rn)=0
 Creates a session object. More...
 

Detailed Description

template<class TWorker>
class PFCP::ApplicationWorkGroup< TWorker >

The PFCP application work group template. This template contains the common event queue for the application worker threads.

Member Function Documentation

template<class TWorker>
LocalNodeSPtr PFCP::ApplicationWorkGroup< TWorker >::createLocalNode ( cpStr  ipaddr,
UShort  port = PFCP::Configuration::port(),
Bool  start = True 
)
inline

Creates a local node.

Parameters
ipaddrthe IP address of the local node.
portthe port of the local node.
Returns
a shared pointer to the local node.
template<class TWorker>
LocalNodeSPtr PFCP::ApplicationWorkGroup< TWorker >::createLocalNode ( const EIpAddress ipaddr,
UShort  port = PFCP::Configuration::port(),
Bool  start = True 
)
inline
template<class TWorker>
LocalNodeSPtr PFCP::ApplicationWorkGroup< TWorker >::createLocalNode ( ESocket::Address addr,
Bool  start = True 
)

Creates a local node.

Parameters
addrthe IP address/port of the local node.
Returns
a shared pointer to hte local node.
template<class TWorker>
Void PFCP::ApplicationWorkGroup< TWorker >::startLocalNode ( LocalNodeSPtr &  ln)

Startes an externally constructed local node.

Parameters
lna shared pointer to the LocalNode.
template<class TWorker>
Void PFCP::ApplicationWorkGroup< TWorker >::stopLocalNode ( LocalNodeSPtr &  ln)

Stops the local node.

Parameters
lna shared pointer to the LocalNode.

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