CMS 3D CMS Logo

Classes | Public Types | Static Public Member Functions | Static Public Attributes

stor::FailIfFull< T > Struct Template Reference

#include <ConcurrentQueue.h>

List of all members.

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

Definition at line 147 of file ConcurrentQueue.h.

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

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

Definition at line 131 of file ConcurrentQueue.h.

References findQualityFiles::size.

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

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

Member Data Documentation

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

Definition at line 171 of file ConcurrentQueue.h.

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