Work group template definition. The work group contains the event queue that all of the associated worker threads will process. Worker threads can be added and removed at runtime as more or lessing processing capacity is requried.
More...
#include <etevent.h>
|
| | 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...
|
| |
| ESemaphoreData & | getMsgSemaphore () |
| | Returns the semaphore associated with this thread's event queue. More...
|
| |
template<class TQueue, class TMessage, class TWorker>
class EThreadEventWorkGroup< TQueue, TMessage, TWorker >
Work group template definition. The work group contains the event queue that all of the associated worker threads will process. Worker threads can be added and removed at runtime as more or lessing processing capacity is requried.
template<class TQueue, class TMessage, class TWorker>
Default class constructor.
template<class TQueue, class TMessage, class TWorker>
template<class TQueue, class TMessage, class TWorker>
Creates a new worker thread if the current number of workers is less than the maximum configured.
template<class TQueue, class TMessage, class TWorker>
Returns the semaphore associated with this thread's event queue.
template<class TQueue, class TMessage, class TWorker>
| virtual Void EThreadEventWorkGroup< TQueue, TMessage, TWorker >::init |
( |
Short |
appId, |
|
|
UShort |
workGroupId, |
|
|
Int |
minWorkers, |
|
|
Int |
maxWorkers = -1, |
|
|
Int |
queueSize = 16384, |
|
|
pVoid |
arg = nullptr, |
|
|
Bool |
suspended = False, |
|
|
Dword |
stackSize = 0 |
|
) |
| |
|
inlinevirtual |
Initializes the thread object.
- Parameters
-
| appId | identifies the application this thread is associated with. |
| workGroupId | the ID for the work group. |
| minWorkers | the minimum number of workers for this work group. |
| maxWorkers | the maximum number of workers for this work group. Defaults to the minWorkers value. |
| queueSize | the maximum number of unprocessed entries in the event queue. |
| arg | an argument that will be passed through to the internal thread procedure. Currently not used. |
| suspended | if True, the thread is not initialized until start() is called. |
| stackSize | the stack size. |
template<class TQueue, class TMessage, class TWorker>
Intializes an EThreadEvent::Timer object and associates it with this work group.
- Parameters
-
| t | the EThreadEvent::Timer object to initialize |
template<class TQueue, class TMessage, class TWorker>
Retrieves indication if this work group object has been initialized.
- Returns
- True if initialized, otherwise False.
template<class TQueue, class TMessage, class TWorker>
Returns after successfully joining each worker thread.
template<class TQueue, class TMessage, class TWorker>
Called when a new worker thread object is created.
- Parameters
-
| worker | a reference to the worker thread object created. |
template<class TQueue, class TMessage, class TWorker>
Called when an event message is queued.
- Parameters
-
| msg | the message object that has been queued. |
This method is called in the context of the thread where sendMessage() is called after the message has been added to the thread's event queue.
template<class TQueue, class TMessage, class TWorker>
Posts the quit message to all of the worker threads.
template<class TQueue, class TMessage, class TWorker>
Sends event message to this work group.
- Parameters
-
| message | the message ID |
| wait | waits for the message to be sent |
Sends (posts) an event message to the work group event queue. No additional data is posted with the event.
template<class TQueue, class TMessage, class TWorker>
Sends event message to this work group.
- Parameters
-
| message | the message ID. |
| voidptr | a void pointer to be included with the message. |
| wait | waits for the message to be sent. |
Sends (posts) an event message to the work group event queue. No additional data is posted with the event.
template<class TQueue, class TMessage, class TWorker>
Sends event message to this work group.
- Parameters
-
| msg | the message thread message object to send. |
| wait | waits for the message to be sent |
Sends (posts) the supplied event message to the work groups' event queue.
template<class TQueue, class TMessage, class TWorker>
Initializes the thread when it was suspended at init().
The documentation for this class was generated from the following file:
- /home/vagrant/share/code/epctools-omec-pfcp/include/epc/etevent.h