artdaq_core  v3_04_13
artdaq::detail Namespace Reference

artdaq implementation details namespace More...

Classes

class  hasMemoryUsed
 
struct  RawFragmentHeader
 The RawFragmentHeader class contains the basic fields used by artdaq for routing Fragment objects through the system. More...
 
struct  RawFragmentHeaderV0
 The RawFragmentHeaderV0 class contains the basic fields used by artdaq for routing Fragment objects through the system. More...
 
struct  RawEventHeader
 The header information used to identify key properties of the RawEvent object. More...
 

Typedefs

typedef std::chrono::duration
< double > 
seconds
 
typedef size_t MemoryType
 Basic unit of data storage and pointer types.
 

Functions

template<typename T >
MemoryType memoryUsage (const std::pair< T, size_t > &t)
 Returns the memory used by an object. More...
 
template<typename T >
std::enable_if< hasMemoryUsed
< T >::value, MemoryType >
::type 
memoryUsage (const T &t)
 Returns the memory used by an object. Uses hasMemoryUsed to determine if there is a memoryUsed function in object. More...
 
template<typename T >
std::enable_if<!hasMemoryUsed
< T >::value, MemoryType >
::type 
memoryUsage (const T &t)
 Returns the memory used by an object, as obtained through sizeof. More...
 

Detailed Description

artdaq implementation details namespace

Class template ConcurrentQueue provides a FIFO that can be used to communicate data between multiple producer and consumer threads in an application.

The template policy EnqPolicy determines the behavior of the enqNowait function. In all cases, this function will return promptly (that is, it will not wait for a full queue to become not-full). However, what is done in the case of the queue being full depends on the policy chosen:

FailIfFull: a std::exeption is thrown if the queue is full.

KeepNewest: the head of the FIFO is popped (and destroyed), and the new item is added to the FIFO. The function returns the number of popped (dropped) element.

RejectNewest: the new item is not put onto the FIFO. The function returns the dropped event count (1) if the item cannot be added.

Typedef Documentation

typedef std::chrono::duration<double> artdaq::detail::seconds

We shall use artdaq::detail::seconds as our "standard" duration type. Note that this differs from std::chrono::seconds, which has a representation in some integer type of at least 35 bits.

daqrate::duration dur(1.0) represents a duration of 1 second. daqrate::duration dur2(0.001) represents a duration of 1 millisecond.

Definition at line 62 of file ConcurrentQueue.hh.

Function Documentation

template<typename T >
MemoryType artdaq::detail::memoryUsage ( const std::pair< T, size_t > &  t)

Returns the memory used by an object.

Template Parameters
TThe type of the object
Parameters
tA pair of object and size_t
Returns
If the object has a memoryUsed function, the result of that function. Otherwise 0.

Definition at line 111 of file ConcurrentQueue.hh.

template<typename T >
std::enable_if<hasMemoryUsed<T>::value, MemoryType>::type artdaq::detail::memoryUsage ( const T &  t)

Returns the memory used by an object. Uses hasMemoryUsed to determine if there is a memoryUsed function in object.

Template Parameters
TType of object t
Parameters
tObject to retrieve memory usage from
Returns
Self-reported memory usage of object

Definition at line 130 of file ConcurrentQueue.hh.

template<typename T >
std::enable_if<!hasMemoryUsed<T>::value, MemoryType>::type artdaq::detail::memoryUsage ( const T &  t)

Returns the memory used by an object, as obtained through sizeof.

Template Parameters
TType of object t
Parameters
tObject to retrieve memory usage from
Returns
sizeof(t)

Definition at line 149 of file ConcurrentQueue.hh.