QuickFIX: FIX::Queue< T > Class Template Reference

Index Source Files Annotated Class List Alphabetical Class List Class Hierarchy Graphical Class Hierarchy

# FIX::Queue< T > Class Template Reference

A thread safe monitored queue. More...

`#include <Queue.h>`

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

List of all members.

## Public Member Functions
void | push (const T &value)
bool | pop (T &value)
int | size ()
void | wait ()
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

template<typename T >

bool FIX::Queue< T >::pop | ( | T & | value | ) | `[inline]`

Definition at line 43 of file Queue.h.

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

Referenced by FIX::SocketMonitor::block().

    00044   {
    00045     Locker locker( m_mutex );
    00046     if ( !m_queue.size() ) return false;
    00047     value = m_queue.front();
    00048     m_queue.pop();
    00049     return true;
    00050   }

template<typename T >

void FIX::Queue< T >::push | ( | const T & | value | ) | `[inline]`

Definition at line 36 of file Queue.h.

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

Referenced by FIX::SocketMonitor::drop().

    00037   {
    00038     Locker locker( m_mutex );
    00039     m_queue.push( value );
    00040     signal();
    00041   }

template<typename T >

void FIX::Queue< T >::signal | ( |  | ) | `[inline]`

Definition at line 63 of file Queue.h.

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

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

    00064   {
    00065     m_event.signal();
    00066   }

template<typename T >

int FIX::Queue< T >::size | ( |  | ) | `[inline]`

Definition at line 52 of file Queue.h.

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

Referenced by FIX::SocketMonitor::block(), FIX::SocketConnection::processQueue(), FIX::SocketConnection::signal(), and FIX::SocketConnection::unsignal().

    00053   {
    00054     Locker locker( m_mutex );
    00055     return m_queue.size();
    00056   }

template<typename T >

void FIX::Queue< T >::wait | ( |  | ) | `[inline]`

Definition at line 58 of file Queue.h.

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

    00059   {
    00060     m_event.wait();
    00061   }

## Member Data Documentation

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().

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().

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:

- /home/omiller/Development/autobuild/quickfix/src/C++/Queue.h