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

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 64 of file ConcurrentQueue.hh.


Function Documentation

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

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

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

Template Parameters:
T Type of object t
Parameters:
t Object to retrieve memory usage from
Returns:
Self-reported memory usage of object
Template Parameters:
T Type of object t
Parameters:
t Object to retrieve memory usage from
Returns:
sizeof(t)

Definition at line 151 of file ConcurrentQueue.hh.

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

Returns the memory used by an object.

Template Parameters:
T The type of the object
Parameters:
t A pair of object and size_t
Returns:
If the object has a memoryUsed function, the result of that function. Otherwise 0.

Definition at line 113 of file ConcurrentQueue.hh.


Generated on 15 Feb 2018 for artdaq_core by  doxygen 1.6.1