artdaq_core_demo  v1_07_01
demo::UDPFragment Class Reference

A Fragment designed to contain data received from the network in UDP datagrams. More...

#include <artdaq-core-demo/Overlays/UDPFragment.hh>

Inheritance diagram for demo::UDPFragment:
demo::UDPFragmentWriter

Classes

struct  Header
 The UDPFragment::Header contains information about the payload size and the "data type" of the UDP data. More...
 
struct  Metadata
 Metadata describing the contents of the UDPFragment. More...
 

Public Member Functions

 UDPFragment (artdaq::Fragment const &f)
 The UDPFragment constructor. More...
 
Header::event_size_t hdr_event_size () const
 Get the current value of the Header::event_size field. More...
 
Header::data_type_t hdr_data_type () const
 Get the current value of the Header::type field. More...
 
size_t udp_data_words () const
 Get the number of words in the UDPFragment payload. More...
 
uint8_t const * dataBegin () const
 Returns a const pointer to the start of the UDP payload. More...
 
uint8_t const * dataEnd () const
 Returns a const pointer to the end of the UDP payload. More...
 

Static Public Member Functions

static constexpr size_t hdr_size_words ()
 Gets the size_words variable from the artdaq::Header. More...
 

Protected Member Functions

Header const * header_ () const
 Get a const pointer to the UDPFragment::Header. More...
 

Static Protected Member Functions

static constexpr size_t bytes_per_word_ ()
 Translates between data words (type Header::data_t) and bytes. More...
 

Detailed Description

A Fragment designed to contain data received from the network in UDP datagrams.

Definition at line 20 of file UDPFragment.hh.

Constructor & Destructor Documentation

demo::UDPFragment::UDPFragment ( artdaq::Fragment const &  f)
inlineexplicit

The UDPFragment constructor.

Parameters
fThe raw artdaq::Fragment object to overlay

The constructor simply sets its const private member "artdaq_Fragment_" to refer to the artdaq::Fragment object

Definition at line 79 of file UDPFragment.hh.

Member Function Documentation

static constexpr size_t demo::UDPFragment::bytes_per_word_ ( )
inlinestaticprotected

Translates between data words (type Header::data_t) and bytes.

Returns
The number of bytes in each Header::data_t word

Definition at line 127 of file UDPFragment.hh.

uint8_t const* demo::UDPFragment::dataBegin ( ) const
inline

Returns a const pointer to the start of the UDP payload.

Returns
const byte pointer to the start of the UDP payload

Definition at line 108 of file UDPFragment.hh.

uint8_t const* demo::UDPFragment::dataEnd ( ) const
inline

Returns a const pointer to the end of the UDP payload.

Returns
const byte pointer to the end of the UDP payload

Definition at line 117 of file UDPFragment.hh.

Header::data_type_t demo::UDPFragment::hdr_data_type ( ) const
inline

Get the current value of the Header::type field.

Returns
The current value of the Header::type field (const)

Definition at line 91 of file UDPFragment.hh.

Header::event_size_t demo::UDPFragment::hdr_event_size ( ) const
inline

Get the current value of the Header::event_size field.

Returns
The current value of the Header::event_size field (const)

Definition at line 86 of file UDPFragment.hh.

static constexpr size_t demo::UDPFragment::hdr_size_words ( )
inlinestatic

Gets the size_words variable from the artdaq::Header.

Returns
The size of the Fragment payload

Definition at line 96 of file UDPFragment.hh.

Header const* demo::UDPFragment::header_ ( ) const
inlineprotected

Get a const pointer to the UDPFragment::Header.

Returns
A const pointer to the UDPFragment:Header

header_() simply takes the address of the start of this overlay's data (i.e., where the UDPFragment::Header object begins) and casts it as a pointer to UDPFragment::Header

Definition at line 137 of file UDPFragment.hh.

size_t demo::UDPFragment::udp_data_words ( ) const
inline

Get the number of words in the UDPFragment payload.

Returns
The number of Header::data_t words in the UDPFragment payload (const)

Definition at line 102 of file UDPFragment.hh.


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