ATLAS Offline Software
Loading...
Searching...
No Matches
HLTExtraData.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
12
14
15using namespace HLT;
16
21
22HLTExtraData::HLTExtraData(const std::vector<uint32_t>& storage) :
23 statusCode(0)
24{
25 deserialize(storage);
26}
27
29 : appName{rhs.appName}
31 , anonymous{rhs.anonymous}
32 , m_stringSerializer{} // not copied (default always good)
33{}
34
36 : HLTExtraData{}
37{
38 swap(*this, rhs);
39}
40
41//coverity[PASS_BY_VALUE]
43{
44 swap(*this, rhs);
45 return *this;
46}
47
48void HLTExtraData::serialize(std::vector<uint32_t>& storage)
49{
50 if (empty()) return;
51
52 // add the application name and the host name
53 m_stringSerializer.serialize( appName, storage );
54
55 // one word for update status
56 storage.push_back( statusCode );
57
58 // Anonymous words
59 storage.insert(storage.end(), anonymous.begin(), anonymous.end());
60}
61
62
63void HLTExtraData::deserialize(const std::vector<uint32_t>& storage)
64{
65 if (storage.empty()) return;
66
67 // StringSerializer knows how long the string is
68 std::size_t offset = m_stringSerializer.deserialize(storage, appName);
69
70 if (offset < storage.size()) {
71 statusCode = storage[offset++];
72 anonymous.clear();
73 anonymous.insert(anonymous.begin(), storage.begin()+offset, storage.end());
74 }
75}
76
78{
79 using std::swap;
80
81 swap(lhs.appName, rhs.appName);
82 swap(lhs.statusCode, rhs.statusCode);
83 swap(lhs.anonymous, rhs.anonymous);
84 // default m_stringSerializer is good for every object
85}
Definition of the HLT extra data in the HLTResult payload.
Class representing the HLT extra payload stored in HLT::HLTResult::getExtras()
bool empty()
Return true if all members have default values (no serialization needed)
std::vector< uint32_t > anonymous
For future use-cases (only use as last resort)
void deserialize(const std::vector< uint32_t > &storage)
Deserialize storage into members.
friend void swap(HLTExtraData &, HLTExtraData &)
HLTExtraData()
Construct empty object.
void serialize(std::vector< uint32_t > &storage)
Serialize the data and append it to the vector.
std::string appName
application name
HLTExtraData & operator=(HLTExtraData)
unified assignement op
TrigSteeringEvent::StringSerializer m_stringSerializer
uint32_t statusCode
various status codes (for prescale/COOL updates)
It used to be useful piece of code for replacing actual SG with other store of similar functionality ...
void swap(HLTExtraData &, HLTExtraData &)
void swap(ElementLinkVector< DOBJ > &lhs, ElementLinkVector< DOBJ > &rhs)