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< TSequenceType
 
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 148 of file ConcurrentQueue.h.

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

158  {
159  detail::MemoryType itemSize = detail::memoryUsage(item);
160  if (size >= capacity || used+itemSize > memory)
161  {
162  ++elementsDropped;
163  throw queueIsFull;
164  }
165  else
166  {
167  doInsert(item, elements, size, itemSize, used, nonempty);
168  }
169  }
Definition: vlib.h:187
stor::FailIfFull::QueueIsFull queueIsFull
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)
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 132 of file ConcurrentQueue.h.

References findQualityFiles::size.

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

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

Member Data Documentation

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

Definition at line 172 of file ConcurrentQueue.h.

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