![]() |
ATLAS Offline Software
|
#include <IdDictDictionary.h>
Public Types | |
| using | value_type = Identifier::value_type |
| using | size_type = Identifier::size_type |
Public Member Functions | |
| IdDictDictionary () | |
| IdDictDictionary (const std::string &name, const std::string &version="", const std::string &date="", const std::string &author="") | |
| ~IdDictDictionary () | |
| const std::string & | name () const |
| Dictionary name. More... | |
| const std::string & | version () const |
| Dictionary version. More... | |
| size_t | n_regions () const |
| Number of contained regions. More... | |
| const IdDictRegion & | region (size_t i) const |
| Region at index i. More... | |
| const std::string & | file_name () const |
| Access to file name. More... | |
| const std::string & | dict_tag () const |
| Access to the dictionary tag. More... | |
| IdDictField * | find_field (const std::string &name) const |
| IdDictLabel * | find_label (const std::string &field, const std::string &label) const |
| int | get_label_value (const std::string &field, const std::string &label, int &value) const |
| IdDictSubRegion * | find_subregion (const std::string &subregion_name) const |
| IdDictRegion * | find_region (const std::string ®ion_name) const |
| IdDictRegion * | find_region (const std::string ®ion_name, const std::string &group_name) const |
| IdDictGroup * | find_group (const std::string &group_name) const |
| int | find_region (const ExpandedIdentifier &id, size_type &index) const |
| IdDictRegion * | find_region (const ExpandedIdentifier &id) const |
| IdDictRegion * | find_region (const ExpandedIdentifier &id, const std::string &group_name) const |
| const std::vector< IdDictRegion * > & | all_regions () |
| Non-const access to vector of all regions. More... | |
| void | add_field (IdDictField *field) |
| void | add_subregion (IdDictSubRegion *subregion) |
| void | add_dictentry (IdDictDictEntry *entry) |
| void | add_region (IdDictRegion *region) |
| void | add_subdictionary_name (const std::string &name) |
| void | set_parent_dict (IdDictDictionary *parent_dict) |
| void | set_file_name (const std::string &name) |
| Set file name. More... | |
| void | set_dict_tag (const std::string &tag) |
| Set the dictionary tag. More... | |
| void | resolve_references (const IdDictMgr &idd) |
| void | generate_implementation (const IdDictMgr &idd, const std::string &tag="") |
| void | reset_implementation () |
| bool | verify () const |
| Here, we verify global constraints : (this must only be applied after the resolve_references and generate_implementation operations) More... | |
| void | sort () |
| Sort: More... | |
| void | clear () |
| void | integrate_bits () |
| Set up integral of bits for efficient unpacking. More... | |
| MultiRange | build_multirange () const |
| Get MultiRange for full dictionary. More... | |
| MultiRange | build_multirange (const ExpandedIdentifier ®ion_id, const Range &prefix=Range(), const std::string &last_field="") const |
| Get MultiRange for a specific region_id up to and including 'last_field' If last_field == "", all fields are taken. More... | |
| MultiRange | build_multirange (const ExpandedIdentifier ®ion_id, const std::string &group_name, const Range &prefix=Range(), const std::string &last_field="") const |
| Get MultiRange for a specific region_id, constrained to be within a specific named group. More... | |
| int | pack32 (const ExpandedIdentifier &id, size_t index1, size_t index2, Identifier &packedId) const |
| Pack to 32bits the subset of id between (inclusive) index1 and index2 - this is generic, i.e. More... | |
| int | pack32 (const int *fields, size_t index1, size_t index2, size_t region_index, Identifier &packedId, size_t first_field_index=0) const |
| Pack to 32bits the subset of id between (inclusive) index1 and index2. More... | |
| int | reset (size_t index1, size_t index2, size_t region_index, Identifier &packedId) const |
| Reset fields from index1 to index2. More... | |
| int | unpack (const std::string &group, const Identifier &id, const ExpandedIdentifier &prefix, size_t index2, ExpandedIdentifier &unpackedId) const |
| Unpack the value_type id to an expanded Identifier for a given group, considering the provided prefix (result will include the prefix) and up to index2 - (index1 is assumed to be 0, i.e. More... | |
| int | unpack (const std::string &group, const Identifier &id, const ExpandedIdentifier &prefix, size_t index2, const std::string &sep, std::string &unpackedId) const |
| Unpack the value_type id to a string for a given group, considering the provided prefix (result will include the prefix) and up to index2 - (index1 is assumed to be 0, i.e. More... | |
| int | unpack (const Identifier &id, size_t first_field_index, size_t field_index, size_t region_index, int &field) const |
| Unpack a single field of the value_type id. More... | |
| int | copy (const Identifier &idin, size_t first_field_index, size_t begin_field_index, size_t end_field_index, size_t region_index, Identifier &idout) const |
| Copy a number of fields of the value_type id into another value_type id. More... | |
| bool | do_checks () const |
| Checks are performed by default in debug compilation and NOT in optimized compilation. More... | |
| void | set_do_checks (bool do_checks) |
| bool | do_neighbours () const |
| Neighbour initialization is performed by default One can switch or query this mode for any idHelper with the following methods: More... | |
| void | set_do_neighbours (bool do_neighbours) |
| void | dump () const |
| Dump regions and trees for each group. More... | |
Private Types | |
| using | entries_type = std::vector< IdDictDictEntry * > |
| using | entries_it = entries_type::iterator |
| using | entries_const_it = entries_type::const_iterator |
| using | regions_type = std::vector< IdDictRegion * > |
| using | regions_it = regions_type::iterator |
| using | regions_const_it = regions_type::const_iterator |
| using | groups_type = std::vector< IdDictGroup * > |
| using | groups_it = groups_type::iterator |
| using | groups_const_it = groups_type::const_iterator |
Private Attributes | |
| std::string | m_name {} |
| std::string | m_version {} |
| std::string | m_date {} |
| std::string | m_author {} |
| std::map< std::string, IdDictField * > | m_fields |
| std::map< std::string, IdDictSubRegion * > | m_subregions |
| std::vector< IdDictRegion * > | m_regions |
| std::vector< IdDictRegion * > | m_all_regions |
| std::vector< IdDictGroup * > | m_groups |
| std::vector< std::string > | m_subdictionary_names |
| IdDictDictionary * | m_parent_dict {nullptr} |
| std::string | m_file_name {} |
| std::string | m_dict_tag {} |
| bool | m_generated_implementation {false} |
| bool | m_do_checks {false} |
| bool | m_do_neighbours {true} |
Definition at line 30 of file IdDictDictionary.h.
|
private |
Definition at line 300 of file IdDictDictionary.h.
|
private |
Definition at line 299 of file IdDictDictionary.h.
|
private |
Definition at line 298 of file IdDictDictionary.h.
|
private |
Definition at line 308 of file IdDictDictionary.h.
|
private |
Definition at line 307 of file IdDictDictionary.h.
|
private |
Definition at line 306 of file IdDictDictionary.h.
|
private |
Definition at line 304 of file IdDictDictionary.h.
|
private |
Definition at line 303 of file IdDictDictionary.h.
|
private |
Definition at line 302 of file IdDictDictionary.h.
Definition at line 33 of file IdDictDictionary.h.
Definition at line 32 of file IdDictDictionary.h.
|
default |
|
default |
| void IdDictDictionary::add_dictentry | ( | IdDictDictEntry * | entry | ) |
Definition at line 138 of file IdDictDictionary.cxx.
| void IdDictDictionary::add_field | ( | IdDictField * | field | ) |
| void IdDictDictionary::add_region | ( | IdDictRegion * | region | ) |
Definition at line 149 of file IdDictDictionary.cxx.
| void IdDictDictionary::add_subdictionary_name | ( | const std::string & | name | ) |
Definition at line 129 of file IdDictDictionary.cxx.
| void IdDictDictionary::add_subregion | ( | IdDictSubRegion * | subregion | ) |
Definition at line 124 of file IdDictDictionary.cxx.
|
inline |
Non-const access to vector of all regions.
Definition at line 395 of file IdDictDictionary.h.
| MultiRange IdDictDictionary::build_multirange | ( | ) | const |
| MultiRange IdDictDictionary::build_multirange | ( | const ExpandedIdentifier & | region_id, |
| const Range & | prefix = Range(), |
||
| const std::string & | last_field = "" |
||
| ) | const |
Get MultiRange for a specific region_id up to and including 'last_field' If last_field == "", all fields are taken.
Prepend prefix if provided.
Definition at line 309 of file IdDictDictionary.cxx.
| MultiRange IdDictDictionary::build_multirange | ( | const ExpandedIdentifier & | region_id, |
| const std::string & | group_name, | ||
| const Range & | prefix = Range(), |
||
| const std::string & | last_field = "" |
||
| ) | const |
Get MultiRange for a specific region_id, constrained to be within a specific named group.
The depth of the multirange is up to and including 'last_field' If last_field == "", all fields are taken. Prepend prefix if provided.
Definition at line 369 of file IdDictDictionary.cxx.
| void IdDictDictionary::clear | ( | ) |
Definition at line 1049 of file IdDictDictionary.cxx.
| int IdDictDictionary::copy | ( | const Identifier & | idin, |
| size_t | first_field_index, | ||
| size_t | begin_field_index, | ||
| size_t | end_field_index, | ||
| size_t | region_index, | ||
| Identifier & | idout | ||
| ) | const |
Copy a number of fields of the value_type id into another value_type id.
Copy a number of fields of the bits32 id into another bits32 id.
One specifies the begin and end (inclusive) field indexes desired and passes in the region index to be used for decoding. The region index is obtained from find_region. The first_field_index is normally 0. It is non-zero when fields 0 to first_field_index -1 are missing from the compact
One specifies the begin and end (inclusive) field indexes desired and passes in the region index to be used for decoding. The region index is obtained from find_region. The first_field_index is normally 0. It is non-zero when fields 0 to first_field_index -1 are missing from the compact. In this case, idout is shift by the number of missing bits, if possible.
Definition at line 882 of file IdDictDictionary.cxx.
|
inline |
Access to the dictionary tag.
Definition at line 374 of file IdDictDictionary.h.
| bool IdDictDictionary::do_checks | ( | ) | const |
Checks are performed by default in debug compilation and NOT in optimized compilation.
One can switch or query this mode for any idHelper with the following methods:
Definition at line 969 of file IdDictDictionary.cxx.
| bool IdDictDictionary::do_neighbours | ( | ) | const |
Neighbour initialization is performed by default One can switch or query this mode for any idHelper with the following methods:
Definition at line 979 of file IdDictDictionary.cxx.
| void IdDictDictionary::dump | ( | ) | const |
Dump regions and trees for each group.
Definition at line 1089 of file IdDictDictionary.cxx.
|
inline |
Access to file name.
Definition at line 367 of file IdDictDictionary.h.
| IdDictField * IdDictDictionary::find_field | ( | const std::string & | name | ) | const |
Definition at line 47 of file IdDictDictionary.cxx.
| IdDictGroup * IdDictDictionary::find_group | ( | const std::string & | group_name | ) | const |
Definition at line 115 of file IdDictDictionary.cxx.
| IdDictLabel * IdDictDictionary::find_label | ( | const std::string & | field, |
| const std::string & | label | ||
| ) | const |
Definition at line 67 of file IdDictDictionary.cxx.
| IdDictRegion * IdDictDictionary::find_region | ( | const ExpandedIdentifier & | id | ) | const |
Definition at line 255 of file IdDictDictionary.cxx.
| IdDictRegion * IdDictDictionary::find_region | ( | const ExpandedIdentifier & | id, |
| const std::string & | group_name | ||
| ) | const |
Definition at line 259 of file IdDictDictionary.cxx.
| int IdDictDictionary::find_region | ( | const ExpandedIdentifier & | id, |
| size_type & | index | ||
| ) | const |
Definition at line 235 of file IdDictDictionary.cxx.
| IdDictRegion * IdDictDictionary::find_region | ( | const std::string & | region_name | ) | const |
Definition at line 101 of file IdDictDictionary.cxx.
| IdDictRegion * IdDictDictionary::find_region | ( | const std::string & | region_name, |
| const std::string & | group_name | ||
| ) | const |
Definition at line 105 of file IdDictDictionary.cxx.
| IdDictSubRegion * IdDictDictionary::find_subregion | ( | const std::string & | subregion_name | ) | const |
Definition at line 91 of file IdDictDictionary.cxx.
| void IdDictDictionary::generate_implementation | ( | const IdDictMgr & | idd, |
| const std::string & | tag = "" |
||
| ) |
Definition at line 172 of file IdDictDictionary.cxx.
| int IdDictDictionary::get_label_value | ( | const std::string & | field, |
| const std::string & | label, | ||
| int & | value | ||
| ) | const |
Definition at line 75 of file IdDictDictionary.cxx.
| void IdDictDictionary::integrate_bits | ( | ) |
Set up integral of bits for efficient unpacking.
Definition at line 281 of file IdDictDictionary.cxx.
|
inline |
Number of contained regions.
Definition at line 359 of file IdDictDictionary.h.
|
inline |
| int IdDictDictionary::pack32 | ( | const ExpandedIdentifier & | id, |
| size_t | index1, | ||
| size_t | index2, | ||
| Identifier & | packedId | ||
| ) | const |
Pack to 32bits the subset of id between (inclusive) index1 and index2 - this is generic, i.e.
not the most efficient
Assumptions:
First we need to check whether the specified identifier really matches the Dictionary specifications.
However, we stop the search in the set of regions at the first matching region. Should we request that only one region matches ????
Definition at line 444 of file IdDictDictionary.cxx.
| int IdDictDictionary::pack32 | ( | const int * | fields, |
| size_t | index1, | ||
| size_t | index2, | ||
| size_t | region_index, | ||
| Identifier & | packedId, | ||
| size_t | first_field_index = 0 |
||
| ) | const |
Pack to 32bits the subset of id between (inclusive) index1 and index2.
Here one must provide the region index, which can be found with find_region. This is more efficient than the above pack32.
Assumptions: (different than the previous pack32)
Definition at line 521 of file IdDictDictionary.cxx.
|
inline |
Region at index i.
Definition at line 350 of file IdDictDictionary.h.
| int IdDictDictionary::reset | ( | size_t | index1, |
| size_t | index2, | ||
| size_t | region_index, | ||
| Identifier & | packedId | ||
| ) | const |
| void IdDictDictionary::reset_implementation | ( | ) |
Definition at line 223 of file IdDictDictionary.cxx.
Definition at line 153 of file IdDictDictionary.cxx.
|
inline |
Set the dictionary tag.
Definition at line 388 of file IdDictDictionary.h.
| void IdDictDictionary::set_do_checks | ( | bool | do_checks | ) |
Definition at line 974 of file IdDictDictionary.cxx.
| void IdDictDictionary::set_do_neighbours | ( | bool | do_neighbours | ) |
Definition at line 984 of file IdDictDictionary.cxx.
|
inline |
Set file name.
Definition at line 381 of file IdDictDictionary.h.
| void IdDictDictionary::set_parent_dict | ( | IdDictDictionary * | parent_dict | ) |
Definition at line 133 of file IdDictDictionary.cxx.
| void IdDictDictionary::sort | ( | ) |
Sort:
Prerequisite: first verify the dictionary - no overlaps
Then loop over regions and sort according to their first identifier
Definition at line 1033 of file IdDictDictionary.cxx.
| int IdDictDictionary::unpack | ( | const Identifier & | id, |
| size_t | first_field_index, | ||
| size_t | field_index, | ||
| size_t | region_index, | ||
| int & | field | ||
| ) | const |
Unpack a single field of the value_type id.
Unpack a single field of the bits32 id.
One specifies the field index desired and passes in the region index to be used for decoding. The region index is obtained from find_region. The first_field_index is normally 0. It is non-zero when fields 0 to first_field_index -1 are missing from the compact
Definition at line 795 of file IdDictDictionary.cxx.
| int IdDictDictionary::unpack | ( | const std::string & | group, |
| const Identifier & | id, | ||
| const ExpandedIdentifier & | prefix, | ||
| size_t | index2, | ||
| const std::string & | sep, | ||
| std::string & | unpackedId | ||
| ) | const |
Unpack the value_type id to a string for a given group, considering the provided prefix (result will include the prefix) and up to index2 - (index1 is assumed to be 0, i.e.
part of prefix).
Returns 0 on success, nonzero on error.
Definition at line 685 of file IdDictDictionary.cxx.
| int IdDictDictionary::unpack | ( | const std::string & | group, |
| const Identifier & | id, | ||
| const ExpandedIdentifier & | prefix, | ||
| size_t | index2, | ||
| ExpandedIdentifier & | unpackedId | ||
| ) | const |
Unpack the value_type id to an expanded Identifier for a given group, considering the provided prefix (result will include the prefix) and up to index2 - (index1 is assumed to be 0, i.e.
part of prefix).
Returns 0 on success, nonzero on error.
Definition at line 664 of file IdDictDictionary.cxx.
| bool IdDictDictionary::verify | ( | ) | const |
Here, we verify global constraints : (this must only be applied after the resolve_references and generate_implementation operations)
a) There should be no overlap between any region duet.
b) In a dictionary, a given field (ie. with a given name) must always be referenced at the same depth across all regions and subregions.
c) When a region specifies a reference to a sub-dictionary :
d) Within a dictionary, a given field must always be described either through an enumeration, or through its bounds. However, the various usages of a given field may specify different tag set (for enumerations) or bounds (for a bounded field).
Definition at line 1012 of file IdDictDictionary.cxx.
|
inline |
Dictionary version.
Definition at line 341 of file IdDictDictionary.h.
|
private |
Definition at line 313 of file IdDictDictionary.h.
|
private |
Definition at line 296 of file IdDictDictionary.h.
|
private |
Definition at line 295 of file IdDictDictionary.h.
|
private |
Definition at line 319 of file IdDictDictionary.h.
|
private |
Definition at line 321 of file IdDictDictionary.h.
|
private |
Definition at line 322 of file IdDictDictionary.h.
|
private |
Definition at line 310 of file IdDictDictionary.h.
|
private |
Definition at line 318 of file IdDictDictionary.h.
|
private |
Definition at line 320 of file IdDictDictionary.h.
|
private |
Definition at line 314 of file IdDictDictionary.h.
|
private |
Definition at line 293 of file IdDictDictionary.h.
|
private |
Definition at line 316 of file IdDictDictionary.h.
|
private |
Definition at line 312 of file IdDictDictionary.h.
|
private |
Definition at line 315 of file IdDictDictionary.h.
|
private |
Definition at line 311 of file IdDictDictionary.h.
|
private |
Definition at line 294 of file IdDictDictionary.h.
1.8.18