artdaq_core  v3_02_01
artdaq::RejectNewest< T > Struct Template Reference

ConcurrentQueue policy to discard new elements when the queue is full. More...

#include <artdaq-core/Core/ConcurrentQueue.hh>

Public Types

typedef std::pair< T, size_t > ValueType
 Type of elements stored in the queue.
 
typedef std::list< T > SequenceType
 Type of sequences of items.
 
typedef SequenceType::size_type SizeType
 Size type of seqeuences.
 
typedef SizeType ReturnType
 Type returned by doEnq.
 

Static Public Member Functions

static void doInsert (T const &item, SequenceType &elements, SizeType &size, detail::MemoryType const &itemSize, detail::MemoryType &used, std::condition_variable &nonempty)
 Inserts element into the ConcurrentQueue. More...
 
static ReturnType doEnq (T const &item, SequenceType &elements, SizeType &size, SizeType &capacity, detail::MemoryType &used, detail::MemoryType &memory, size_t &elementsDropped, std::condition_variable &nonempty)
 Attempts to enqueue an item. More...
 

Detailed Description

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

ConcurrentQueue policy to discard new elements when the queue is full.

Template Parameters
TType of element to store in queue

Definition at line 344 of file ConcurrentQueue.hh.

Member Function Documentation

template<class T >
static ReturnType artdaq::RejectNewest< T >::doEnq ( T const &  item,
SequenceType elements,
SizeType size,
SizeType capacity,
detail::MemoryType used,
detail::MemoryType memory,
size_t &  elementsDropped,
std::condition_variable &  nonempty 
)
inlinestatic

Attempts to enqueue an item.

Parameters
itemItem to enqueue
elementsThe ConcurrentQueue data
sizeNumber of elements in the ConcurrentQueue
capacityMaximum number of elements in the ConcurrentQueue
usedMemory used by the ConcurrentQueue elements
memoryAmount of memory available for use by the ConcurrentQueue
elementsDroppedNumber of failed insert operations
nonemptyCondition variable to notify readers of new data on the queue
Returns
Number of elements removed from the queue (1 if new element was rejected, 0 otherwise)

Definition at line 389 of file ConcurrentQueue.hh.

template<class T >
static void artdaq::RejectNewest< T >::doInsert ( T const &  item,
SequenceType elements,
SizeType size,
detail::MemoryType const &  itemSize,
detail::MemoryType used,
std::condition_variable &  nonempty 
)
inlinestatic

Inserts element into the ConcurrentQueue.

Parameters
itemItem to insert
elementsThe ConcurrentQueue data
sizeNumber of elements in the ConcurrentQueue
itemSizeSize of the newly-inserted element
usedMemory used by the ConcurrentQueue elements
nonemptyCondition variable to notify readers of new data on queue

Definition at line 361 of file ConcurrentQueue.hh.


The documentation for this struct was generated from the following file: