FIX::Queue< T > Class Template Reference

A thread safe monitored queue. More...

`#include <Queue.h>`

Collaboration diagram for FIX::Queue< T >:
[legend]

## Public Member Functions

void | push (const T &value)
bool | pop (T &value)
int | size ()
void | wait (double s)
void | signal ()

## Private Attributes

Event | m_event
Mutex | m_mutex
std::queue< T > | m_queue

## Detailed Description

### template<typename T>
class FIX::Queue< T >

A thread safe monitored queue.

Definition at line 33 of file Queue.h.

## Member Function Documentation

## pop()

template<typename T >

bool FIX::Queue< T >::pop | ( | T & | value | ) |

inline

Definition at line 43 of file Queue.h.

{
Locker locker( m_mutex );
if ( !m_queue.size() ) return false;
value = m_queue.front();
m_queue.pop();
return true;
}
FIX::Queue::m_queue
std::queue< T > m_queue
Definition: Queue.h:71
FIX::Queue::m_mutex
Mutex m_mutex
Definition: Queue.h:70

References FIX::Queue< T >::m_mutex, and FIX::Queue< T >::m_queue.

## push()

template<typename T >

void FIX::Queue< T >::push | ( | const T & | value | ) |

inline

Definition at line 36 of file Queue.h.

{
Locker locker( m_mutex );
m_queue.push( value );
signal();
}
FIX::Queue::signal
void signal()
Definition: Queue.h:63

References FIX::Queue< T >::m_mutex, FIX::Queue< T >::m_queue, and FIX::Queue< T >::signal().

## signal()

template<typename T >

void FIX::Queue< T >::signal | ( |  | ) |

inline

Definition at line 63 of file Queue.h.

{
m_event.signal();
}
FIX::Event::signal
void signal()
Definition: Event.h:59
FIX::Queue::m_event
Event m_event
Definition: Queue.h:69

References FIX::Queue< T >::m_event, and FIX::Event::signal().

Referenced by FIX::Queue< T >::push().

## size()

template<typename T >

int FIX::Queue< T >::size | ( |  | ) |

inline

Definition at line 52 of file Queue.h.

{
Locker locker( m_mutex );
return m_queue.size();
}

References FIX::Queue< T >::m_mutex, and FIX::Queue< T >::m_queue.

## wait()

template<typename T >

void FIX::Queue< T >::wait | ( | double | s | ) |

inline

Definition at line 58 of file Queue.h.

{
m_event.wait( s );
}
FIX::Event::wait
void wait(double s)
Definition: Event.h:70

References FIX::Queue< T >::m_event, and FIX::Event::wait().

## Member Data Documentation

## m_event

template<typename T >

Event FIX::Queue< T >::m_event

private

Definition at line 69 of file Queue.h.

Referenced by FIX::Queue< T >::signal(), and FIX::Queue< T >::wait().

## m_mutex

template<typename T >

Mutex FIX::Queue< T >::m_mutex

private

Definition at line 70 of file Queue.h.

Referenced by FIX::Queue< T >::pop(), FIX::Queue< T >::push(), and FIX::Queue< T >::size().

## m_queue

template<typename T >

std::queue< T > FIX::Queue< T >::m_queue

private

Definition at line 71 of file Queue.h.

Referenced by FIX::Queue< T >::pop(), FIX::Queue< T >::push(), and FIX::Queue< T >::size().

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

- Queue.h