CMS 3D CMS Logo

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

#include <ConcurrentQueue.h>

Public Types

typedef SizeType ReturnType
 
typedef std::list< TSequenceType
 
typedef SequenceType::size_type SizeType
 
typedef std::pair< T, size_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)
 

Detailed Description

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

Definition at line 237 of file ConcurrentQueue.h.

Member Typedef Documentation

template<class T>
typedef SizeType stor::RejectNewest< T >::ReturnType

Definition at line 242 of file ConcurrentQueue.h.

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

Definition at line 240 of file ConcurrentQueue.h.

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

Definition at line 241 of file ConcurrentQueue.h.

template<class T>
typedef std::pair<T,size_t> stor::RejectNewest< T >::ValueType

Definition at line 239 of file ConcurrentQueue.h.

Member Function Documentation

template<class T>
static ReturnType stor::RejectNewest< 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 261 of file ConcurrentQueue.h.

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

271  {
272  detail::MemoryType itemSize = detail::memoryUsage(item);
273  if (size < capacity && used+itemSize <= memory)
274  {
275  doInsert(item, elements, size, itemSize, used, nonempty);
276  return 0;
277  }
278  ++elementsDropped;
279  return 1;
280  }
Definition: vlib.h:187
list elements
Definition: asciidump.py:414
static void doInsert(T const &item, SequenceType &elements, SizeType &size, detail::MemoryType const &itemSize, detail::MemoryType &used, boost::condition &nonempty)
MemoryType memoryUsage(const std::pair< T, size_t > &t)
tuple size
Write out results.
template<class T>
static void stor::RejectNewest< T >::doInsert ( T const &  item,
SequenceType elements,
SizeType size,
detail::MemoryType const &  itemSize,
detail::MemoryType used,
boost::condition &  nonempty 
)
inlinestatic

Definition at line 245 of file ConcurrentQueue.h.

References findQualityFiles::size.

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

253  {
254  elements.push_back(item);
255  ++size;
256  used += itemSize;
257  nonempty.notify_one();
258  }
list elements
Definition: asciidump.py:414
tuple size
Write out results.