ATLAS Offline Software
TPCnvTokenList_p1.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef TPCnvTokenList_p1_h
6 #define TPCnvTokenList_p1_h
7 
8 #include <vector>
9 #include <string>
10 #include <sstream>
11 #include <stdexcept>
12 
25 public:
30  explicit
31  TPCnvToken_p1(unsigned short cnvID=0, const std::string& token="")
32  : m_converterID(cnvID), m_token(token) {}
33 
35  unsigned short converterID() const { return m_converterID; }
36 
38  const std::string& token() const { return m_token; }
39 
40 protected:
41  unsigned short m_converterID;
42  std::string m_token;
43 };
44 
45 
46 
55  : public std::vector<TPCnvToken_p1>
56 {
57 public:
62  void addToken( unsigned short cnvID, const std::string& token) {
63  push_back( TPCnvToken_p1(cnvID, token) );
64  }
65 
70  const std::string& findToken(unsigned short id) {
71  for( const_iterator it = begin(); it != end(); ++it ) {
72  if( it->converterID() == id )
73  return it->token();
74  }
75  std::ostringstream error;
76  error << "TPCnvTokenList_p1::findToken(): could not find a token for converter ID=" << id << std::ends;
77  throw std::runtime_error( error.str() );
78  }
79 };
80 
81 
82 
83 #endif
TPCnvTokenList_p1
Definition: TPCnvTokenList_p1.h:56
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
skel.it
it
Definition: skel.GENtoEVGEN.py:407
TPCnvToken_p1::m_converterID
unsigned short m_converterID
ID of the top-level TP converter.
Definition: TPCnvTokenList_p1.h:41
TPCnvToken_p1::m_token
std::string m_token
token to the extending object
Definition: TPCnvTokenList_p1.h:42
TPCnvTokenList_p1::addToken
void addToken(unsigned short cnvID, const std::string &token)
Stores a new reference to an extending object.
Definition: TPCnvTokenList_p1.h:62
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:92
TPCnvToken_p1::token
const std::string & token() const
Returns token.
Definition: TPCnvTokenList_p1.h:38
TPCnvToken_p1::converterID
unsigned short converterID() const
Returns the topl level TP converter ID.
Definition: TPCnvTokenList_p1.h:35
TPCnvToken_p1
Definition: TPCnvTokenList_p1.h:24
TPCnvToken_p1::TPCnvToken_p1
TPCnvToken_p1(unsigned short cnvID=0, const std::string &token="")
Constructor.
Definition: TPCnvTokenList_p1.h:31
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:239
TPCnvTokenList_p1::findToken
const std::string & findToken(unsigned short id)
Retrieves token of the extending object given the converter ID.
Definition: TPCnvTokenList_p1.h:70
get_generator_info.error
error
Definition: get_generator_info.py:40
error
Definition: IImpactPoint3dEstimator.h:70