ATLAS Offline Software
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | Friends | List of all members
HLT::HLTExtraData Class Reference

Class representing the HLT extra payload stored in HLT::HLTResult::getExtras() More...

#include <HLTExtraData.h>

Collaboration diagram for HLT::HLTExtraData:

Public Member Functions

 HLTExtraData ()
 Construct empty object. More...
 
 HLTExtraData (const std::vector< uint32_t > &storage)
 Construct from storage and fill members. More...
 
 HLTExtraData (const HLTExtraData &)
 copy ctor More...
 
 HLTExtraData (HLTExtraData &&)
 move ctor More...
 
HLTExtraDataoperator= (HLTExtraData)
 unified assignement op More...
 
void serialize (std::vector< uint32_t > &storage)
 Serialize the data and append it to the vector. More...
 
void deserialize (const std::vector< uint32_t > &storage)
 Deserialize storage into members. More...
 

Public Attributes

std::string appName
 application name More...
 
uint32_t statusCode
 various status codes (for prescale/COOL updates) More...
 
std::vector< uint32_t > anonymous
 For future use-cases (only use as last resort) More...
 

Private Member Functions

bool empty ()
 Return true if all members have default values (no serialization needed) More...
 

Private Attributes

TrigSteeringEvent::StringSerializer m_stringSerializer
 

Friends

void swap (HLTExtraData &, HLTExtraData &)
 

Detailed Description

Class representing the HLT extra payload stored in HLT::HLTResult::getExtras()

The members storing the data are public. New members should be added whenever additional storage is needed. The reserved anonymous member should only be used as a last resort.

If all members of this class are set to their default values (see empty()) a call to serialize() will do nothing. A deserialization from empty storage will result in a default constructed object.

Whenever you modify this class run 'make check'.

Definition at line 36 of file HLTExtraData.h.

Constructor & Destructor Documentation

◆ HLTExtraData() [1/4]

HLTExtraData::HLTExtraData ( )

Construct empty object.

Definition at line 17 of file HLTExtraData.cxx.

17  :
18  statusCode(0)
19 {
20 }

◆ HLTExtraData() [2/4]

HLTExtraData::HLTExtraData ( const std::vector< uint32_t > &  storage)

Construct from storage and fill members.

Definition at line 22 of file HLTExtraData.cxx.

22  :
23  statusCode(0)
24 {
25  deserialize(storage);
26 }

◆ HLTExtraData() [3/4]

HLTExtraData::HLTExtraData ( const HLTExtraData rhs)

copy ctor

Definition at line 28 of file HLTExtraData.cxx.

29  : appName{rhs.appName}
30  , statusCode{rhs.statusCode}
31  , anonymous{rhs.anonymous}
32  , m_stringSerializer{} // not copied (default always good)
33 {}

◆ HLTExtraData() [4/4]

HLTExtraData::HLTExtraData ( HLTExtraData &&  rhs)

move ctor

Definition at line 35 of file HLTExtraData.cxx.

36  : HLTExtraData{}
37 {
38  swap(*this, rhs);
39 }

Member Function Documentation

◆ deserialize()

void HLTExtraData::deserialize ( const std::vector< uint32_t > &  storage)

Deserialize storage into members.

Definition at line 62 of file HLTExtraData.cxx.

63 {
64  if (storage.empty()) return;
65 
66  // StringSerializer knows how long the string is
67  std::size_t offset = m_stringSerializer.deserialize(storage, appName);
68 
69  if (offset < storage.size()) {
70  statusCode = storage[offset++];
71  anonymous.clear();
72  anonymous.insert(anonymous.begin(), storage.begin()+offset, storage.end());
73  }
74 }

◆ empty()

bool HLT::HLTExtraData::empty ( )
inlineprivate

Return true if all members have default values (no serialization needed)

Definition at line 71 of file HLTExtraData.h.

71  {
72  return (appName.empty() && statusCode==0 && anonymous.empty());
73  }

◆ operator=()

HLTExtraData & HLTExtraData::operator= ( HLTExtraData  rhs)

unified assignement op

Definition at line 41 of file HLTExtraData.cxx.

42 {
43  swap(*this, rhs);
44  return *this;
45 }

◆ serialize()

void HLTExtraData::serialize ( std::vector< uint32_t > &  storage)

Serialize the data and append it to the vector.

Definition at line 47 of file HLTExtraData.cxx.

48 {
49  if (empty()) return;
50 
51  // add the application name and the host name
53 
54  // one word for update status
55  storage.push_back( statusCode );
56 
57  // Anonymous words
58  storage.insert(storage.end(), anonymous.begin(), anonymous.end());
59 }

Friends And Related Function Documentation

◆ swap

void swap ( HLTExtraData ,
HLTExtraData  
)
friend

Member Data Documentation

◆ anonymous

std::vector<uint32_t> HLT::HLTExtraData::anonymous

For future use-cases (only use as last resort)

Definition at line 66 of file HLTExtraData.h.

◆ appName

std::string HLT::HLTExtraData::appName

application name

Definition at line 64 of file HLTExtraData.h.

◆ m_stringSerializer

TrigSteeringEvent::StringSerializer HLT::HLTExtraData::m_stringSerializer
private

Definition at line 75 of file HLTExtraData.h.

◆ statusCode

uint32_t HLT::HLTExtraData::statusCode

various status codes (for prescale/COOL updates)

Definition at line 65 of file HLTExtraData.h.


The documentation for this class was generated from the following files:
HLT::HLTExtraData::m_stringSerializer
TrigSteeringEvent::StringSerializer m_stringSerializer
Definition: HLTExtraData.h:75
HLT::HLTExtraData::empty
bool empty()
Return true if all members have default values (no serialization needed)
Definition: HLTExtraData.h:71
HLT::HLTExtraData::statusCode
uint32_t statusCode
various status codes (for prescale/COOL updates)
Definition: HLTExtraData.h:65
TrigSteeringEvent::StringSerializer::serialize
void serialize(const std::vector< std::string > &strings, std::vector< uint32_t > &storage)
Serializes vector of strings into vector of integers.
Definition: TrigEvent/TrigSteeringEvent/src/StringSerializer.cxx:15
HLT::HLTExtraData::anonymous
std::vector< uint32_t > anonymous
For future use-cases (only use as last resort)
Definition: HLTExtraData.h:66
HLT::HLTExtraData::swap
friend void swap(HLTExtraData &, HLTExtraData &)
HLT::HLTExtraData::appName
std::string appName
application name
Definition: HLTExtraData.h:64
HLT::HLTExtraData::deserialize
void deserialize(const std::vector< uint32_t > &storage)
Deserialize storage into members.
Definition: HLTExtraData.cxx:62
TrigSteeringEvent::StringSerializer::deserialize
std::size_t deserialize(std::vector< uint32_t >::const_iterator first, std::vector< uint32_t >::const_iterator last, std::vector< std::string > &strings)
Deserialize vector into strings.
Definition: TrigEvent/TrigSteeringEvent/src/StringSerializer.cxx:67
convertTimingResiduals.offset
offset
Definition: convertTimingResiduals.py:71
HLT::HLTExtraData
Class representing the HLT extra payload stored in HLT::HLTResult::getExtras()
Definition: HLTExtraData.h:36