ATLAS Offline Software
Public Member Functions | Private Types | Private Attributes | List of all members
IdDictAltRegions Class Reference

#include <IdDictAltRegions.h>

Inheritance diagram for IdDictAltRegions:
Collaboration diagram for IdDictAltRegions:

Public Member Functions

 IdDictAltRegions ()
 
virtual ~IdDictAltRegions ()
 
virtual std::string group_name () const override
 Group name for this region. More...
 
IdDictRegionselected_region ()
 Currently selected region. More...
 
void add_region (std::unique_ptr< IdDictRegion > region)
 Add a new region, with key given by the tag. More...
 
void select_region (const std::string &name)
 Select the named region. More...
 
virtual void set_index (size_t index) override
 
virtual Range build_range () const override
 
virtual void resolve_references (IdDictMgr &idd, IdDictDictionary &dictionary) override
 
virtual void generate_implementation (const IdDictMgr &idd, IdDictDictionary &dictionary, const std::string &tag="") override
 
virtual void reset_implementation () override
 
virtual bool verify () const override
 
virtual void clear () override
 

Private Types

using map_type = std::map< std::string, std::unique_ptr< IdDictRegion > >
 
using map_iterator = map_type::iterator
 
using value_type = map_type::value_type
 

Private Attributes

map_type m_regions
 
IdDictRegionm_selected_region {}
 

Detailed Description

Definition at line 21 of file IdDictAltRegions.h.

Member Typedef Documentation

◆ map_iterator

using IdDictAltRegions::map_iterator = map_type::iterator
private

Definition at line 72 of file IdDictAltRegions.h.

◆ map_type

using IdDictAltRegions::map_type = std::map<std::string, std::unique_ptr<IdDictRegion> >
private

Definition at line 71 of file IdDictAltRegions.h.

◆ value_type

using IdDictAltRegions::value_type = map_type::value_type
private

Definition at line 73 of file IdDictAltRegions.h.

Constructor & Destructor Documentation

◆ IdDictAltRegions()

IdDictAltRegions::IdDictAltRegions ( )

Definition at line 15 of file IdDictAltRegions.cxx.

16  :
18 }

◆ ~IdDictAltRegions()

IdDictAltRegions::~IdDictAltRegions ( )
virtualdefault

Member Function Documentation

◆ add_region()

void IdDictAltRegions::add_region ( std::unique_ptr< IdDictRegion region)

Add a new region, with key given by the tag.

Definition at line 91 of file IdDictAltRegions.cxx.

92 {
93  m_regions[region->tag()] = std::move(region);
94 }

◆ build_range()

Range IdDictAltRegions::build_range ( ) const
overridevirtual

Implements IdDictDictEntry.

Definition at line 82 of file IdDictAltRegions.cxx.

82  {
83  Range result;
84 
86  return(result);
87 }

◆ clear()

void IdDictAltRegions::clear ( )
overridevirtual

Implements IdDictDictEntry.

Definition at line 77 of file IdDictAltRegions.cxx.

77  {
78  m_regions.clear();
79 }

◆ generate_implementation()

void IdDictAltRegions::generate_implementation ( const IdDictMgr idd,
IdDictDictionary dictionary,
const std::string &  tag = "" 
)
overridevirtual

Implements IdDictDictEntry.

Definition at line 47 of file IdDictAltRegions.cxx.

49  {
50  // Find the region given by the tag
51  map_iterator region_it = m_regions.find(tag);
52 
53  if (region_it == m_regions.end()) {
54  std::cout << "IdDictAltRegions::generate_implementation could not find region for tag "
55  << tag << " Keys in map " << std::endl;
56  for (int i = 0; const auto& p : m_regions) {
57  std::cout << " i " << i++ << " key " << p.first;
58  }
59  std::cout << std::endl;
60  return;
61  }
62  m_selected_region = region_it->second.get();
64 }

◆ group_name()

std::string IdDictAltRegions::group_name ( ) const
overridevirtual

