sttcl  v0.9c
STTCL C++ template state machine framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
sttcl::EventQueue< T, TimeDurationType, SemaphoreType, MutexType, InnerQueueType > Class Template Reference

#include <EventQueue.h>

List of all members.

Public Member Functions

 EventQueue ()
 ~EventQueue ()
void push_back (const T &event)
T & front ()
void pop_front ()
bool waitForEvents ()
bool waitForEvents (TimeDurationType timeout)
bool empty ()
void unblock ()

Detailed Description

template<class T, class TimeDurationType = TimeDuration<STTCL_DEFAULT_TIMEDURATIONIMPL>, class SemaphoreType = sttcl::internal::SttclSemaphore<STTCL_DEFAULT_SEMAPHOREIMPL,TimeDurationType>, class MutexType = sttcl::internal::SttclMutex<STTCL_DEFAULT_MUTEXIMPL,TimeDurationType> EAIGNORE_BEGIN, class InnerQueueType = STTCL_DEFAULT_DEQUEIMPL(T) EAIGNORE_END>
class sttcl::EventQueue< T, TimeDurationType, SemaphoreType, MutexType, InnerQueueType >

Represents a queue used to dispatch events to a waiting thread.


Constructor & Destructor Documentation

template<class T, class TimeDurationType = TimeDuration<STTCL_DEFAULT_TIMEDURATIONIMPL>, class SemaphoreType = sttcl::internal::SttclSemaphore<STTCL_DEFAULT_SEMAPHOREIMPL,TimeDurationType>, class MutexType = sttcl::internal::SttclMutex<STTCL_DEFAULT_MUTEXIMPL,TimeDurationType> EAIGNORE_BEGIN, class InnerQueueType = STTCL_DEFAULT_DEQUEIMPL(T) EAIGNORE_END>
sttcl::EventQueue< T, TimeDurationType, SemaphoreType, MutexType, InnerQueueType >::EventQueue ( )
inline

Constructor for class EventQueue.

template<class T, class TimeDurationType = TimeDuration<STTCL_DEFAULT_TIMEDURATIONIMPL>, class SemaphoreType = sttcl::internal::SttclSemaphore<STTCL_DEFAULT_SEMAPHOREIMPL,TimeDurationType>, class MutexType = sttcl::internal::SttclMutex<STTCL_DEFAULT_MUTEXIMPL,TimeDurationType> EAIGNORE_BEGIN, class InnerQueueType = STTCL_DEFAULT_DEQUEIMPL(T) EAIGNORE_END>
sttcl::EventQueue< T, TimeDurationType, SemaphoreType, MutexType, InnerQueueType >::~EventQueue ( )
inline

Destructor for class EventQueue.


Member Function Documentation

template<class T, class TimeDurationType = TimeDuration<STTCL_DEFAULT_TIMEDURATIONIMPL>, class SemaphoreType = sttcl::internal::SttclSemaphore<STTCL_DEFAULT_SEMAPHOREIMPL,TimeDurationType>, class MutexType = sttcl::internal::SttclMutex<STTCL_DEFAULT_MUTEXIMPL,TimeDurationType> EAIGNORE_BEGIN, class InnerQueueType = STTCL_DEFAULT_DEQUEIMPL(T) EAIGNORE_END>
bool sttcl::EventQueue< T, TimeDurationType, SemaphoreType, MutexType, InnerQueueType >::empty ( )
inline

Indicates that the event queue is empty.

Returns:
true if the queue is empty, false otherwise.
template<class T, class TimeDurationType = TimeDuration<STTCL_DEFAULT_TIMEDURATIONIMPL>, class SemaphoreType = sttcl::internal::SttclSemaphore<STTCL_DEFAULT_SEMAPHOREIMPL,TimeDurationType>, class MutexType = sttcl::internal::SttclMutex<STTCL_DEFAULT_MUTEXIMPL,TimeDurationType> EAIGNORE_BEGIN, class InnerQueueType = STTCL_DEFAULT_DEQUEIMPL(T) EAIGNORE_END>
T& sttcl::EventQueue< T, TimeDurationType, SemaphoreType, MutexType, InnerQueueType >::front ( )
inline

