ATLAS Offline Software
Loading...
Searching...
No Matches
HLTExtraData.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 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
42{
43 swap(*this, rhs);
44 return *this;
45}
46
47void HLTExtraData::serialize(std::vector<uint32_t>& storage)
48{
49 if (empty()) return;
50
51 // add the application name and the host name
52 m_stringSerializer.serialize( appName, storage );
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}
60
61
62void HLTExtraData::deserialize(const std::vector<uint32_t>& storage)
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}
75
77{
78 using std::swap;
79
80 swap(lhs.appName, rhs.appName);
81 swap(lhs.statusCode, rhs.statusCode);
82 swap(lhs.anonymous, rhs.anonymous);
83 // default m_stringSerializer is good for every object
84}
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)