Group name for this region.

Implements IdDictDictEntry.

Definition at line 23 of file IdDictAltRegions.cxx.

23  {
24  std::string result;
25  if (!m_regions.empty()) result = m_regions.begin()->second->group_name();
26  return(result);
27 }

◆ reset_implementation()

void IdDictAltRegions::reset_implementation ( )
overridevirtual

Implements IdDictDictEntry.

Definition at line 67 of file IdDictAltRegions.cxx.

◆ resolve_references()

void IdDictAltRegions::resolve_references ( IdDictMgr idd,
IdDictDictionary dictionary 
)
overridevirtual

Implements IdDictDictEntry.

Definition at line 37 of file IdDictAltRegions.cxx.

38  {
39  // We assume that it is not necessary to select only those with
40  // the correct tag -> send to all in map
41  for (auto& p : m_regions) {
42  p.second->resolve_references(idd, dictionary);
43  }
44 }

◆ select_region()

void IdDictAltRegions::select_region ( const std::string &  name)

Select the named region.

Definition at line 98 of file IdDictAltRegions.cxx.

99 {
100  map_iterator region_it = m_regions.find (name);
101  if (region_it == m_regions.end()){
102  std::cout << "IdDictAltRegion::select_region could not find region \""
103  << name << "\". Keys in map " << std::endl;
104  for (const auto& p : m_regions) {
105  std::cout << " key " << p.first;
106  }
107  std::cout << std::endl;
108  } else {
109  m_selected_region = region_it->second.get();
110  }
111 }

◆ selected_region()

IdDictRegion * IdDictAltRegions::selected_region ( )
inline

Currently selected region.

Definition at line 82 of file IdDictAltRegions.h.

83 {
84  return m_selected_region;
85 }

◆ set_index()

void IdDictAltRegions::set_index ( size_t  index)
overridevirtual

Implements IdDictDictEntry.

Definition at line 30 of file IdDictAltRegions.cxx.

30  {
31  for (auto& p : m_regions) {
32  p.second->set_index(index);
33  }
34 }

◆ verify()

bool IdDictAltRegions::verify ( ) const
overridevirtual

Implements IdDictDictEntry.

Definition at line 72 of file IdDictAltRegions.cxx.

72  {
73  return(true);
74 }

Member Data Documentation

◆ m_regions

map_type IdDictAltRegions::m_regions
private

Definition at line 75 of file IdDictAltRegions.h.

◆ m_selected_region

IdDictRegion* IdDictAltRegions::m_selected_region {}
private

Definition at line 76 of file IdDictAltRegions.h.


The documentation for this class was generated from the following files:
IdDictRegion::build_range
virtual Range build_range() const override
Definition: IdDictRegion.cxx:257
IdDictRegion::reset_implementation
virtual void reset_implementation() override
Definition: IdDictRegion.cxx:200
get_generator_info.result
result
Definition: get_generator_info.py:21
index
Definition: index.py:1
IdDictAltRegions::m_selected_region
IdDictRegion * m_selected_region
Definition: IdDictAltRegions.h:76
IdDictRegion::tag
const std::string & tag() const
Definition: IdDictRegion.h:168
IdDictAltRegions::map_iterator
map_type::iterator map_iterator
Definition: IdDictAltRegions.h:72
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:209
lumiFormat.i
int i
Definition: lumiFormat.py:85
IdDictRegion::generate_implementation
virtual void generate_implementation(const IdDictMgr &idd, IdDictDictionary &dictionary, const std::string &tag="") override
Definition: IdDictRegion.cxx:138
master.dictionary
dictionary
Definition: master.py:47
IdDictAltRegions::m_regions
map_type m_regions
Definition: IdDictAltRegions.h:75
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
Range
A Range describes the possible ranges for the field values of an ExpandedIdentifier.
Definition: DetectorDescription/Identifier/Identifier/Range.h:29
CaloCondBlobAlgs_fillNoiseFromASCII.tag
string tag
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:23