34 #ifndef MSGQUEUEBASE_H 35 #define MSGQUEUEBASE_H 41 #include <condition_variable> 42 #include <forward_list> 63 const std::type_info &typeOfMsg;
66 const std::type_info &typeOfMsg,
70 msgCallBack(msgCallBack)
77 std::shared_ptr<BaseMsg> msg;
78 const std::type_info &typeOfMsg;
82 const std::type_info &typeOfMsg,
92 : msg(msgQueueItem.msg),
93 typeOfMsg(msgQueueItem.typeOfMsg),
94 object(msgQueueItem.object),
95 magicKey(msgQueueItem.magicKey)
99 std::condition_variable_any localQueueConditionVariable;
100 std::queue<MsgQueueItem> localMsgQueue;
102 inline static std::recursive_mutex &getMutex(
void )
104 static std::recursive_mutex mutex;
108 std::forward_list<ListenerListItem> localListenerList;
111 static std::forward_list<MsgQueueBase*> listOfQueues;
118 static void sendMsg(std::shared_ptr<BaseMsg> msg,
119 const std::type_info &typeOfMsg,
135 inline static bool &getTerminateLoopFlag(
void )
138 static thread_local
bool terminateFlag;
140 return terminateFlag;
145 inline static Handle getBroadCastHandle(
void )
147 static Handle broadcastHandle;
148 return broadcastHandle;
152 static void addListenerToQueue(
void *magicKey,
153 const std::type_info &typeOfMsg,
156 static void removeListenerFromQueue(
MsgCallBack *msgCallBack);
160 static void waitUntilQueueHasData(
void );
226 return getThreadQueue();
233 #endif // MSGQUEUEBASE_H static void sendMsg(std::shared_ptr< BaseMsg > msg, const std::type_info &typeOfMsg, Handle queue, Handle object, void *magicKey)
Adds the message to the right queues.
Definition: msgqueuebase.cpp:81
static Handle getHandle(void)
Function to get the handle for this threads message queue.
Definition: msgqueuebase.h:224
Contains interface for a message address.
Class that holds and assigns handles.
Definition: handle.h:55
Type neutral message sender class.
Definition: msgsenderbase.h:51
static void emptyMsgQueue(int maxTimeMs=-1)
The function will process messages on the message queue.
Definition: msgqueuebase.cpp:130
Contains interface declaration for the FSYS::Handle class.
static bool isEmpty(void)
Function to determine if there is data on the msg queue.
Definition: msgqueuebase.cpp:209
static void breakEmptyMsgQueue(void)
Breaks out of emptyMsgQueue.
Definition: msgqueuebase.cpp:194
Contains interface declaration for the FSYS::MsgCallBack class.
Definition: msgqueuebase.h:74
Definition: msgqueuebase.h:52
The MsgCallBack class is an internal class to the message system.
Definition: msgcallback.h:54
Definition: msgqueuebase.h:59