fix8  version 1.4.0
Open Source C++ FIX Framework
FIX8::ff_unbounded_queue< T * > Class Template Reference

#include <ff_wrapper.hpp>

Public Types

using value_type = T
 
using reference = T &
 Reference type. More...
 
using const_reference = const T &
 Const reference type. More...
 

Public Member Functions

 ff_unbounded_queue ()
 
 ~ff_unbounded_queue ()
 
bool try_push (T *source)
 
void push (T *source)
 
bool try_pop (T *&target)
 
bool pop (T *&target)
 

Private Attributes

ff::uMPMC_Ptr_Queue _queue
 

Detailed Description

template<typename T>
class FIX8::ff_unbounded_queue< T * >

Definition at line 90 of file ff_wrapper.hpp.

Member Typedef Documentation

template<typename T >
using FIX8::ff_unbounded_queue< T * >::const_reference = const T&

Const reference type.

Definition at line 101 of file ff_wrapper.hpp.

template<typename T >
using FIX8::ff_unbounded_queue< T * >::reference = T&

Reference type.

Definition at line 98 of file ff_wrapper.hpp.

template<typename T >
using FIX8::ff_unbounded_queue< T * >::value_type = T

Definition at line 95 of file ff_wrapper.hpp.

Constructor & Destructor Documentation

template<typename T >
FIX8::ff_unbounded_queue< T * >::ff_unbounded_queue ( )
inlineexplicit

Definition at line 103 of file ff_wrapper.hpp.

103 { _queue.init(); }
ff::uMPMC_Ptr_Queue _queue
Definition: ff_wrapper.hpp:92
template<typename T >
FIX8::ff_unbounded_queue< T * >::~ff_unbounded_queue ( )
inline

Definition at line 104 of file ff_wrapper.hpp.

104 {}

Member Function Documentation

template<typename T >
bool FIX8::ff_unbounded_queue< T * >::pop ( T *&  target)
inline

Definition at line 109 of file ff_wrapper.hpp.

References FIX8::hypersleep< h_nanoseconds >().

110  {
111 #if defined FIX8_SLEEP_NO_YIELD
112  const unsigned cnt_rnd(3);
113  unsigned cnt(0);
114 #endif
115  for(;;)
116  {
117  if (try_pop(target))
118  return true;
119 #if defined FIX8_SLEEP_NO_YIELD
120  if ((++cnt %= cnt_rnd) == 0)
121  hypersleep<h_nanoseconds>(FIX8_SLEEP_NO_YIELD);
122  else
123 #endif
124  sched_yield();
125  }
126 
127  return false;
128  }
int hypersleep< h_nanoseconds >(unsigned amt)
Definition: hypersleep.hpp:149
template<typename T >
void FIX8::ff_unbounded_queue< T * >::push ( T *  source)
inline

Definition at line 107 of file ff_wrapper.hpp.

107 { try_push(source); }
template<typename T >
bool FIX8::ff_unbounded_queue< T * >::try_pop ( T *&  target)
inline

Definition at line 108 of file ff_wrapper.hpp.

108 { return _queue.pop(reinterpret_cast<void**>(&target)); }
ff::uMPMC_Ptr_Queue _queue
Definition: ff_wrapper.hpp:92
template<typename T >
bool FIX8::ff_unbounded_queue< T * >::try_push ( T *  source)
inline

Definition at line 106 of file ff_wrapper.hpp.

106 { return _queue.push(source); }
ff::uMPMC_Ptr_Queue _queue
Definition: ff_wrapper.hpp:92

Member Data Documentation

template<typename T >
ff::uMPMC_Ptr_Queue FIX8::ff_unbounded_queue< T * >::_queue
private

Definition at line 92 of file ff_wrapper.hpp.


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