Gets the event from the front of the queue.

Returns:
template<class T, class TimeDurationType = TimeDuration<STTCL_DEFAULT_TIMEDURATIONIMPL>, class SemaphoreType = sttcl::internal::SttclSemaphore<STTCL_DEFAULT_SEMAPHOREIMPL,TimeDurationType>, class MutexType = sttcl::internal::SttclMutex<STTCL_DEFAULT_MUTEXIMPL,TimeDurationType> EAIGNORE_BEGIN, class InnerQueueType = STTCL_DEFAULT_DEQUEIMPL(T) EAIGNORE_END>
void sttcl::EventQueue< T, TimeDurationType, SemaphoreType, MutexType, InnerQueueType >::pop_front ( )
inline

Removes the item at front of the queue.

template<class T, class TimeDurationType = TimeDuration<STTCL_DEFAULT_TIMEDURATIONIMPL>, class SemaphoreType = sttcl::internal::SttclSemaphore<STTCL_DEFAULT_SEMAPHOREIMPL,TimeDurationType>, class MutexType = sttcl::internal::SttclMutex<STTCL_DEFAULT_MUTEXIMPL,TimeDurationType> EAIGNORE_BEGIN, class InnerQueueType = STTCL_DEFAULT_DEQUEIMPL(T) EAIGNORE_END>
void sttcl::EventQueue< T, TimeDurationType, SemaphoreType, MutexType, InnerQueueType >::push_back ( const T &  event)
inline

Puts an event to the end of the queue and signals that events are available.

Parameters:
event
template<class T, class TimeDurationType = TimeDuration<STTCL_DEFAULT_TIMEDURATIONIMPL>, class SemaphoreType = sttcl::internal::SttclSemaphore<STTCL_DEFAULT_SEMAPHOREIMPL,TimeDurationType>, class MutexType = sttcl::internal::SttclMutex<STTCL_DEFAULT_MUTEXIMPL,TimeDurationType> EAIGNORE_BEGIN, class InnerQueueType = STTCL_DEFAULT_DEQUEIMPL(T) EAIGNORE_END>
void sttcl::EventQueue< T, TimeDurationType, SemaphoreType, MutexType, InnerQueueType >::unblock ( )
inline

Unblocks waiting threads.

template<class T, class TimeDurationType = TimeDuration<STTCL_DEFAULT_TIMEDURATIONIMPL>, class SemaphoreType = sttcl::internal::SttclSemaphore<STTCL_DEFAULT_SEMAPHOREIMPL,TimeDurationType>, class MutexType = sttcl::internal::SttclMutex<STTCL_DEFAULT_MUTEXIMPL,TimeDurationType> EAIGNORE_BEGIN, class InnerQueueType = STTCL_DEFAULT_DEQUEIMPL(T) EAIGNORE_END>
bool sttcl::EventQueue< T, TimeDurationType, SemaphoreType, MutexType, InnerQueueType >::waitForEvents ( )
inline

Blocks the calling thread until events are available in the queue.

Returns:
true if events are available, false if an error occurred.
template<class T, class TimeDurationType = TimeDuration<STTCL_DEFAULT_TIMEDURATIONIMPL>, class SemaphoreType = sttcl::internal::SttclSemaphore<STTCL_DEFAULT_SEMAPHOREIMPL,TimeDurationType>, class MutexType = sttcl::internal::SttclMutex<STTCL_DEFAULT_MUTEXIMPL,TimeDurationType> EAIGNORE_BEGIN, class InnerQueueType = STTCL_DEFAULT_DEQUEIMPL(T) EAIGNORE_END>
bool sttcl::EventQueue< T, TimeDurationType, SemaphoreType, MutexType, InnerQueueType >::waitForEvents ( TimeDurationType  timeout)
inline

Blocks the calling thread until events are available in the queue.

Returns:
true if events are available, false if no events were available within the specified timeout.

The documentation for this class was generated from the following file: