CVD::MessageQueue< C > Class Template Reference

This class provides a simple, thread safe FIFO message queue. More...

#include <message_queue.h>

List of all members.

Public Member Functions

 MessageQueue ()
 Construct a message queue.
read ()
int size ()
void write (const C &message)
 ~MessageQueue ()
 Destruct a message queue.

Private Attributes

sem_t empty_slots
std::deque< C > queue
Synchronized queue_mutex

Detailed Description

template<class C>
class CVD::MessageQueue< C >

This class provides a simple, thread safe FIFO message queue.

Definition at line 12 of file message_queue.h.


Constructor & Destructor Documentation

template<class C>
CVD::MessageQueue< C >::MessageQueue (  )  [inline]

Construct a message queue.

Definition at line 16 of file message_queue.h.

template<class C>
CVD::MessageQueue< C >::~MessageQueue (  )  [inline]

Destruct a message queue.

Definition at line 22 of file message_queue.h.


Member Function Documentation

template<class C>
C CVD::MessageQueue< C >::read (  )  [inline]

Read a message from the queue. Wait if the queue is empty.

Returns:
The message read from the queue

Definition at line 42 of file message_queue.h.

template<class C>
int CVD::MessageQueue< C >::size (  )  [inline]

Definition at line 55 of file message_queue.h.

template<class C>
void CVD::MessageQueue< C >::write ( const C &  message  )  [inline]

Write a message to the queue.

Parameters:
message The message to write to the queue

Definition at line 29 of file message_queue.h.


Member Data Documentation

template<class C>
sem_t CVD::MessageQueue< C >::empty_slots [private]

Definition at line 65 of file message_queue.h.

template<class C>
std::deque<C> CVD::MessageQueue< C >::queue [private]

Definition at line 64 of file message_queue.h.

template<class C>
Synchronized CVD::MessageQueue< C >::queue_mutex [private]

Definition at line 63 of file message_queue.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


libcvd
Author(s): Edward Rosten, Paul Smith, Tom Drummond, Gerhard Reitmayr, Ethan Eade, Timothy Gan, Chris Kemp, Georg Klein
autogenerated on Fri Jan 11 09:13:51 2013