EpcTools
An event based multi-threaded C++ development framework.
|
Go to the documentation of this file.
21 #include <sys/syscall.h>
39 DECLARE_ERROR(EThreadQueueBaseError_MultipleReadersNotAllowed);
100 Long int32[
sizeof(pVoid) /
sizeof(Long)];
101 Short int16[
sizeof(pVoid) /
sizeof(Short)];
102 Char int8[
sizeof(pVoid) /
sizeof(Char)];
104 ULong uint32[
sizeof(pVoid) /
sizeof(ULong)];
105 UShort uint16[
sizeof(pVoid) /
sizeof(UShort)];
106 UChar uint8[
sizeof(pVoid) /
sizeof(UChar)];
165 EThreadEventMessageData(UInt msgid, Char v1, Char v2, Char v3, Char v4, Char v5, Char v6, Char v7, Char v8) :
EThreadEventMessageDataBase(msgid), m_data{.int8={v1,v2,v3,v4,v5,v6,v7,v8}} {}
176 EThreadEventMessageData(UInt msgid, UChar v1, UChar v2, UChar v3, UChar v4, UChar v5, UChar v6, UChar v7, UChar v8) :
EThreadEventMessageDataBase(msgid), m_data{.uint8={v1,v2,v3,v4,v5,v6,v7,v8}} {}
180 DataUnion &
data() {
return m_data; }
324 EThreadMessage(UInt msgid, Char v1, Char v2=0, Char v3=0, Char v4=0, Char v5=0, Char v6=0, Char v7=0, Char v8=0)
336 EThreadMessage(UInt msgid, UChar v1, UChar v2=0, UChar v3=0, UChar v4=0, UChar v5=0, UChar v6=0, UChar v7=0, UChar v8=0)
372 throw EThreadQueueBaseError_NotOpenForWriting();
374 if (semFree().Decrement(wait) < 0)
380 data()[msgHead()] = msg;
381 data()[msgHead()].data().getTimer().Start();
385 if (msgHead() >= msgCnt())
389 semMsgs().Increment();
401 throw EThreadQueueBaseError_NotOpenForReading();
403 if (!semMsgs().Decrement(wait))
406 msg = data()[msgTail()++];
408 if (msgTail() >= msgCnt())
411 semFree().Increment();
424 throw EThreadQueueBaseError_NotOpenForReading();
426 if (!semMsgs().Decrement(wait))
429 msg = data()[msgTail()];
433 semMsgs().Increment();
448 virtual Bool isPublic() = 0;
449 virtual Int &msgCnt() = 0;
450 virtual Int &msgHead() = 0;
451 virtual Int &msgTail() = 0;
452 virtual Bool &multipleWriters() = 0;
453 virtual Int &numReaders() = 0;
454 virtual Int &numWriters() = 0;
455 virtual Int &refCnt() = 0;
456 virtual T *data() = 0;
457 virtual Void allocDataSpace(cpStr sFile, Char cId, Int nSize) = 0;
458 virtual Void initMutex() = 0;
459 virtual Void initSemFree(UInt initialCount) = 0;
460 virtual Void initSemMsgs(UInt initialCount) = 0;
466 virtual int *getBumpPipe() = 0;
470 m_initialized =
False;
476 Void init(Int nMsgCnt, Int threadId, Bool bMultipleWriters,
EThreadQueueMode eMode)
485 int nSize =
sizeof(T) * nMsgCnt;
488 allocDataSpace(szName,
'A', nSize);
496 multipleWriters() = bMultipleWriters;
503 initSemFree(msgCnt());
514 throw EThreadQueueBaseError_MultipleReadersNotAllowed();
521 m_initialized =
True;
526 Bool destroyMutex =
False;
588 Void
init(Int nMsgCnt, Int threadId, Bool bMultipleWriters,
596 Bool isPublic() {
return True; }
597 Int &msgCnt() {
return m_pCtrl->m_msgCnt; }
598 Int &msgHead() {
return m_pCtrl->m_head; }
599 Int &msgTail() {
return m_pCtrl->m_tail; }
600 Bool &multipleWriters() {
return m_pCtrl->m_multipleWriters; }
601 Int &numReaders() {
return m_pCtrl->m_numReaders; }
602 Int &numWriters() {
return m_pCtrl->m_numWriters; }
603 Int &refCnt() {
return m_pCtrl->m_refCnt; }
604 T *data() {
return m_pData; }
605 Void allocDataSpace(cpStr sFile, Char cId, Int nSize)
607 m_sharedmem.
init(sFile, cId, nSize +
sizeof(ethreadmessagequeue_ctrl_t));
608 m_pCtrl = (ethreadmessagequeue_ctrl_t *)m_sharedmem.
getDataPtr();
609 m_pData = (T *)(((pChar)m_sharedmem.
getDataPtr()) +
sizeof(ethreadmessagequeue_ctrl_t));
614 m_pCtrl->m_mutexid = m.
mutexId();
617 Void initSemFree(UInt initialCount)
620 m_pCtrl->m_freeSemId = s.semIndex();
623 Void initSemMsgs(UInt initialCount)
626 m_pCtrl->m_msgsSemId = s.semIndex();
630 EMutexData &mutex() {
return ESynchObjects::getMutex(m_pCtrl->m_mutexid); }
631 ESemaphoreData &semFree() {
return ESynchObjects::getSemaphore(m_pCtrl->m_freeSemId); }
632 ESemaphoreData &semMsgs() {
return ESynchObjects::getSemaphore(m_pCtrl->m_msgsSemId); }
634 int *getBumpPipe() {
return m_pCtrl->m_bumppipe; }
643 Bool m_multipleWriters;
654 } ethreadmessagequeue_ctrl_t;
657 ethreadmessagequeue_ctrl_t *m_pCtrl;
681 m_multipleWriters =
False;
693 delete[](pChar) m_pData;
705 Void
init(Int nMsgCnt, Int threadId, Bool bMultipleWriters,
713 Bool isPublic() {
return False; }
714 Int &msgCnt() {
return m_msgCnt; }
715 Int &msgHead() {
return m_head; }
716 Int &msgTail() {
return m_tail; }
717 Bool &multipleWriters() {
return m_multipleWriters; }
718 Int &numReaders() {
return m_numReaders; }
719 Int &numWriters() {
return m_numWriters; }
720 Int &refCnt() {
return m_refCnt; }
721 T *data() {
return m_pData; }
722 Void allocDataSpace(cpStr sFile, Char cId, Int nSize)
725 memset((pChar)m_pData, 0, nSize);
731 Void initSemFree(UInt initialCount)
733 m_semFree.
init(initialCount);
735 Void initSemMsgs(UInt initialCount)
737 m_semMsgs.
init(initialCount);
744 int *getBumpPipe() {
return m_bumppipe; }
751 Bool m_multipleWriters;
777 #define EM_SOCKETSELECT_READ 5
779 #define EM_SOCKETSELECT_WRITE 6
781 #define EM_SOCKETSELECT_ERROR 7
783 #define EM_SOCKETSELECT_EXCEPTION 8
785 #define EM_USER 10000
793 #define DECLARE_MESSAGE_MAP() \
795 static const msgmap_t *GetThisMessageMap(); \
796 virtual const msgmap_t *GetMessageMap() const;
803 #define BEGIN_MESSAGE_MAP(theClass, baseClass) \
804 const theClass::msgmap_t *theClass::GetMessageMap() const \
806 return GetThisMessageMap(); \
808 const theClass::msgmap_t *theClass::GetThisMessageMap() \
810 typedef baseClass TheBaseClass; \
811 _Pragma("GCC diagnostic push") \
812 _Pragma("GCC diagnostic ignored \"-Wpmf-conversions\"") \
813 static const msgentry_t _msgEntries[] = \
817 #define ON_MESSAGE(id, memberFxn) \
818 {id, (msgfxn_t)&memberFxn},
821 #define END_MESSAGE_MAP() \
822 {0, (msgfxn_t)NULL} \
824 _Pragma("GCC diagnostic pop") \
825 static const msgmap_t msgMap = \
826 {&TheBaseClass::GetThisMessageMap, &_msgEntries[0]}; \
864 struct sigevent sev = {};
865 sev.sigev_notify = SIGEV_SIGNAL;
866 sev.sigev_signo = SIGRTMIN;
867 sev.sigev_value.sival_ptr =
this;
868 if (timer_create(CLOCK_REALTIME, &sev, &m_timer) == -1)
869 throw EThreadTimerError_UnableToInitialize();
896 m_interval = milliseconds;
914 timer_delete(m_timer);
935 throw EThreadTimerError_NotInitialized();
937 struct itimerspec its;
938 its.it_value.tv_sec = m_interval / 1000;
939 its.it_value.tv_nsec = (m_interval % 1000) * 1000000;
940 its.it_interval.tv_sec = m_oneshot ? 0 : its.it_value.tv_sec;
941 its.it_interval.tv_nsec = m_oneshot ? 0 : its.it_value.tv_nsec;
942 if (timer_settime(m_timer, 0, &its, NULL) == -1)
943 throw EThreadTimerError_UnableToStart();
950 struct itimerspec its;
951 its.it_value.tv_sec = 0;
952 its.it_value.tv_nsec = 0;
953 its.it_interval.tv_sec = its.it_value.tv_sec;
954 its.it_interval.tv_nsec = its.it_value.tv_nsec;
955 timer_settime(m_timer, 0, &its, NULL);
987 static void _timerHandler(
int signo, siginfo_t *pinfo,
void *pcontext)
998 static Long m_nextid;
1009 class EThreadEventTimerHandler :
EStatic
1012 EThreadEventTimerHandler() {}
1013 ~EThreadEventTimerHandler() {}
1015 virtual Int
getInitType() {
return STATIC_INIT_TYPE_THREADS; }
1018 struct sigaction sa;
1019 sa.sa_flags = SA_SIGINFO;
1020 sa.sa_sigaction = EThreadEventTimer::_timerHandler;
1021 sigemptyset(&sa.sa_mask);
1022 int signo = SIGRTMIN;
1023 if (sigaction(signo, &sa, NULL) == -1)
1024 throw EThreadTimerError_UnableToRegisterTimerHandler();
1039 template <
class TQueue,
class TMessage>
1053 const msgmap_t *(*pfnGetBaseMap)();
1054 const msgentry_t *lpEntries;
1084 TMessage msg(message);
1085 Bool result = m_queue.push(msg, wait);
1102 TMessage msg(message);
1103 msg.setVoidPtr(voidptr);
1104 Bool result = m_queue.push(msg, wait);
1119 Bool result = m_queue.push(msg, wait);
1133 virtual Void
init(Short appId, UShort threadId, pVoid arg, Int queueSize = 16384, Bool suspended =
False, Dword stackSize = 0)
1136 m_threadId = threadId;
1137 m_queueSize = queueSize;
1138 m_stacksize = stackSize;
1140 long id = m_appId * 10000 + m_threadId;
1205 TMessage *msg =
new TMessage(
EM_TIMER);
1206 msg->setVoidPtr(&t);
1212 return m_queue.semMsgs();
1217 virtual const msgmap_t *GetMessageMap()
const
1219 return GetThisMessageMap();
1221 static const msgmap_t *GetThisMessageMap()
1227 return m_queue.getBumpPipe();
1255 Bool bMsg = m_queue.pop(msg, wait);
1279 if (msg.getMessageId() ==
EM_QUIT)
1311 m_tid = syscall(SYS_gettid);
1316 Dword threadProc(pVoid arg)
1322 Bool dispatch(TMessage &msg)
1324 Bool keepgoing =
True;
1325 const msgmap_t *pMap;
1326 const msgentry_t *pEntries;
1328 if (msg.getMessageId() >=
EM_USER)
1331 for (pMap = GetMessageMap(); keepgoing && pMap && pMap->pfnGetBaseMap != NULL; pMap = (*pMap->pfnGetBaseMap)())
1334 for (pEntries = pMap->lpEntries; pEntries->nMessage; pEntries++)
1336 if (pEntries->nMessage == msg.getMessageId())
1338 (this->*pEntries->pFn)(msg);
1350 switch (msg.getMessageId())
1384 return sendMessage( (
const TMessage &)msg, wait );
1389 delete (TMessage*)msg;
1410 #endif // #ifndef __ETEVENT_H
EThreadMessage()
Default class constructor.
Definition: etevent.h:270
Thread timer class.
Definition: etevent.h:852
virtual Void onInit()
Called in the context of the thread when the EM_INIT event is processed.
Definition: etevent.h:1182
ETimer & getTimer()
Retrieves the timer associated with this event message.
Definition: etevent.h:85
T & data()
Retrieves the data portion of the message.
Definition: etevent.h:233
#define DECLARE_ERROR(__e__)
Declares exception class derived from EError with no constructor parameters.
Definition: eerror.h:53
Definition of a public event thread message queue.
Definition: etevent.h:566
EThreadEventMessageData(UInt msgid, Short v1, Short v2, Short v3, Short v4)
Class constructor.
Definition: etevent.h:147
#define atomic_inc(a)
atomic increment - increments a by 1
Definition: eatomic.h:27
virtual Bool _sendMessage(const _EThreadEventMessageBase &msg, Bool wait=True)
Definition: etevent.h:836
UInt getMessageId()
Retrieves the event message ID associated with this event message.
Definition: etevent.h:239
Defines base class for exceptions and declaration helper macros.
UInt getMessageId()
Retrieves the event message ID.
Definition: etevent.h:67
Contains the data associated with a public or private semaphore.
Definition: esynch.h:268
EThreadEventMessageData(UInt msgid, ULong v1, ULong v2)
Class constructor.
Definition: etevent.h:140
Void detach()
Detaches from the public mutex object.
Definition: esynch.cpp:432
virtual ~EThreadEventMessageBase()
Class destructor.
Definition: etevent.h:221
EThreadMessage(UInt msgid, Char v1, Char v2=0, Char v3=0, Char v4=0, Char v5=0, Char v6=0, Char v7=0, Char v8=0)
Class constructor.
Definition: etevent.h:324
EThreadEventMessageBase< EThreadEventMessageData > _EThreadMessage
Definition: etevent.h:261
virtual Void pumpMessages()
Process event messages.
Definition: etevent.h:1269
Defines the functionality for the thread queue.
Definition: etevent.h:359
EThreadQueueMode
Defines how a client can access a thread queue.
Definition: etevent.h:344
EThreadMessage(UInt msgid, UChar v1, UChar v2=0, UChar v3=0, UChar v4=0, UChar v5=0, UChar v6=0, UChar v7=0, UChar v8=0)
Class constructor.
Definition: etevent.h:336
Void initTimer(EThreadEventTimer &t)
Intializes an EThreadEvent::Timer object and associates with this thread.
Definition: etevent.h:1203
~EThreadEventTimer()
Class destructor.
Definition: etevent.h:900
#define True
True.
Definition: ebase.h:25
EThreadEventMessageData()
Default constructor.
Definition: etevent.h:111
EThreadEventMessageDataBase()
Default constructor.
Definition: etevent.h:60
An event message that is to be sent to a thread.
Definition: etevent.h:266
EThreadEventMessageDataBase(UInt msgid)
Class constructor.
Definition: etevent.h:63
Long getId()
Returns the unique timer id.
Definition: etevent.h:976
Void setVoidPtr(pVoid p)
Sets the void pointer.
Definition: etevent.h:188
virtual Void uninit()
Performs uninitialization at system shutdown.
Definition: estatic.h:63
EThreadEventMessageData(UInt msgid, UChar v1, UChar v2, UChar v3, UChar v4, UChar v5, UChar v6, UChar v7, UChar v8)
Class constructor.
Definition: etevent.h:176
virtual Void setVoidPtr(pVoid p)=0
Sets the void pointer.
Bool pop(T &msg, Bool wait=True)
Removes the next message from the thread event queue.
Definition: etevent.h:398
EThreadEventTimer(Long milliseconds, Bool oneshot=False)
Class constructor with configuration parameters.
Definition: etevent.h:890
Void start()
Initializes the thread when it was suspended at init().
Definition: etevent.h:1154
EThreadMessage(UInt msgid, UShort v1, UShort v2=0, UShort v3=0, UShort v4=0)
Class constructor.
Definition: etevent.h:313
Bool sendMessage(UInt message, Bool wait=True)
Sends event message to this thread.
Definition: etevent.h:1082
Defines a class for access to shared memory.
Macros for various standard C library functions and standard includes.
Any EpcTools that needs to have initialization performed as part of EpcTools::Initialize() should der...
Definition: estatic.h:51
Definition: etevent.h:833
virtual Void onTimer(EThreadEventTimer *ptimer)
Called in the context of the thread when th EM_TIMER event is processed.
Definition: etevent.h:1197
Definition of a private event thread message queue.
Definition: etevent.h:670
A private mutex (the mutex data is allocated from either the heap or stack).
Definition: esynch.h:175
EThreadEventTimer()
Default class constructor.
Definition: etevent.h:875
base class for EThreadPrivate and EThreadPublic
Definition: etevent.h:1040
~EThreadQueuePrivate()
Class destructor.
Definition: etevent.h:689
Void init(Long initcnt)
Initializes the data associated with the semaphore.
Definition: esynch.h:402
Bool push(const T &msg, Bool wait=True)
Adds the specified message to the thread event queue.
Definition: etevent.h:369
pid_t getThreadId()
Retrieves the internal thread ID.
Definition: etevent.h:1308
EThreadMessage(UInt msgid, pVoid v)
Class constructor.
Definition: etevent.h:281
EThreadMessage(UInt msgid, EThreadEventMessageData &data)
Class constructor.
Definition: etevent.h:277
pVoid getVoidPtr()
Retrieves the void pointer.
Definition: etevent.h:184
A template class that all event message classes should derive from.
Definition: etevent.h:206
Contains definitions for synchronization objects.
virtual Void onQuit()
Called in the context of the thread when the EM_QUIT event is processed.
Definition: etevent.h:1186
Void resume()
Resumes a suspended thread.
Definition: etevent.h:1176
Allows read or write access.
EThreadEventMessageBase()
Default constructor.
Definition: etevent.h:210
Bool Decrement(Bool wait=True)
Decrements the semaphore value.
Definition: esynch.h:348
#define EM_INIT
thread initialization event
Definition: etevent.h:770
EThreadEventMessageData(UInt msgid, Long v1, Long v2)
Class constructor.
Definition: etevent.h:135
Represents a public semaphore, the semaphore data is located in shared memory.
Definition: esynch.h:446
Void setInterval(Long interval)
sets the timer interval
Definition: etevent.h:964
Bool sendMessage(UInt message, pVoid voidptr, Bool wait=True)
Sends event message to this thread.
Definition: etevent.h:1100
A public mutex (the mutex data is located in shared memory).
Definition: esynch.h:223
Implements a stopwatch style timer.
Definition: etimer.h:26
EThreadQueueMode mode()
Retrieves the access mode associated with this queue object.
Definition: etevent.h:443
pVoid getDataPtr()
Retrieves a pointer to the first location of the shated memory.
Definition: eshmem.h:65
Void init(cpStr file, Int id, Int size)
Initializes this shared memory object. This method is called by the parameterized constructor.
Definition: eshmem.cpp:109
Int mutexId()
Retrieves the mutex ID associated with this public mutex.
Definition: esynch.h:253
Bool sendMessage(const TMessage &msg, Bool wait=True)
Sends event message to this thread.
Definition: etevent.h:1117
#define False
False.
Definition: ebase.h:27
Void setOneShot(Bool oneshot)
sets the type of timer
Definition: etevent.h:969
Void destroy()
Stops and destroys the underlying timer object.
Definition: etevent.h:909
Void init(Int nMsgCnt, Int threadId, Bool bMultipleWriters, EThreadQueueMode eMode)
Initializes this public event thead message queue object.
Definition: etevent.h:588
Bool isInitialized()
Returns the thread initialization state.
Definition: etbasic.cpp:133
EThreadMessage(UInt msgid, ULong v1, ULong v2=0)
Class constructor.
Definition: etevent.h:299
EThreadEvent< EThreadQueuePrivate< EThreadMessage >, EThreadMessage > EThreadPrivate
Definition: etevent.h:1405
~EThreadEvent()
Rhe class destructor.
Definition: etevent.h:1069
#define EM_USER
beginning of user events
Definition: etevent.h:786
EThreadEventMessageDataBase & setMessageId(UInt msgid)
Sets the event message ID.
Definition: etevent.h:71
#define EM_QUIT
thread quit event
Definition: etevent.h:772
Void stop()
Stops the timer.
Definition: etevent.h:946
EThreadEventMessageData(UInt msgid, LongLong v)
Class constructor.
Definition: etevent.h:126
Represents a private semaphore, the semaphore data is allocated from either the stack or heap.
Definition: esynch.h:382
Bool isInitialized()
Retrieves indication if this queue object has been initialized.
Definition: etevent.h:440
virtual Void init(Short appId, UShort threadId, pVoid arg, Int queueSize=16384, Bool suspended=False, Dword stackSize=0)
Initializes the thread object.
Definition: etevent.h:1133
#define EM_SUSPEND
thread suspend event
Definition: etevent.h:774
#define DECLARE_ERROR_ADVANCED(__e__)
Declares exception class derived from EError with no constructor parameters and developer defined con...
Definition: eerror.h:59
Bool Increment()
Increments the semaphore value.
Definition: esynch.h:351
virtual Void onSuspend()
Called in the context of the thread when th EM_SUSPEND event is processed.
Definition: etevent.h:1190
Void init(Int nMsgCnt, Int threadId, Bool bMultipleWriters, EThreadQueueMode eMode)
Initializes this public event thead message queue object.
Definition: etevent.h:705
Bool peek(T &msg, Bool wait=True)
Retrievees the next message from the thread event queue without removing the message from the queue.
Definition: etevent.h:421
~EThreadQueuePublic()
Class destructor.
Definition: etevent.h:577
T & operator=(const T &data)
Assignment operator.
Definition: etevent.h:226
EThreadEventMessageData(UInt msgid, ULongLong v)
Class constructor.
Definition: etevent.h:130
Void suspend()
Suspends a running thread.
Definition: etevent.h:1170
The base class that all event message data objects should be derived from.
Definition: etevent.h:56
DataUnion & data()
Retrieves the data union object.
Definition: etevent.h:180
The shared memory access class.
Definition: eshmem.h:43
virtual pVoid getVoidPtr()=0
Retrieves the void pointer.
Void init(pVoid arg, size_t stackSize=0)
Initialize and start the thread.
Definition: etbasic.cpp:106
virtual Void messageQueued()
Called when an event message is queued.
Definition: etevent.h:1236
Void setVoidPtr(pVoid p)
Sets the void pointer for this event message.
Definition: etevent.h:250
The event message base class.
Definition: etevent.h:197
Bool isInitialized()
Indicates if this timer object has been initialized.
Definition: etevent.h:983
Void start()
Starts the timer.
Definition: etevent.h:932
An abstract class that represents contains the threadProc() that will be run in a separate thread.
Definition: etbasic.h:53
virtual Void _destroyMessage(_EThreadEventMessageBase *msg)
Definition: etevent.h:840
virtual ~_EThreadEventMessageBase()
Virtual class destructor.
Definition: etevent.h:201
EThreadMessage(UInt msgid, Long v1, Long v2=0)
Class constructor.
Definition: etevent.h:294
EThreadEventMessageData(UInt msgid, EThreadEventMessageData &data)
Class constructor.
Definition: etevent.h:118
Manages configuration parameters from a file and the command line.
Long getInterval()
Returns the timer interval in milliseconds.
Definition: etevent.h:959
EThreadEventMessageData(UInt msgid, Char v1, Char v2, Char v3, Char v4, Char v5, Char v6, Char v7, Char v8)
Class constructor.
Definition: etevent.h:165
virtual Void defaultMessageHandler(TMessage &msg)
The default event message handler.
Definition: etevent.h:1303
friend class EThreadEventTimerHandler
Definition: etevent.h:854
An event message data object that provides access to a union over 8 bytes of data.
Definition: etevent.h:93
Void quit()
Posts the quit message to this thread.
Definition: etevent.h:1149
EThreadEventMessageData(UInt msgid)
Class constructor.
Definition: etevent.h:114
#define EPC_FILENAME_MAX
maximum file name length
Definition: ebase.h:37
EThreadMessage(UInt msgid, LongLong v)
Class constructor.
Definition: etevent.h:285
The base class for exceptions derived from std::exception.
Definition: eerror.h:92
EThreadMessage(UInt msgid, Short v1, Short v2=0, Short v3=0, Short v4=0)
Class constructor.
Definition: etevent.h:306
EThreadQueuePrivate()
Default constructor.
Definition: etevent.h:675
EThreadEvent< EThreadQueuePublic< EThreadMessage >, EThreadMessage > EThreadPublic
Definition: etevent.h:1404
EThreadEventMessageBase(const T &data)
Copy constructor.
Definition: etevent.h:216
#define EM_TIMER
thread timer expiration event
Definition: etevent.h:776
pVoid getVoidPtr()
Retrieves the void pointer from the data portion of this event message.
Definition: etevent.h:246
EThreadEventMessageData(UInt msgid, pVoid v)
Class constructor.
Definition: etevent.h:122
Void init()
Definition: esynch.h:195
ESemaphoreData & getMsgSemaphore()
Returns the semaphore associated with this thread's event queue.
Definition: etevent.h:1210
#define epc_sprintf_s
epc_sprintf_s - sprintf_s
Definition: ebase.h:46
Acquires and holds a lock on the specified mutex.
Definition: esynch.h:133
ETimer & getTimer()
Retrieves the timer associated with this event message.
Definition: etevent.h:255
virtual Void init(EGetOpt &opt)
Performs class specific initialization.
Definition: estatic.h:61
EThreadMessage(UInt msgid, ULongLong v)
Class constructor.
Definition: etevent.h:289
Bool pumpMessage(TMessage &msg, Bool wait=true)
Dispatches the next thread event message.
Definition: etevent.h:1253
virtual Int getInitType()
Definition: estatic.h:57
EThreadEventMessageData(UInt msgid, UShort v1, UShort v2, UShort v3, UShort v4)
Class constructor.
Definition: etevent.h:154
#define atomic_dec(a)
atomic decrement - decrements a by 1
Definition: eatomic.h:25
EThreadMessage(UInt msgid)
Class constructor.
Definition: etevent.h:273
EThreadEvent()
Default class constructor.
Definition: etevent.h:1059
EThreadQueuePublic()
Default constructor.
Definition: etevent.h:571
Contains the data associated with a public or private mutex.
Definition: esynch.h:72
EThreadEventMessageBase & setMessageId(UInt msgid)
Sets the event message ID for this event message.
Definition: etevent.h:243