FACT++  1.0
void StateMachineImp::PushEvent ( Event cmd)
protectedvirtual

This is a flag which is set true if the main loop should stop.

Push a command into the fifo. The fifo takes over ownership

Puts the given event into the fifo. The fifo will take over ownership. Access to fEventQueue is encapsulated by fMutex.

Parameters
cmdPointer to an object of type Event to be stored in the fifo
Todo:
Can we also allow EventImp?

Definition at line 165 of file StateMachineImp.cc.

References fCond, fEventQueue, and fMutex.

Referenced by PostEvent().

166 {
167  const lock_guard<mutex> guard(fMutex);
168  fEventQueue.emplace_back(cmd);
169  fCond.notify_one();
170 }
std::list< std::shared_ptr< Event > > fEventQueue
List of available commands as setup by user.
std::condition_variable fCond
Mutex to ensure thread-safe access to the command fifo.
std::mutex fMutex
Event queue (fifo) for the received commands.

+ Here is the caller graph for this function: