A Fragment contains the data from one piece of the DAQ system for one event The artdaq::Fragment is the main data storage class in artdaq. Each Fragment represents the data from one piece of the readout, for one artdaq event. BoardReaders create Fragments and send them to the EventBuilders, where they are assembled into artdaq::RawEvent objects. More...
#include <artdaq-core/Data/Fragment.hh>
Public Types | |
typedef uint8_t | byte_t |
For byte representation. | |
typedef detail::RawFragmentHeader::version_t | version_t |
typedef for version_t from RawFragmentHeader | |
typedef detail::RawFragmentHeader::type_t | type_t |
typedef for type_t from RawFragmentHeader | |
typedef detail::RawFragmentHeader::sequence_id_t | sequence_id_t |
typedef for sequence_id_t from RawFragmentHeader | |
typedef detail::RawFragmentHeader::fragment_id_t | fragment_id_t |
typedef for fragment_id_t from RawFragmentHeader | |
typedef detail::RawFragmentHeader::timestamp_t | timestamp_t |
typedef for timestamp_t from RawFragmentHeader | |
typedef QuickVec< RawDataType > ::reference | reference |
Alias reference type from QuickVec<RawDataType>. | |
typedef QuickVec< RawDataType > ::iterator | iterator |
Alias iterator type from QuickVec<RawDataType>. | |
typedef QuickVec< RawDataType > ::const_iterator | const_iterator |
Alias const_iterator type from QuickVec<RawDataType>. | |
typedef QuickVec< RawDataType > ::value_type | value_type |
Alias value_type type from QuickVec<RawDataType>. | |
typedef QuickVec< RawDataType > ::difference_type | difference_type |
Alias difference_type type from QuickVec<RawDataType>. | |
typedef QuickVec< RawDataType > ::size_type | size_type |
Alias size_type type from QuickVec<RawDataType>. | |
Public Member Functions | |
Fragment () | |
Create a Fragment with all header values zeroed. | |
Fragment (const Fragment &) | |
Default copy constructor. | |
Fragment (Fragment &&) noexcept = default | |
Move Constructor. | |
Fragment & | operator= (const Fragment &) |
Default copy-assignment operator. | |
Fragment & | operator= (Fragment &&) noexcept = default |
Move-assignment operator. | |
Fragment (std::size_t n) | |
Create a Fragment ready to hold n words (RawDataTypes) of payload, and with all values zeroed. | |
template<class T > | |
Fragment (std::size_t payload_size, sequence_id_t sequence_id, fragment_id_t fragment_id, type_t type, const T &metadata, timestamp_t timestamp=Fragment::InvalidTimestamp) | |
Create a Fragment with the given header values. | |
Fragment (sequence_id_t sequenceID, fragment_id_t fragID, type_t type=Fragment::DataFragmentType, timestamp_t timestamp=Fragment::InvalidTimestamp) | |
Create a fragment with the given event id and fragment id, and with no data payload. | |
void | print (std::ostream &os) const |
Print out summary information for this Fragment to the given stream. | |
std::size_t | size () const |
Gets the size of the Fragment, from the Fragment header. | |
version_t | version () const |
Version of the Fragment, from the Fragment header. | |
type_t | type () const |
Type of the Fragment, from the Fragment header. | |
std::string | typeString () const |
Print the type of the Fragment. | |
sequence_id_t | sequenceID () const |
Sequence ID of the Fragment, from the Fragment header. | |
fragment_id_t | fragmentID () const |
Fragment ID of the Fragment, from the Fragment header. | |
timestamp_t | timestamp () const |
Timestamp of the Fragment, from the Fragment header. | |
void | setUserType (type_t utype) |
Sets the type of the Fragment, checking that it is a valid user type. | |
void | setSystemType (type_t stype) |
Sets the type of the Fragment, checking that it is a valid system type. | |
void | setSequenceID (sequence_id_t sequence_id) |
Sets the Sequence ID of the Fragment. | |
void | setFragmentID (fragment_id_t fragment_id) |
Sets the Fragment ID of the Fragment. | |
void | setTimestamp (timestamp_t timestamp) |
Sets the Timestamp of the Fragment. | |
std::size_t | sizeBytes () const |
Size of vals_ vector ( header + (optional) metadata + payload) in bytes. | |
std::size_t | dataSize () const |
Return the number of RawDataType words in the data payload. This does not include the number of words in the header or the metadata. | |
std::size_t | dataSizeBytes () const |
Return the number of bytes in the data payload. This does not include the number of bytes in the header or the metadata. | |
bool | hasMetadata () const |
Test whether this Fragment has metadata. | |
template<class T > | |
T * | metadata () |
Return a pointer to the metadata. This throws an exception if the Fragment contains no metadata. | |
template<class T > | |
T const * | metadata () const |
Return a const pointer to the metadata. This throws an exception if the Fragment contains no metadata. | |
template<class T > | |
void | setMetadata (const T &md) |
Set the metadata in the Fragment to the contents of the specified structure. This throws an exception if the Fragment already contains metadata. | |
template<class T > | |
void | updateMetadata (const T &md) |
Updates existing metadata with a new metadata object. | |
void | resize (std::size_t sz) |
Resize the data payload to hold sz RawDataType words. | |
void | resize (std::size_t sz, RawDataType val) |
Resize the data payload to hold sz RawDataType words. Initialize new elements (if any) with val. | |
void | resizeBytes (std::size_t szbytes) |
Resize the data payload to hold szbytes bytes (padded by the 8-byte RawDataTypes, so, e.g., requesting 14 bytes will actually get you 16). | |
void | resizeBytes (std::size_t szbytes, byte_t val) |
Resize the data payload to hold sz bytes (padded by the 8-byte RawDataTypes, so, e.g., requesting 14 bytes will actually get you 16). Initialize new elements (if any) with val. | |
void | autoResize () |
Resize the fragment to hold the number of words indicated by the header. | |
iterator | dataBegin () |
Return an iterator to the beginning of the data payload (after header and metadata). | |
iterator | dataEnd () |
Return an iterator to the end of the data payload. | |
template<typename T > | |
T | reinterpret_cast_checked (const RawDataType *in) const |
Wrapper around reinterpret_cast. | |
template<typename T > | |
T | reinterpret_cast_checked (RawDataType *in) |
Wrapper around reinterpret_cast. | |
byte_t * | dataBeginBytes () |
Return Fragment::byte_t* pointing at the beginning of the payload. | |
byte_t * | dataEndBytes () |
Return Fragment::byte_t* pointing at the end of the payload. | |
iterator | headerBegin () |
Return an iterator to the beginning of the header (should be used for serialization only: use setters for preference). | |
byte_t * | headerBeginBytes () |
Return a Fragment::byte_t pointer pointing to the beginning of the header. | |
const_iterator | dataBegin () const |
Returns a const_iterator to the beginning of the data payload. | |
const_iterator | dataEnd () const |
Returns a const_iterator to the end of the data payload. | |
const byte_t * | dataBeginBytes () const |
Return const Fragment::byte_t* pointing at the beginning of the payload. | |
const byte_t * | dataEndBytes () const |
Return const Fragment::byte_t* pointing at the end of the payload. | |
const_iterator | headerBegin () const |
Return an const_iterator to the beginning of the header (should be used for serialization only: use setters for preference). | |
const byte_t * | headerBeginBytes () const |
Return a const Fragment::byte_t pointer pointing to the beginning of the header. | |
void | clear () |
Removes all elements from the payload section of the Fragment. | |
bool | empty () |
Determines if the Fragment contains no data. | |
void | reserve (std::size_t cap) |
Reserves enough memory to hold cap RawDataType words in the Fragment payload. | |
void | swap (Fragment &other) noexcept |
Swaps two Fragment objects. | |
void | swap (QuickVec< RawDataType > &other) noexcept |
Swaps two Fragment data vectors. | |
RawDataType * | dataAddress () |
Returns a RawDataType pointer to the beginning of the payload. | |
RawDataType * | metadataAddress () |
Get the address of the metadata. For internal use only, use metadata() instead. | |
RawDataType * | headerAddress () |
Gets the address of the header. | |
Static Public Member Functions | |
static constexpr bool | isUserFragmentType (type_t fragmentType) |
Returns whether the given type is in the range of user types. | |
static constexpr bool | isSystemFragmentType (type_t fragmentType) |
Returns whether the given type is in the range of system types. | |
static std::map< type_t, std::string > | MakeSystemTypeMap () |
Returns a map of the most commonly-used system types. | |
static FragmentPtr | FragmentBytes (std::size_t nbytes) |
Create a Fragment using a static factory function rather than a constructor to allow for the function name "FragmentBytes". | |
template<class T > | |
static FragmentPtr | FragmentBytes (std::size_t payload_size_in_bytes, sequence_id_t sequence_id, fragment_id_t fragment_id, type_t type, const T &metadata, timestamp_t timestamp=Fragment::InvalidTimestamp) |
Create a Fragment with the given header values. Uses static factory function instead of constructor to allow for the function name "FragmentBytes". | |
static FragmentPtr | eodFrag (size_t nFragsToExpect) |
Creates an EndOfData Fragment. | |
template<class InputIterator > | |
static FragmentPtr | dataFrag (sequence_id_t sequenceID, fragment_id_t fragID, InputIterator i, InputIterator e) |
Creates a Fragment, copying data from given location. 12-Apr-2013, KAB - this method is deprecated, please do not use (internal use only). | |
static FragmentPtr | dataFrag (sequence_id_t sequenceID, fragment_id_t fragID, RawDataType const *dataPtr, size_t dataSize, timestamp_t timestamp=Fragment::InvalidTimestamp) |
Crates a Fragment, copying data from given location. | |
Static Public Attributes | |
static constexpr version_t | InvalidVersion = detail::RawFragmentHeader::InvalidVersion |
Copy InvalidVersion from RawFragmentHeader. | |
static constexpr sequence_id_t | InvalidSequenceID = detail::RawFragmentHeader::InvalidSequenceID |
Copy InvalidSequenceID from RawFragmentHeader. | |
static constexpr fragment_id_t | InvalidFragmentID = detail::RawFragmentHeader::InvalidFragmentID |
Copy InvalidFragmentID from RawFragmentHeader. | |
static constexpr timestamp_t | InvalidTimestamp = detail::RawFragmentHeader::InvalidTimestamp |
Copy InvalidTimestamp from RawFragmentHeader. | |
static constexpr type_t | InvalidFragmentType = detail::RawFragmentHeader::InvalidFragmentType |
Copy InvalidFragmentType from RawFragmentHeader. | |
static constexpr type_t | EndOfDataFragmentType = detail::RawFragmentHeader::EndOfDataFragmentType |
Copy EndOfDataFragmentType from RawFragmentHeader. | |
static constexpr type_t | DataFragmentType = detail::RawFragmentHeader::DataFragmentType |
Copy DataFragmentType from RawFragmentHeader. | |
static constexpr type_t | InitFragmentType = detail::RawFragmentHeader::InitFragmentType |
Copy InitFragmentType from RawFragmentHeader. | |
static constexpr type_t | EndOfRunFragmentType = detail::RawFragmentHeader::EndOfRunFragmentType |
Copy EndOfRunFragmentType from RawFragmentHeader. | |
static constexpr type_t | EndOfSubrunFragmentType = detail::RawFragmentHeader::EndOfSubrunFragmentType |
Copy EndOfSubrunFragmentType from RawFragmentHeader. | |
static constexpr type_t | ShutdownFragmentType = detail::RawFragmentHeader::ShutdownFragmentType |
Copy ShutdownFragmentType from RawFragmentHeader. | |
static constexpr type_t | FirstUserFragmentType = detail::RawFragmentHeader::FIRST_USER_TYPE |
Copy FIRST_USER_TYPE from RawFragmentHeader. | |
static constexpr type_t | EmptyFragmentType = detail::RawFragmentHeader::EmptyFragmentType |
Copy EmptyFragmentType from RawFragmentHeader. | |
static constexpr type_t | ContainerFragmentType = detail::RawFragmentHeader::ContainerFragmentType |
Copy ContainerFragmentType from RawFragmentHeader. | |
static constexpr type_t | ErrorFragmentType = detail::RawFragmentHeader::ErrorFragmentType |
Copy ErrorFragmentType from RawFragmentHeader. |
A Fragment contains the data from one piece of the DAQ system for one event The artdaq::Fragment is the main data storage class in artdaq. Each Fragment represents the data from one piece of the readout, for one artdaq event. BoardReaders create Fragments and send them to the EventBuilders, where they are assembled into artdaq::RawEvent objects.
Definition at line 84 of file Fragment.hh.
typedef uint8_t artdaq::Fragment::byte_t |
For byte representation.
JCF, 3/25/14 Add interface functions which allow users to work with the underlying data (a vector of RawDataTypes) in byte representation
Definition at line 99 of file Fragment.hh.
artdaq::Fragment::Fragment | ( | const Fragment & | ) |
Default copy constructor.
artdaq::Fragment::Fragment | ( | Fragment && | ) | = default [inline] |
Move Constructor.
Separate declaration and definition of Move Constructor: http://stackoverflow.com/questions/33939687 This should generate an exception if artdaq::Fragment is not move-constructible
artdaq::Fragment::Fragment | ( | std::size_t | n | ) | [explicit] |
Create a Fragment ready to hold n words (RawDataTypes) of payload, and with all values zeroed.
n | The initial size of the Fragment, in RawDataType words |
Definition at line 22 of file Fragment.cc.
artdaq::Fragment::Fragment | ( | std::size_t | payload_size, | |
sequence_id_t | sequence_id, | |||
fragment_id_t | fragment_id, | |||
type_t | type, | |||
const T & | metadata, | |||
timestamp_t | timestamp = Fragment::InvalidTimestamp | |||
) | [inline] |
Create a Fragment with the given header values.
T | Metadata type |
payload_size | Size of the payload in RawDataType words (Fragment size is header + metadata + payload) | |
sequence_id | Sequence ID of Fragment | |
fragment_id | Fragment ID of Fragment | |
type | Type of Fragment | |
metadata | Metadata object | |
timestamp | Timestamp of Fragment |
Definition at line 768 of file Fragment.hh.
artdaq::Fragment::Fragment | ( | sequence_id_t | sequenceID, | |
fragment_id_t | fragID, | |||
type_t | type = Fragment::DataFragmentType , |
|||
timestamp_t | timestamp = Fragment::InvalidTimestamp | |||
) |
artdaq::RawDataType * artdaq::Fragment::dataAddress | ( | ) | [inline] |
Returns a RawDataType pointer to the beginning of the payload.
Definition at line 1102 of file Fragment.hh.
artdaq::Fragment::const_iterator artdaq::Fragment::dataBegin | ( | ) | const [inline] |
Returns a const_iterator to the beginning of the data payload.
Definition at line 1048 of file Fragment.hh.
artdaq::Fragment::iterator artdaq::Fragment::dataBegin | ( | ) | [inline] |
Return an iterator to the beginning of the data payload (after header and metadata).
Definition at line 1026 of file Fragment.hh.
const byte_t* artdaq::Fragment::dataBeginBytes | ( | ) | const [inline] |
Return const Fragment::byte_t* pointing at the beginning of the payload.
JCF, 3/25/14 -- one nice thing about returning a pointer rather than an iterator is that we don't need to take the address of the dereferenced iterator (e.g., via &*dataEnd() ) to get ahold of the memory
Definition at line 568 of file Fragment.hh.
byte_t* artdaq::Fragment::dataBeginBytes | ( | ) | [inline] |
Return Fragment::byte_t* pointing at the beginning of the payload.
JCF, 3/25/14 -- one nice thing about returning a pointer rather than an iterator is that we don't need to take the address of the dereferenced iterator (e.g., via &*dataBegin() ) to get ahold of the memory
Definition at line 523 of file Fragment.hh.
artdaq::Fragment::const_iterator artdaq::Fragment::dataEnd | ( | ) | const [inline] |
Returns a const_iterator to the end of the data payload.
Definition at line 1056 of file Fragment.hh.
artdaq::Fragment::iterator artdaq::Fragment::dataEnd | ( | ) | [inline] |
Return an iterator to the end of the data payload.
Definition at line 1034 of file Fragment.hh.
const byte_t* artdaq::Fragment::dataEndBytes | ( | ) | const [inline] |
Return const Fragment::byte_t* pointing at the end of the payload.
JCF, 3/25/14 -- one nice thing about returning a pointer rather than an iterator is that we don't need to take the address of the dereferenced iterator (e.g., via &*dataEnd() ) to get ahold of the memory
Definition at line 581 of file Fragment.hh.
byte_t* artdaq::Fragment::dataEndBytes | ( | ) | [inline] |
Return Fragment::byte_t* pointing at the end of the payload.
JCF, 3/25/14 -- one nice thing about returning a pointer rather than an iterator is that we don't need to take the address of the dereferenced iterator (e.g., via &*dataEnd() ) to get ahold of the memory
Definition at line 533 of file Fragment.hh.
artdaq::FragmentPtr artdaq::Fragment::dataFrag | ( | sequence_id_t | sequenceID, | |
fragment_id_t | fragID, | |||
RawDataType const * | dataPtr, | |||
size_t | dataSize, | |||
timestamp_t | timestamp = Fragment::InvalidTimestamp | |||
) | [static] |
Crates a Fragment, copying data from given location.
sequenceID | Sequence ID of new Fragment | |
fragID | Fragment ID of new Fragment | |
dataPtr | Pointer to data to store in Fragment | |
dataSize | Size of data to store in Fragment | |
timestamp | Timestamp of created Fragment |
Definition at line 85 of file Fragment.cc.
static FragmentPtr artdaq::Fragment::dataFrag | ( | sequence_id_t | sequenceID, | |
fragment_id_t | fragID, | |||
InputIterator | i, | |||
InputIterator | e | |||
) | [inline, static] |
Creates a Fragment, copying data from given location. 12-Apr-2013, KAB - this method is deprecated, please do not use (internal use only).
InputIterator | Type of input iterator |
sequenceID | Sequence ID of new Fragment | |
fragID | Fragment ID of new Fragment | |
i | Beginning of input range | |
e | End of input range |
Definition at line 670 of file Fragment.hh.
std::size_t artdaq::Fragment::dataSize | ( | ) | const [inline] |
Return the number of RawDataType words in the data payload. This does not include the number of words in the header or the metadata.
Definition at line 895 of file Fragment.hh.
std::size_t artdaq::Fragment::dataSizeBytes | ( | ) | const [inline] |
Return the number of bytes in the data payload. This does not include the number of bytes in the header or the metadata.
Definition at line 356 of file Fragment.hh.
bool artdaq::Fragment::empty | ( | ) | [inline] |
Determines if the Fragment contains no data.
Definition at line 1079 of file Fragment.hh.
artdaq::FragmentPtr artdaq::Fragment::eodFrag | ( | size_t | nFragsToExpect | ) | [static] |
Creates an EndOfData Fragment.
nFragsToExpect | The number of Fragments the receiver should have at the end of data-taking |
Definition at line 74 of file Fragment.cc.
static FragmentPtr artdaq::Fragment::FragmentBytes | ( | std::size_t | payload_size_in_bytes, | |
sequence_id_t | sequence_id, | |||
fragment_id_t | fragment_id, | |||
type_t | type, | |||
const T & | metadata, | |||
timestamp_t | timestamp = Fragment::InvalidTimestamp | |||
) | [inline, static] |
Create a Fragment with the given header values. Uses static factory function instead of constructor to allow for the function name "FragmentBytes".
T | Metadata type |
payload_size_in_bytes | Size of the payload in bytes (Fragment size is header + metadata + payload). Bytes will be rounded to the next factor of RawDataType / sizeof(char) | |
sequence_id | Sequence ID of Fragment | |
fragment_id | Fragment ID of Fragment | |
type | Type of Fragment | |
metadata | Metadata object | |
timestamp | Timestamp of Fragment |
Definition at line 236 of file Fragment.hh.
static FragmentPtr artdaq::Fragment::FragmentBytes | ( | std::size_t | nbytes | ) | [inline, static] |
Create a Fragment using a static factory function rather than a constructor to allow for the function name "FragmentBytes".
nbytes | The initial size of the Fragment, in bytes |
Definition at line 201 of file Fragment.hh.
artdaq::Fragment::fragment_id_t artdaq::Fragment::fragmentID | ( | ) | const [inline] |
bool artdaq::Fragment::hasMetadata | ( | ) | const [inline] |
Test whether this Fragment has metadata.
Definition at line 903 of file Fragment.hh.
artdaq::RawDataType * artdaq::Fragment::headerAddress | ( | ) | [inline] |
Gets the address of the header.
Definition at line 1122 of file Fragment.hh.
artdaq::Fragment::const_iterator artdaq::Fragment::headerBegin | ( | ) | const [inline] |
Return an const_iterator to the beginning of the header (should be used for serialization only: use setters for preference).
Definition at line 1063 of file Fragment.hh.
artdaq::Fragment::iterator artdaq::Fragment::headerBegin | ( | ) | [inline] |
Return an iterator to the beginning of the header (should be used for serialization only: use setters for preference).
Definition at line 1041 of file Fragment.hh.
const byte_t* artdaq::Fragment::headerBeginBytes | ( | ) | const [inline] |
Return a const Fragment::byte_t pointer pointing to the beginning of the header.
Definition at line 597 of file Fragment.hh.
byte_t* artdaq::Fragment::headerBeginBytes | ( | ) | [inline] |
Return a Fragment::byte_t pointer pointing to the beginning of the header.
Definition at line 546 of file Fragment.hh.
bool constexpr artdaq::Fragment::isSystemFragmentType | ( | type_t | fragmentType | ) | [inline, static] |
Returns whether the given type is in the range of system types.
fragmentType | The type to test |
Definition at line 735 of file Fragment.hh.
bool constexpr artdaq::Fragment::isUserFragmentType | ( | type_t | fragmentType | ) | [inline, static] |
Returns whether the given type is in the range of user types.
fragmentType | The type to test |
Definition at line 725 of file Fragment.hh.
static std::map<type_t, std::string> artdaq::Fragment::MakeSystemTypeMap | ( | ) | [inline, static] |
Returns a map of the most commonly-used system types.
Definition at line 176 of file Fragment.hh.
T const * artdaq::Fragment::metadata | ( | ) | const [inline] |
Return a const pointer to the metadata. This throws an exception if the Fragment contains no metadata.
T | Type of the metadata |
cet::exception | if no metadata is present |
Definition at line 924 of file Fragment.hh.
T * artdaq::Fragment::metadata | ( | ) | [inline] |
Return a pointer to the metadata. This throws an exception if the Fragment contains no metadata.
T | Type of the metadata |
cet::exception | if no metadata is present |
Definition at line 910 of file Fragment.hh.
artdaq::RawDataType * artdaq::Fragment::metadataAddress | ( | ) | [inline] |
Get the address of the metadata. For internal use only, use metadata() instead.
cet::exception | if no metadata in Fragment |
Definition at line 1110 of file Fragment.hh.
artdaq::Fragment & artdaq::Fragment::operator= | ( | Fragment && | ) | = default [inline] |
Move-assignment operator.
Separate declaration and definition of Move Constructor: http://stackoverflow.com/questions/33939687 This should generate an exception if artdaq::Fragment is not move-constructible
void artdaq::Fragment::print | ( | std::ostream & | os | ) | const |
Print out summary information for this Fragment to the given stream.
os | Stream to print to |
Definition at line 65 of file Fragment.cc.
T artdaq::Fragment::reinterpret_cast_checked | ( | RawDataType * | in | ) | [inline] |
Wrapper around reinterpret_cast.
T | Type of output pointer |
in | input pointer |
cet::exception | if new pointer does not point to same address as old pointer |
JCF, 1/21/15 There's actually not an ironclad guarantee in the C++ standard that the pointer reinterpret_cast<> returns has the same address as the pointer that was casted. It IS tested in the artdaq-core test suite, but since any uncaught, unexpected behavior from reinterpret_cast could be disastrous, I've wrapped it in this function and added a check just to be completely safe.
Definition at line 503 of file Fragment.hh.
T artdaq::Fragment::reinterpret_cast_checked | ( | const RawDataType * | in | ) | const [inline] |
Wrapper around reinterpret_cast.
T | Type of output pointer |
in | input pointer |
cet::exception | if new pointer does not point to same address as old pointer |
JCF, 1/21/15 There's actually not an ironclad guarantee in the C++ standard that the pointer reinterpret_cast<> returns has the same address as the pointer that was casted. It IS tested in the artdaq-core test suite, but since any uncaught, unexpected behavior from reinterpret_cast could be disastrous, I've wrapped it in this function and added a check just to be completely safe.
Please note that for this const-version, you'll need the const- qualifier to the pointer you pass as a parameter (i.e., reinterpret_cast_checked<const PtrType*>, not reinterpret_cast_checked<PtrType*>)
Definition at line 475 of file Fragment.hh.
void artdaq::Fragment::reserve | ( | std::size_t | cap | ) | [inline] |
Reserves enough memory to hold cap RawDataType words in the Fragment payload.
cap | The new capacity of the Fragment payload, in RawDataType words. |
Definition at line 1087 of file Fragment.hh.
void artdaq::Fragment::resize | ( | std::size_t | sz, | |
RawDataType | val | |||
) | [inline] |
Resize the data payload to hold sz RawDataType words. Initialize new elements (if any) with val.
sz | The new size of the payload portion of the Fragment, in RawDataType words | |
val | Value with which to initialize any new elements |
Definition at line 983 of file Fragment.hh.
void artdaq::Fragment::resize | ( | std::size_t | sz | ) | [inline] |
Resize the data payload to hold sz RawDataType words.
sz | The new size of the payload portion of the Fragment, in RawDataType words |
Definition at line 974 of file Fragment.hh.
void artdaq::Fragment::resizeBytes | ( | std::size_t | szbytes, | |
byte_t | val | |||
) | [inline] |
Resize the data payload to hold sz bytes (padded by the 8-byte RawDataTypes, so, e.g., requesting 14 bytes will actually get you 16). Initialize new elements (if any) with val.
szbytes | The new size of the payload portion of the Fragment, in bytes | |
val | Value with which to initialize any new elements |
Definition at line 999 of file Fragment.hh.
void artdaq::Fragment::resizeBytes | ( | std::size_t | szbytes | ) | [inline] |
Resize the data payload to hold szbytes bytes (padded by the 8-byte RawDataTypes, so, e.g., requesting 14 bytes will actually get you 16).
szbytes | The new size of the payload portion of the Fragment, in bytes |
Definition at line 991 of file Fragment.hh.
artdaq::Fragment::sequence_id_t artdaq::Fragment::sequenceID | ( | ) | const [inline] |
Sequence ID of the Fragment, from the Fragment header.
Definition at line 827 of file Fragment.hh.
void artdaq::Fragment::setFragmentID | ( | fragment_id_t | fragment_id | ) | [inline] |
Sets the Fragment ID of the Fragment.
fragment_id | The Fragment ID to set |
Definition at line 870 of file Fragment.hh.
void artdaq::Fragment::setMetadata | ( | const T & | md | ) | [inline] |
Set the metadata in the Fragment to the contents of the specified structure. This throws an exception if the Fragment already contains metadata.
T | Type of the metadata |
md | Metadata to store in Fragment |
cet::exception | if metadata already present in Fragment |
Definition at line 937 of file Fragment.hh.
void artdaq::Fragment::setSequenceID | ( | sequence_id_t | sequence_id | ) | [inline] |
Sets the Sequence ID of the Fragment.
sequence_id | The sequence ID to set |
Definition at line 862 of file Fragment.hh.
void artdaq::Fragment::setSystemType | ( | type_t | stype | ) | [inline] |
Sets the type of the Fragment, checking that it is a valid system type.
stype | The System type to set |
Definition at line 855 of file Fragment.hh.
void artdaq::Fragment::setTimestamp | ( | timestamp_t | timestamp | ) | [inline] |
Sets the Timestamp of the Fragment.
timestamp | The Timestamp to set |
Definition at line 877 of file Fragment.hh.
void artdaq::Fragment::setUserType | ( | type_t | utype | ) | [inline] |
Sets the type of the Fragment, checking that it is a valid user type.
utype | The User type to set |
Definition at line 848 of file Fragment.hh.
std::size_t artdaq::Fragment::size | ( | ) | const [inline] |
Gets the size of the Fragment, from the Fragment header.
Definition at line 799 of file Fragment.hh.
std::size_t artdaq::Fragment::sizeBytes | ( | ) | const [inline] |
Size of vals_ vector ( header + (optional) metadata + payload) in bytes.
Definition at line 341 of file Fragment.hh.
void artdaq::Fragment::swap | ( | QuickVec< RawDataType > & | other | ) | [inline] |
Swaps two Fragment data vectors.
other | The data vector to swap with |
Since all Fragment header information is stored in the data vector, this is equivalent to swapping two Fragment objects
Definition at line 631 of file Fragment.hh.
void artdaq::Fragment::swap | ( | Fragment & | other | ) | [inline] |
Swaps two Fragment objects.
other | Fragment to swap with |
Definition at line 1095 of file Fragment.hh.
artdaq::Fragment::timestamp_t artdaq::Fragment::timestamp | ( | ) | const [inline] |
Timestamp of the Fragment, from the Fragment header.
Definition at line 841 of file Fragment.hh.
artdaq::Fragment::type_t artdaq::Fragment::type | ( | ) | const [inline] |
Type of the Fragment, from the Fragment header.
Definition at line 813 of file Fragment.hh.
std::string artdaq::Fragment::typeString | ( | ) | const [inline] |
Print the type of the Fragment.
Definition at line 820 of file Fragment.hh.
void artdaq::Fragment::updateMetadata | ( | const T & | md | ) | [inline] |
Updates existing metadata with a new metadata object.
T | Type of the metadata |
md | Metadata to set |
cet::exception | if no metadata stored in Fragment | |
cet::exception | if new metadata has different size than existing metadata |
Definition at line 954 of file Fragment.hh.
artdaq::Fragment::version_t artdaq::Fragment::version | ( | ) | const [inline] |
Version of the Fragment, from the Fragment header.
Definition at line 806 of file Fragment.hh.