artdaq_core_demo  v1_07_01
demo::AsciiFragmentWriter Class Reference

Class derived from AsciiFragment which allows writes to the data (for simulation purposes). More...

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

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

Public Member Functions

 AsciiFragmentWriter (artdaq::Fragment &f)
 The constructor will expect the artdaq::Fragment object it's been passed to contain the artdaq::Fragment header + the AsciiFragment::Metadata object, otherwise it throws. More...
 
char * dataBegin ()
 Return a non-const (for writing) pointer to the beginning of the Fragment payload. More...
 
char * dataEnd ()
 Return a non-const (for writing) pointer to the end of the Fragment payload. More...
 
Headerheader_ ()
 Returns a pointer to the AsciiFragment::Header object, non-const for writing. More...
 
void set_hdr_line_number (Header::line_number_t line_number)
 Sets the line number in the AsciiFragment::Header to the given (ASCII-encoded) value. More...
 
void resize (size_t nChars)
 Resize the Fragment so that it can contain nChars characters. More...
 
- Public Member Functions inherited from demo::AsciiFragment
 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.
 

Additional Inherited Members

- Static Public Member Functions inherited from demo::AsciiFragment
static constexpr size_t hdr_size_words ()
 Gets the size_words variable from the artdaq::Header. More...
 
- Protected Member Functions inherited from demo::AsciiFragment
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 inherited from demo::AsciiFragment
static constexpr size_t chars_per_word_ ()
 Translates between the size of the character type and the artda::Fragment::value_type. More...
 

Detailed Description

Class derived from AsciiFragment which allows writes to the data (for simulation purposes).

Class derived from AsciiFragment which allows writes to the data (for simulation purposes). Note that for this reason it contains non-const members which hide the const members in its parent class, AsciiFragment, 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()

Definition at line 22 of file AsciiFragmentWriter.hh.

Constructor & Destructor Documentation

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

The constructor will expect the artdaq::Fragment object it's been passed to contain the artdaq::Fragment header + the AsciiFragment::Metadata object, otherwise it throws.

Parameters
fartdaq::Fragment object to overlay
Exceptions
cet::exceptionif input Fragment does not contain an AsciiFragment::Metadata object

Definition at line 84 of file AsciiFragmentWriter.hh.

Member Function Documentation

char * demo::AsciiFragmentWriter::dataBegin ( )
inline

Return a non-const (for writing) pointer to the beginning of the Fragment payload.

Returns
A pointer to the beginning of the Fragment payload

Definition at line 98 of file AsciiFragmentWriter.hh.

char * demo::AsciiFragmentWriter::dataEnd ( )
inline

Return a non-const (for writing) pointer to the end of the Fragment payload.

Returns
A pointer to the end of the Fragment payload

Definition at line 105 of file AsciiFragmentWriter.hh.

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

Returns a pointer to the AsciiFragment::Header object, non-const for writing.

Returns
A pointer to the AsciiFragment::Header object

Definition at line 53 of file AsciiFragmentWriter.hh.

void demo::AsciiFragmentWriter::resize ( size_t  nChars)
inline

Resize the Fragment so that it can contain nChars characters.

Parameters
nCharsNumber of characters in resized Fragment

Definition at line 110 of file AsciiFragmentWriter.hh.

void demo::AsciiFragmentWriter::set_hdr_line_number ( Header::line_number_t  line_number)
inline

Sets the line number in the AsciiFragment::Header to the given (ASCII-encoded) value.

Parameters
line_numberSet the line number (ASCII-encoded) to this value

Definition at line 63 of file AsciiFragmentWriter.hh.


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