artdaq_core_demo  v1_07_01
demo::UDPFragmentWriter Class Reference

Class derived from UDPFragment which allows writes to the data. More...

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

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

Public Member Functions

 UDPFragmentWriter (artdaq::Fragment &f)
 UDPFragmentWriter constructor. More...
 
uint8_t * dataBegin ()
 Get a pointer to the start of the UDP payload. More...
 
uint8_t * dataEnd ()
 Get a pointer to the end of the UDP payload. More...
 
Headerheader_ ()
 Get a pointer to the UDPFragment::Header object for writing. More...
 
void set_hdr_type (Header::data_type_t dataType)
 Setter for the Header::type field. More...
 
void resize (size_t nBytes)
 Resize the UDP payload to the given number of bytes. More...
 
- Public Member Functions inherited from demo::UDPFragment
 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...
 

Additional Inherited Members

- Static Public Member Functions inherited from demo::UDPFragment
static constexpr size_t hdr_size_words ()
 Gets the size_words variable from the artdaq::Header. More...
 
- Protected Member Functions inherited from demo::UDPFragment
Header const * header_ () const
 Get a const pointer to the UDPFragment::Header. More...
 
- Static Protected Member Functions inherited from demo::UDPFragment
static constexpr size_t bytes_per_word_ ()
 Translates between data words (type Header::data_t) and bytes. More...
 

Detailed Description

Class derived from UDPFragment which allows writes to the data.

Class derived from UDPFragment which allows writes to the data. Note that for this reason it contains non-const members which hide the const members in its parent class, UDPFragment, including its reference to the artdaq::Fragment object, artdaq_Fragment_, as well as its functions pointing to the beginning and end of the line in the fragment, dataBegin() and dataEnd(). This is necessary as the UDP data is not coming from "hardware" but the UDP stack.

Definition at line 23 of file UDPFragmentWriter.hh.

Constructor & Destructor Documentation

demo::UDPFragmentWriter::UDPFragmentWriter ( artdaq::Fragment &  f)
inlineexplicit

UDPFragmentWriter constructor.

Parameters
fThe artdaq::Fragment to overlay
Exceptions
cet::exceptionif the Fragment does not contain UDPFragment::Metadata and nothing else

Definition at line 86 of file UDPFragmentWriter.hh.

Member Function Documentation

uint8_t * demo::UDPFragmentWriter::dataBegin ( )
inline

Get a pointer to the start of the UDP payload.

Returns
A byte pointer to the start of the UDP payload

Definition at line 100 of file UDPFragmentWriter.hh.

uint8_t * demo::UDPFragmentWriter::dataEnd ( )
inline

Get a pointer to the end of the UDP payload.

Returns
A byte pointer to the end of the UDP payload

Definition at line 107 of file UDPFragmentWriter.hh.

Header* demo::UDPFragmentWriter::header_ ( )
inline

Get a pointer to the UDPFragment::Header object for writing.

Returns
A pointer to the UDPFragment::Header object

Definition at line 49 of file UDPFragmentWriter.hh.

void demo::UDPFragmentWriter::resize ( size_t  nBytes)
inline

Resize the UDP payload to the given number of bytes.

Parameters
nBytesNumber of bytes to request for the UDP payload

Definition at line 112 of file UDPFragmentWriter.hh.

void demo::UDPFragmentWriter::set_hdr_type ( Header::data_type_t  dataType)
inline

Setter for the Header::type field.

Parameters
dataTypeValue to set to Header::type

Definition at line 59 of file UDPFragmentWriter.hh.


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