ATLAS Offline Software
BaseHolder.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
7 #include <iostream>
8 using namespace HLT;
9 
11 
12 bool BaseHolder::enquireSerialized(std::vector<uint32_t>::const_iterator& fromHere,
13  const std::vector<uint32_t>::const_iterator& end,
14  class_id_type& c, std::string& label,
15  sub_index_type& subtypeIndex ) {
16  using namespace std;
17  if ( fromHere == end ) return false;
18 
19  c = *fromHere++;
20  if ( fromHere == end ) return false;
21 
22  subtypeIndex = *fromHere++;
23  if ( fromHere == end ) return false;
24 
25  unsigned labelSize = *fromHere++;
26  if ( fromHere == end ) return false;
27  if ( fromHere+labelSize > end ) return false;
28 
29  std::vector<uint32_t>::const_iterator stringEnd = fromHere+labelSize;
30  HLT::StringSerializer::deserialize(fromHere, stringEnd, label);
31 
32  //advance iterator to end of label
33  std::advance(fromHere,labelSize);
34 
35  return true;
36 }
37 
38 bool BaseHolder::serialize(std::vector<uint32_t>& output) const {
39  output.push_back( typeClid() );
40  output.push_back( subTypeIndex() );
41 
42  const size_t labelSizeIndex = output.size();
43  output.push_back( 0 );
44  const size_t beforeSS = output.size();
46  output[labelSizeIndex] = output.size() - beforeSS;
47  return true;
48 }
HLT::BaseHolder::label
virtual const std::string & label() const =0
HLT::BaseHolder::typeClid
virtual class_id_type typeClid() const =0
HLT::BaseHolder::serialize
virtual bool serialize(std::vector< uint32_t > &data) const
Definition: BaseHolder.cxx:38
PlotCalibFromCool.label
label
Definition: PlotCalibFromCool.py:78
StringSerializer::serialize
void serialize(const std::vector< std::string > &strings, std::vector< uint32_t > &storage)
Serializes vector of strings into vector of integers.
Definition: TrigDataAccess/TrigSerializeResult/src/StringSerializer.cxx:10
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
StringSerializer.h
HLT
It used to be useful piece of code for replacing actual SG with other store of similar functionality ...
Definition: HLTResultReader.h:26
HLT::BaseHolder::subTypeIndex
virtual sub_index_type subTypeIndex() const =0
HLT::class_id_type
uint32_t class_id_type
Definition: Trigger/TrigEvent/TrigNavStructure/Root/Types.h:11
HLT::sub_index_type
uint16_t sub_index_type
Definition: Trigger/TrigEvent/TrigNavStructure/Root/Types.h:9
BaseHolder.h
merge.output
output
Definition: merge.py:17
HLT::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)
Definition: TrigEvent/TrigNavStructure/Root/StringSerializer.cxx:66
HLT::BaseHolder::enquireSerialized
static bool enquireSerialized(std::vector< uint32_t >::const_iterator &fromHere, const std::vector< uint32_t >::const_iterator &end, class_id_type &c, std::string &label, sub_index_type &subtypeIndex)
Definition: BaseHolder.cxx:12
HLT::BaseHolder::~BaseHolder
virtual ~BaseHolder()
Definition: BaseHolder.cxx:10
python.compressB64.c
def c
Definition: compressB64.py:93