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

Member Typedef Documentation

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

Definition at line 244 of file ConcurrentQueue.h.

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

Definition at line 242 of file ConcurrentQueue.h.

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

Definition at line 243 of file ConcurrentQueue.h.

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

Definition at line 241 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 263 of file ConcurrentQueue.h.

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

273  {
274  detail::MemoryType itemSize = detail::memoryUsage(item);
275  if (size < capacity && used+itemSize <= memory)
276  {
277  doInsert(item, elements, size, itemSize, used, nonempty);
278  return 0;
279  }
280  ++elementsDropped;
281  return 1;
282  }
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 247 of file ConcurrentQueue.h.

References findQualityFiles::size.

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

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