ATLAS Offline Software
Typedefs | Functions
PayloadHelpers Namespace Reference

Collection of helper functions for raw pointer operations on the bytestream payload. More...

Typedefs

using TDA = TriggerEDMDeserialiserAlg
 

Functions

CLID collectionCLID (TDA::PayloadIterator start)
 CLID of the collection stored in the next fragment. More...
 
size_t nameLength (TDA::PayloadIterator start)
 Length of the serialised name payload. More...
 
size_t dataSize (TDA::PayloadIterator start)
 Size in bytes of the buffer that is needed to decode next fragment data content. More...
 
TDA::PayloadIterator toNextFragment (TDA::PayloadIterator start)
 Returns starting point of the next fragment, can be == end() More...
 
std::vector< std::string > collectionDescription (TDA::PayloadIterator start)
 String description of the collection stored in the next fragment, returns persistent type name and the SG key. More...
 
void toBuffer (TDA::PayloadIterator start, char *buffer)
 Copies fragment to the buffer, no size checking, use dataSize to do so. More...
 

Detailed Description

Collection of helper functions for raw pointer operations on the bytestream payload.

Most functions can be constexpr if the compiler implements ConstexprIterator (P0858R0) Tested it works in clang9 (and 10 and 11?) regardless of –std flag and in gcc10+ only with –std=c++20 But clang12 requires –std=c++20. TODO: Remove the C++ version checks when the release is built with –std=c++20 or newer

Typedef Documentation

◆ TDA

Definition at line 166 of file TriggerEDMDeserialiserAlg.cxx.

Function Documentation

◆ collectionCLID()

CLID PayloadHelpers::collectionCLID ( TDA::PayloadIterator  start)

CLID of the collection stored in the next fragment.

Definition at line 172 of file TriggerEDMDeserialiserAlg.cxx.

172  {
173  return *( start + TDA::CLIDOffset );
174  }

◆ collectionDescription()

std::vector<std::string> PayloadHelpers::collectionDescription ( TDA::PayloadIterator  start)

String description of the collection stored in the next fragment, returns persistent type name and the SG key.

Definition at line 205 of file TriggerEDMDeserialiserAlg.cxx.

205  {
207  std::vector<std::string> labels;
209  return labels;
210  }

◆ dataSize()

size_t PayloadHelpers::dataSize ( TDA::PayloadIterator  start)

Size in bytes of the buffer that is needed to decode next fragment data content.

Definition at line 188 of file TriggerEDMDeserialiserAlg.cxx.

188  {
189  return *( start + TDA::NameOffset + nameLength(start) );
190  }

◆ nameLength()

size_t PayloadHelpers::nameLength ( TDA::PayloadIterator  start)

Length of the serialised name payload.

Definition at line 180 of file TriggerEDMDeserialiserAlg.cxx.

180  {
181  return *( start + TDA::NameLengthOffset );
182  }

◆ toBuffer()

void PayloadHelpers::toBuffer ( TDA::PayloadIterator  start,
char *  buffer 
)

Copies fragment to the buffer, no size checking, use dataSize to do so.

Definition at line 213 of file TriggerEDMDeserialiserAlg.cxx.

213  {
214  // move to the beginning of the buffer memory
215  TDA::PayloadIterator dataStart = start + TDA::NameOffset + nameLength(start) + 1 /*skip size*/;
216  // we rely on continuous memory layout of std::vector ...
217  std::memcpy( buffer, &(*dataStart), dataSize(start) );
218  }

◆ toNextFragment()

TDA::PayloadIterator PayloadHelpers::toNextFragment ( TDA::PayloadIterator  start)

Returns starting point of the next fragment, can be == end()

Intended to be used like this: start = advance(start); if ( start != data.end() )... decode else ... done

Definition at line 200 of file TriggerEDMDeserialiserAlg.cxx.

200  {
201  return start + (*start); // point ahead by the number of words pointed to by start iterator
202  }
PowhegControl_ttHplus_NLO.ss
ss
Definition: PowhegControl_ttHplus_NLO.py:83
python.hltResultMT.NameOffset
NameOffset
Definition: hltResultMT.py:22
mergePhysValFiles.start
start
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:14
python.hltResultMT.NameLengthOffset
NameLengthOffset
Definition: hltResultMT.py:21
beamspotnt.labels
list labels
Definition: bin/beamspotnt.py:1447
createCoolChannelIdFile.buffer
buffer
Definition: createCoolChannelIdFile.py:12
PayloadHelpers::dataSize
size_t dataSize(TDA::PayloadIterator start)
Size in bytes of the buffer that is needed to decode next fragment data content.
Definition: TriggerEDMDeserialiserAlg.cxx:188
python.hltResultMT.CLIDOffset
CLIDOffset
Definition: hltResultMT.py:20
PayloadHelpers::nameLength
size_t nameLength(TDA::PayloadIterator start)
Length of the serialised name payload.
Definition: TriggerEDMDeserialiserAlg.cxx:180
StringSerializer
Utility class (not a tool or so) to serialize strings into stream of 32bit integers.
Definition: TrigDataAccess/TrigSerializeResult/TrigSerializeResult/StringSerializer.h:19