CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Types | Static Public Member Functions | Static Public Attributes
stor::FailIfFull< T > Struct Template Reference

#include <ConcurrentQueue.h>

Classes

struct  QueueIsFull
 

Public Types

typedef void ReturnType
 
typedef std::list< T > SequenceType
 
typedef SequenceType::size_type SizeType
 
typedef T ValueType
 

Static Public Member Functions

static ReturnType doEnq (T const &item, SequenceType &elements, SizeType &size, SizeType &capacity, detail::MemoryType &used, detail::MemoryType &memory, size_t &elementsDropped, boost::condition &nonempty)
 
static void doInsert (T const &item, SequenceType &elements, SizeType &size, detail::MemoryType const &itemSize, detail::MemoryType &used, boost::condition &nonempty)
 

Static Public Attributes

stor::FailIfFull::QueueIsFull queueIsFull
 

Detailed Description

template<class T>
struct stor::FailIfFull< T >

Definition at line 114 of file ConcurrentQueue.h.

Member Typedef Documentation

template<class T >
typedef void stor::FailIfFull< T >::ReturnType

Definition at line 116 of file ConcurrentQueue.h.

template<class T >
typedef std::list<T> stor::FailIfFull< T >::SequenceType

Definition at line 119 of file ConcurrentQueue.h.

template<class T >
typedef SequenceType::size_type stor::FailIfFull< T >::SizeType

Definition at line 120 of file ConcurrentQueue.h.

template<class T >
typedef T stor::FailIfFull< T >::ValueType

Definition at line 118 of file ConcurrentQueue.h.

Member Function Documentation

template<class T >
static ReturnType stor::FailIfFull< T >::doEnq ( T const &  item,
SequenceType elements,
SizeType size,
SizeType capacity,
detail::MemoryType used,
detail::MemoryType memory,
size_t &  elementsDropped,
boost::condition &  nonempty 
)
inlinestatic

Definition at line 147 of file ConcurrentQueue.h.

References stor::FailIfFull< T >::doInsert(), stor::detail::memoryUsage(), and stor::FailIfFull< T >::queueIsFull.

157  {
158  detail::MemoryType itemSize = detail::memoryUsage(item);
159  if (size >= capacity || used+itemSize > memory)
160  {
161  ++elementsDropped;
162  throw queueIsFull;
163  }
164  else
165  {
166  doInsert(item, elements, size, itemSize, used, nonempty);
167  }
168  }
Definition: vlib.h:187
list elements
Definition: asciidump.py:414
MemoryType memoryUsage(const std::pair< T, size_t > &t)
static void doInsert(T const &item, SequenceType &elements, SizeType &size, detail::MemoryType const &itemSize, detail::MemoryType &used, boost::condition &nonempty)
stor::FailIfFull::QueueIsFull queueIsFull
tuple size
Write out results.
template<class T >
static void stor::FailIfFull< T >::doInsert ( T const &  item,
SequenceType elements,
SizeType size,
detail::MemoryType const &  itemSize,
detail::MemoryType used,
boost::condition &  nonempty 
)
inlinestatic

Definition at line 131 of file ConcurrentQueue.h.

References findQualityFiles::size.

Referenced by stor::FailIfFull< T >::doEnq().

139  {
140  elements.push_back(item);
141  ++size;
142  used += itemSize;
143  nonempty.notify_one();
144  }
list elements
Definition: asciidump.py:414
tuple size
Write out results.

Member Data Documentation

template<class T >
stor::FailIfFull::QueueIsFull stor::FailIfFull< T >::queueIsFull
static