ATLAS Offline Software
Loading...
Searching...
No Matches
IdDictField.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 IDDICT_IdDictField_H
6#define IDDICT_IdDictField_H
7
9#include <string>
10#include <vector>
11#include <memory>
12
13class IdDictLabel;
14class IdDictMgr;
15
17public:
18 // ==================================
19 //** @name Constructor/destructor
20 // @{
21
22 IdDictField (const std::string& name);
26
27 IdDictField (const IdDictField&) = delete;
29
30
31 // @}
32 // ==================================
33 //** @name Simple accessors.
34 // @{
35
36 const std::string& name() const;
37 size_t index() const;
38 size_t get_label_number () const;
39 const IdDictLabel* find_label (const std::string& name) const;
40 const IdDictLabel& label (size_t index) const;
41 const std::string& get_label (size_t index) const;
42 ExpandedIdentifier::element_type get_label_value (const std::string& name) const;
43
44
46 // ==================================
47 //** @name Methods used to initialize the object.
48 // @{
49
50 void add_label (std::unique_ptr<const IdDictLabel> label);
51 void set_index (size_t index);
52 bool verify () const;
53 void clear ();
54
55
57
58
59private:
60 std::string m_name;
61 std::vector <std::unique_ptr<const IdDictLabel> > m_labels;
62 size_t m_index{};
63};
64
65
66inline
67const std::string& IdDictField::name() const
68{
69 return m_name;
70}
71
72
73inline
74size_t IdDictField::index() const
75{
76 return m_index;
77}
78
79
80inline
82{
83 return *m_labels.at(index);
84}
85
86
87#endif
size_t get_label_number() const
IdDictField(IdDictField &&)
const std::string & get_label(size_t index) const
std::string m_name
Definition IdDictField.h:60
const IdDictLabel & label(size_t index) const
Definition IdDictField.h:81
void set_index(size_t index)
bool verify() const
IdDictField & operator=(IdDictField &&)
ExpandedIdentifier::element_type get_label_value(const std::string &name) const
const std::string & name() const
Definition IdDictField.h:67
IdDictField(const IdDictField &)=delete
std::vector< std::unique_ptr< const IdDictLabel > > m_labels
Definition IdDictField.h:61
IdDictField(const std::string &name)
size_t m_index
Definition IdDictField.h:62
const IdDictLabel * find_label(const std::string &name) const
size_t index() const
Definition IdDictField.h:74
void add_label(std::unique_ptr< const IdDictLabel > label)
Definition index.py:1