artdaq::KeepNewest< T > Struct Template Reference

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

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

List of all members.

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.
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.

Detailed Description

template<typename T>
struct artdaq::KeepNewest< T >

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

Template Parameters:
T Type of element to store in queue

Definition at line 258 of file ConcurrentQueue.hh.


Member Function Documentation

template<typename T >
static ReturnType artdaq::KeepNewest< T >::doEnq ( T const &  item,
SequenceType elements,
SizeType size,
SizeType capacity,
detail::MemoryType used,
detail::MemoryType memory,
size_t &  elementsDropped,
std::condition_variable &  nonempty 
) [inline, static]

Attempts to enqueue an item.

Parameters:
item Item to enqueue
elements The ConcurrentQueue data
size Number of elements in the ConcurrentQueue
capacity Maximum number of elements in the ConcurrentQueue
used Memory used by the ConcurrentQueue elements
memory Amount of memory available for use by the ConcurrentQueue
elementsDropped Number of failed insert operations
nonempty Condition variable to notify readers of new data on the queue
Returns:
Number of elements removed from the queue

Definition at line 303 of file ConcurrentQueue.hh.

template<typename T >
static void artdaq::KeepNewest< T >::doInsert ( T const &  item,
SequenceType elements,
SizeType size,
detail::MemoryType const &  itemSize,
detail::MemoryType used,
std::condition_variable &  nonempty 
) [inline, static]

Inserts element into the ConcurrentQueue.

Parameters:
item Item to insert
elements The ConcurrentQueue data
size Number of elements in the ConcurrentQueue
itemSize Size of the newly-inserted element
used Memory used by the ConcurrentQueue elements
nonempty Condition variable to notify readers of new data on queue

Definition at line 275 of file ConcurrentQueue.hh.


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

Generated on 6 Feb 2018 for artdaq_core by  doxygen 1.6.1