artdaq_core  v3_05_07
artdaq::ContainerFragmentLoader Class Reference

A Read-Write version of the ContainerFragment, used for filling ContainerFragment objects with other Fragment objects. More...

#include <artdaq-core/Data/ContainerFragmentLoader.hh>

Inheritance diagram for artdaq::ContainerFragmentLoader:
artdaq::ContainerFragment

Public Member Functions

 ContainerFragmentLoader (Fragment &f, Fragment::type_t expectedFragmentType)
 Constructs the ContainerFragmentLoader. More...
 
Metadatametadata ()
 Get the ContainerFragment metadata (includes information about the location of Fragment objects within the ContainerFragment) More...
 
void set_fragment_type (Fragment::type_t type)
 Sets the type of Fragment which this ContainerFragment should contain. More...
 
void set_missing_data (bool isDataMissing)
 Sets the missing_data flag. More...
 
void addFragment (artdaq::Fragment &frag)
 Add a Fragment to the ContainerFragment by reference. More...
 
void addFragment (artdaq::FragmentPtr &frag)
 Add a Fragment to the ContainerFragment by smart pointer. More...
 
void addFragments (artdaq::FragmentPtrs &frags)
 Add a collection of Fragment objects to the ContainerFragment. More...
 
- Public Member Functions inherited from artdaq::ContainerFragment
Metadata const * UpgradeMetadata (MetadataV0 const *in) const
 Upgrade the Metadata of a fixed-size ContainerFragment to the new standard. More...
 
 ContainerFragment (Fragment const &f)
 
Metadata const * metadata () const
 const getter function for the Metadata More...
 
Metadata::count_t block_count () const
 Gets the number of fragments stored in the ContainerFragment. More...
 
Fragment::type_t fragment_type () const
 Get the Fragment::type_t of stored Fragment objects. More...
 
bool missing_data () const
 Gets the flag if the ContainerFragment knows that it is missing data. More...
 
void const * dataBegin () const
 Gets the start of the data. More...
 
void const * dataEnd () const
 Gets the last Fragment in the ContainerFragment. More...
 
FragmentPtr at (size_t index) const
 Gets a specific Fragment from the ContainerFragment. More...
 
size_t fragSize (size_t index) const
 Gets the size of the Fragment at the specified location in the ContainerFragment, in bytes. More...
 
FragmentPtr operator[] (size_t index) const
 Alias to ContainerFragment::at() More...
 
size_t fragmentIndex (size_t index) const
 Get the offset of a Fragment within the ContainerFragment. More...
 
size_t lastFragmentIndex () const
 Returns the offset of the last Fragment in the ContainerFragment. More...
 

Additional Inherited Members

- Static Public Attributes inherited from artdaq::ContainerFragment
static constexpr uint8_t CURRENT_VERSION = 1
 The current version of the ContainerFragmentHeader.
 
static constexpr size_t CONTAINER_MAGIC = 0x00BADDEED5B1BEE5
 Marker word used in index.
 
- Protected Member Functions inherited from artdaq::ContainerFragment
const size_t * create_index_ () const
 Create an index for the currently-contained Fragments. More...
 
void reset_index_ptr_ () const
 Reset the index pointer, creating a new index if necessary. ContainerFragmentLoader uses this functionality to implant new indicies into the ContainerFragment, other code should simply use the get_index_ function.
 
const size_t * get_index_ () const
 Get a pointer to the index. More...
 
- Static Protected Member Functions inherited from artdaq::ContainerFragment
static constexpr size_t words_per_frag_word_ ()
 Gets the ratio between the fundamental data storage type and the representation within the Fragment. More...
 

Detailed Description

A Read-Write version of the ContainerFragment, used for filling ContainerFragment objects with other Fragment objects.

Definition at line 27 of file ContainerFragmentLoader.hh.

Constructor & Destructor Documentation

artdaq::ContainerFragmentLoader::ContainerFragmentLoader ( artdaq::Fragment f,
Fragment::type_t  expectedFragmentType = Fragment::EmptyFragmentType 
)
inlineexplicit

Constructs the ContainerFragmentLoader.

Parameters
fA Fragment object containing a Fragment header.
expectedFragmentTypeThe type of fragment which will be put into this ContainerFragment
Exceptions
cet::exceptionif the Fragment input has inconsistent Header information

Definition at line 102 of file ContainerFragmentLoader.hh.

Member Function Documentation

void artdaq::ContainerFragmentLoader::addFragment ( artdaq::Fragment frag)
inline

Add a Fragment to the ContainerFragment by reference.

Parameters
fragA Fragment object to be added to the ContainerFragment
Exceptions
cet::exceptionIf the Fragment to be added has a different type than expected

Definition at line 144 of file ContainerFragmentLoader.hh.

void artdaq::ContainerFragmentLoader::addFragment ( artdaq::FragmentPtr frag)
inline

Add a Fragment to the ContainerFragment by smart pointer.

Parameters
fragA FragmentPtr to a Fragment to be added to the ContainerFragment

Definition at line 175 of file ContainerFragmentLoader.hh.

void artdaq::ContainerFragmentLoader::addFragments ( artdaq::FragmentPtrs frags)
inline

Add a collection of Fragment objects to the ContainerFragment.

Parameters
fragsAn artdaq::FragmentPtrs object containing Fragments to be added to the ContainerFragment

Definition at line 180 of file ContainerFragmentLoader.hh.

Metadata* artdaq::ContainerFragmentLoader::metadata ( )
inline

Get the ContainerFragment metadata (includes information about the location of Fragment objects within the ContainerFragment)

Returns
The ContainerFragment metadata

Definition at line 43 of file ContainerFragmentLoader.hh.

void artdaq::ContainerFragmentLoader::set_fragment_type ( Fragment::type_t  type)
inline

Sets the type of Fragment which this ContainerFragment should contain.

Parameters
typeThe Fragment::type_t identifying the type of Fragment objects stored in this ContainerFragment

Definition at line 53 of file ContainerFragmentLoader.hh.

void artdaq::ContainerFragmentLoader::set_missing_data ( bool  isDataMissing)
inline

Sets the missing_data flag.

Parameters
isDataMissingThe value of the missing_data flag

The ContainerFragment::Metadata::missing_data flag is used for FragmentGenerators to indicate that the fragment is incomplete, but the generator does not have the correct data to fill it. This happens for Window-mode FragmentGenerators when the window requested is before the start of the FragmentGenerator's buffers, for example.

Definition at line 66 of file ContainerFragmentLoader.hh.


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