CMS 3D CMS Logo

Public Types | Static Public Member Functions

stor::RejectNewest< T > Struct Template Reference

#include <ConcurrentQueue.h>

List of all members.

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 
) [inline, static]

Definition at line 261 of file ConcurrentQueue.h.

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

    {
      detail::MemoryType itemSize = detail::memoryUsage(item);
      if (size < capacity && used+itemSize <= memory)
      {
        doInsert(item, elements, size, itemSize, used, nonempty);
        return 0;
      }
      ++elementsDropped;
      return 1;
    }
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 
) [inline, static]

Definition at line 245 of file ConcurrentQueue.h.

References findQualityFiles::size.

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

    {
      elements.push_back(item);
      ++size;
      used += itemSize;
      nonempty.notify_one();
    }