EpcTools
An event based multi-threaded C++ development framework.
Classes | Macros | Typedefs | Enumerations
etevent.h File Reference
#include <unistd.h>
#include <sys/syscall.h>
#include "ebase.h"
#include "etbasic.h"
#include "eerror.h"
#include "egetopt.h"
#include "eshmem.h"
#include "esynch.h"
#include "esynch2.h"
#include "etimer.h"

Go to the source code of this file.

Classes

class  EThreadEventMessageDataBase
 The base class that all event message data objects should be derived from. More...
 
class  EThreadEventMessageData
 An event message data object that provides access to a union over 8 bytes of data. More...
 
class  _EThreadEventMessageBase
 The event message base class. More...
 
class  EThreadEventMessageBase< T >
 A template class that all event message classes should derive from. More...
 
class  EThreadMessage
 An event message that is to be sent to a thread. More...
 
class  EThreadQueueBase< T >
 Defines the functionality for the thread queue. More...
 
class  EThreadQueuePublic< T >
 Definition of a public event thread message queue. More...
 
class  EThreadQueuePrivate< T >
 Definition of a private event thread message queue. More...
 
class  _EThreadEventBase
 
class  EThreadEventTimer
 Thread timer class. More...
 
class  EThreadEvent< TQueue, TMessage >
 base class for EThreadPrivate and EThreadPublic More...
 

Macros

#define EM_INIT   1
 thread initialization event More...
 
#define EM_QUIT   2
 thread quit event More...
 
#define EM_SUSPEND   3
 thread suspend event More...
 
#define EM_TIMER   4
 thread timer expiration event More...
 
#define EM_SOCKETSELECT_READ   5
 socket read event see ESocketThread More...
 
#define EM_SOCKETSELECT_WRITE   6
 socket write event see ESocketThread More...
 
#define EM_SOCKETSELECT_ERROR   7
 socket select error event see ESocketThread More...
 
#define EM_SOCKETSELECT_EXCEPTION   8
 socket exception event see ESocketThread More...
 
#define EM_USER   10000
 beginning of user events More...
 
#define DECLARE_MESSAGE_MAP()
 Inserts message map declarations into the thread class. More...
 
#define BEGIN_MESSAGE_MAP(theClass, baseClass)
 Begins the message map declaration. More...
 
#define ON_MESSAGE(id, memberFxn)   {id, (msgfxn_t)&memberFxn},
 Defines an invidual event handler. More...
 
#define END_MESSAGE_MAP()
 Ends the message map declaration. More...
 

Typedefs

typedef EThreadEventMessageBase< EThreadEventMessageData_EThreadMessage
 
typedef EThreadEvent< EThreadQueuePublic< EThreadMessage >, EThreadMessageEThreadPublic
 
typedef EThreadEvent< EThreadQueuePrivate< EThreadMessage >, EThreadMessageEThreadPrivate
 

Enumerations

enum  EThreadQueueMode { EThreadQueueMode::ReadOnly, EThreadQueueMode::WriteOnly, EThreadQueueMode::ReadWrite }
 Defines how a client can access a thread queue. More...
 

Macro Definition Documentation

◆ BEGIN_MESSAGE_MAP

#define BEGIN_MESSAGE_MAP (   theClass,
  baseClass 
)
Value:
const theClass::msgmap_t *theClass::GetMessageMap() const \
{ \
return GetThisMessageMap(); \
} \
const theClass::msgmap_t *theClass::GetThisMessageMap() \
{ \
typedef baseClass TheBaseClass; \
_Pragma("GCC diagnostic push") \
_Pragma("GCC diagnostic ignored \"-Wpmf-conversions\"") \
static const msgentry_t _msgEntries[] = \
{

Begins the message map declaration.

The event message map establishes the relationship of the event ID's to the individual event handlers defined in the class. "theClass" is the name of the class containing the message handlers. "baseClass" is the class name that "theClass" is derived from.

◆ DECLARE_MESSAGE_MAP

#define DECLARE_MESSAGE_MAP ( )
Value:
protected: \
static const msgmap_t *GetThisMessageMap(); \
virtual const msgmap_t *GetMessageMap() const;

Inserts message map declarations into the thread class.

This macro should be used in the event thread class definition.

◆ EM_INIT

#define EM_INIT   1

thread initialization event

◆ EM_QUIT

#define EM_QUIT   2

thread quit event

◆ EM_SOCKETSELECT_ERROR

#define EM_SOCKETSELECT_ERROR   7

socket select error event see ESocketThread

◆ EM_SOCKETSELECT_EXCEPTION

#define EM_SOCKETSELECT_EXCEPTION   8

socket exception event see ESocketThread

◆ EM_SOCKETSELECT_READ

#define EM_SOCKETSELECT_READ   5

socket read event see ESocketThread

◆ EM_SOCKETSELECT_WRITE

#define EM_SOCKETSELECT_WRITE   6

socket write event see ESocketThread

◆ EM_SUSPEND

#define EM_SUSPEND   3

thread suspend event

◆ EM_TIMER

#define EM_TIMER   4

thread timer expiration event

◆ EM_USER

#define EM_USER   10000

beginning of user events

◆ END_MESSAGE_MAP

#define END_MESSAGE_MAP ( )
Value:
{0, (msgfxn_t)NULL} \
}; \
_Pragma("GCC diagnostic pop") \
static const msgmap_t msgMap = \
{&TheBaseClass::GetThisMessageMap, &_msgEntries[0]}; \
return &msgMap; \
}

Ends the message map declaration.

◆ ON_MESSAGE

#define ON_MESSAGE (   id,
  memberFxn 
)    {id, (msgfxn_t)&memberFxn},

Defines an invidual event handler.

Typedef Documentation

◆ _EThreadMessage

◆ EThreadPrivate

◆ EThreadPublic

Enumeration Type Documentation

◆ EThreadQueueMode

enum EThreadQueueMode
strong

Defines how a client can access a thread queue.

Enumerator
ReadOnly 

Allows read only access.

WriteOnly 

Allows read only access.

ReadWrite 

Allows read or write access.