artdaq_core_demo  v1_07_01
demo::AsciiFragment Class Reference

An artdaq::Fragment overlay class designed to hold string data for pedagogical purposes. More...

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

Inheritance diagram for demo::AsciiFragment:
demo::AsciiFragmentWriter

Classes

struct  Header
 The AsciiFragment::Header contains information about the payload size and the "line number" of the data contained in the AsciiFragment. More...
 
struct  Metadata
 Metadata describing the contents of the AsciiFragment. More...
 

Public Member Functions

 AsciiFragment (artdaq::Fragment const &f)
 The AsciiFragment constructor. More...
 
Header::event_size_t hdr_event_size () const
 Gets the event_size from the AsciiFragment::Header. More...
 
Header::line_number_t hdr_line_number () const
 Gets the line_number from the AsciiFragment::Header. More...
 
size_t total_line_characters () const
 The number of characters in the line.
 
char const * dataBegin () const
 Start of the line, returned as a pointer to the char type.
 
char const * dataEnd () const
 End of the line, returned as a pointer to the char type.
 

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
 header_() simply takes the address of the start of this overlay's data (i.e., where the AsciiFragment::Header object begins) and casts it as a pointer to AsciiFragment::Header More...
 

Static Protected Member Functions

static constexpr size_t chars_per_word_ ()
 Translates between the size of the character type and the artda::Fragment::value_type. More...
 

Detailed Description

An artdaq::Fragment overlay class designed to hold string data for pedagogical purposes.

AsciiFragment is an artdaq::Fragment overlay class designed to hold string data. It serves both as an educational tool for showing how Fragment overlays works, and as a way to showcase artdaq's data-handling ability, especially how the input data is replicated bit-for-bit in the output.

Definition at line 33 of file AsciiFragment.hh.

Constructor & Destructor Documentation

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

The AsciiFragment 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 97 of file AsciiFragment.hh.

Member Function Documentation

static constexpr size_t demo::AsciiFragment::chars_per_word_ ( )
inlinestaticprotected

Translates between the size of the character type and the artda::Fragment::value_type.

Returns
The number of characters in a artdaq::Fragment::value_type

Definition at line 135 of file AsciiFragment.hh.

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

Gets the event_size from the AsciiFragment::Header.

Returns
The number of characters in the contained line

Definition at line 106 of file AsciiFragment.hh.

Header::line_number_t demo::AsciiFragment::hdr_line_number ( ) const
inline

Gets the line_number from the AsciiFragment::Header.

Returns
The "line number" string of the AsciiFragment::Header

Definition at line 111 of file AsciiFragment.hh.

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

Gets the size_words variable from the artdaq::Header.

Returns
The size of the Fragment payload

Definition at line 116 of file AsciiFragment.hh.

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

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

Returns
Pointer to the AsciiFragment::Header object in the data payload

Definition at line 143 of file AsciiFragment.hh.


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