ATLAS Offline Software
Loading...
Searching...
No Matches
TrigHolderStructure.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
6
9
15
17 if( sti == HLT::invalid_sub_index){
18 ATH_MSG_DEBUG("requested holder with invalid sub_type_index");
19 return 0;
20 }
21 auto allsti_it = m_holderByClidAndIndex.find(clid);
22 if(allsti_it == m_holderByClidAndIndex.end()){
23 return 0;
24 }
25 auto sti_holder_map = allsti_it->second;
26 auto holder_it = sti_holder_map.find(sti);
27 if(holder_it == sti_holder_map.end()){
28 return 0;
29 }
30 return holder_it->second.get();
31}
32
33
34bool HLT::TrigHolderStructure::registerHolder(const std::shared_ptr<BaseHolder>& holder){
35 auto clid = holder->typeClid();
36 auto subtypeindex = holder->subTypeIndex();
37 const auto & label = holder->label();
38
39 if(getHolder(clid,subtypeindex)){
40 ATH_MSG_WARNING("we already have a holder like this! clid:" << clid << " subtypeIndex: " << subtypeindex << " label: " << label);
41 return false;
42 }
43
44 m_holderByClidAndIndex[clid][subtypeindex] = holder;
45 m_lookupLabels[clid][subtypeindex] = label;
46 m_lookupSubIndex[clid][label] = subtypeindex;
47
48 return true;
49}
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
BaseHolder * getBaseHolder(class_id_type clid, sub_index_type sti) const
std::map< class_id_type, SubIndexToLabelMap > m_lookupLabels
HolderType * getHolder(class_id_type clid, const std::variant< sub_index_type, std::string > &stiOrLabel) const
std::map< class_id_type, LabelToSubIndexMap > m_lookupSubIndex
bool registerHolder(const std::shared_ptr< BaseHolder > &holder)
std::map< class_id_type, IndexToHolderMap > m_holderByClidAndIndex
AsgMessaging(const std::string &name)
Constructor with a name.
std::string label(const std::string &format, int i)
Definition label.h:19
static const index_type invalid_sub_index