![]() |
ATLAS Offline Software
|
#include <IdDictDefs.h>
Public Types | |
typedef Identifier::value_type | value_type |
typedef Identifier::size_type | size_type |
typedef std::vector< IdDictDictEntry * > | entries_type |
typedef entries_type::iterator | entries_it |
typedef entries_type::const_iterator | entries_const_it |
typedef std::vector< IdDictRegion * > | regions_type |
typedef regions_type::iterator | regions_it |
typedef regions_type::const_iterator | regions_const_it |
typedef std::vector< IdDictGroup * > | groups_type |
typedef groups_type::iterator | groups_it |
typedef groups_type::const_iterator | groups_const_it |
Public Member Functions | |
IdDictDictionary () | |
~IdDictDictionary () | |
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 |
void | add_field (IdDictField *field) |
void | add_subregion (IdDictSubRegion *subregion) |
void | add_dictentry (IdDictDictEntry *entry) |
void | add_subdictionary_name (const std::string &name) |
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 () |
int | find_region (const ExpandedIdentifier &id, size_type &index) const |
Find first region that matches id. More... | |
IdDictRegion * | find_region (const ExpandedIdentifier &id) const |
IdDictRegion * | find_region (const ExpandedIdentifier &id, const std::string &group_name) const |
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 Identifier &id, const ExpandedIdentifier &prefix, size_t index2, ExpandedIdentifier &unpackedId) const |
Unpack the value_type id to an expanded Identifier, 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, const ExpandedIdentifier &prefix, size_t index2, const std::string &sep, std::string &unpackedId) const |
Unpack the value_type id to a string, 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 (void) 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 (void) 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) |
std::string | file_name (void) const |
Access to file name. More... | |
std::string | dict_tag (void) const |
Access to the dictionary tag. More... | |
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... | |
Public 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 |
Private Attributes | |
std::string | m_file_name |
std::string | m_dict_tag |
bool | m_generated_implementation |
bool | m_do_checks |
bool | m_do_neighbours |
Definition at line 96 of file IdDictDefs.h.
typedef entries_type::const_iterator IdDictDictionary::entries_const_it |
Definition at line 290 of file IdDictDefs.h.
typedef entries_type::iterator IdDictDictionary::entries_it |
Definition at line 289 of file IdDictDefs.h.
typedef std::vector<IdDictDictEntry*> IdDictDictionary::entries_type |
Definition at line 288 of file IdDictDefs.h.
typedef groups_type::const_iterator IdDictDictionary::groups_const_it |
Definition at line 298 of file IdDictDefs.h.
typedef groups_type::iterator IdDictDictionary::groups_it |
Definition at line 297 of file IdDictDefs.h.
typedef std::vector<IdDictGroup*> IdDictDictionary::groups_type |
Definition at line 296 of file IdDictDefs.h.
typedef regions_type::const_iterator IdDictDictionary::regions_const_it |
Definition at line 294 of file IdDictDefs.h.
typedef regions_type::iterator IdDictDictionary::regions_it |
Definition at line 293 of file IdDictDefs.h.
typedef std::vector<IdDictRegion*> IdDictDictionary::regions_type |
Definition at line 292 of file IdDictDefs.h.
Definition at line 100 of file IdDictDefs.h.
Definition at line 99 of file IdDictDefs.h.
IdDictDictionary::IdDictDictionary | ( | ) |
Definition at line 296 of file IdDictMgr.cxx.
IdDictDictionary::~IdDictDictionary | ( | ) |
Definition at line 305 of file IdDictMgr.cxx.
void IdDictDictionary::add_dictentry | ( | IdDictDictEntry * | entry | ) |
Definition at line 410 of file IdDictMgr.cxx.
void IdDictDictionary::add_field | ( | IdDictField * | field | ) |
void IdDictDictionary::add_subdictionary_name | ( | const std::string & | name | ) |
Definition at line 403 of file IdDictMgr.cxx.
void IdDictDictionary::add_subregion | ( | IdDictSubRegion * | subregion | ) |
Definition at line 394 of file IdDictMgr.cxx.
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 1086 of file IdDictMgr.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 1152 of file IdDictMgr.cxx.
void IdDictDictionary::clear | ( | ) |
Definition at line 1006 of file IdDictMgr.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 1998 of file IdDictMgr.cxx.
|
inline |
Access to the dictionary tag.
Definition at line 700 of file IdDictDefs.h.
bool IdDictDictionary::do_checks | ( | void | ) | 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 2096 of file IdDictMgr.cxx.
bool IdDictDictionary::do_neighbours | ( | void | ) | const |
Neighbour initialization is performed by default One can switch or query this mode for any idHelper with the following methods:
Definition at line 2108 of file IdDictMgr.cxx.
|
inline |
Access to file name.
Definition at line 692 of file IdDictDefs.h.
IdDictField * IdDictDictionary::find_field | ( | const std::string & | name | ) | const |
Definition at line 309 of file IdDictMgr.cxx.
IdDictGroup * IdDictDictionary::find_group | ( | const std::string & | group_name | ) | const |
Definition at line 383 of file IdDictMgr.cxx.
IdDictLabel * IdDictDictionary::find_label | ( | const std::string & | field, |
const std::string & | label | ||
) | const |
Definition at line 331 of file IdDictMgr.cxx.
IdDictRegion * IdDictDictionary::find_region | ( | const ExpandedIdentifier & | id | ) | const |
Definition at line 886 of file IdDictMgr.cxx.
IdDictRegion * IdDictDictionary::find_region | ( | const ExpandedIdentifier & | id, |
const std::string & | group_name | ||
) | const |
Definition at line 891 of file IdDictMgr.cxx.
int IdDictDictionary::find_region | ( | const ExpandedIdentifier & | id, |
size_type & | index | ||
) | const |
IdDictRegion * IdDictDictionary::find_region | ( | const std::string & | region_name | ) | const |
Definition at line 366 of file IdDictMgr.cxx.
IdDictRegion * IdDictDictionary::find_region | ( | const std::string & | region_name, |
const std::string & | group_name | ||
) | const |
Definition at line 371 of file IdDictMgr.cxx.
IdDictSubRegion * IdDictDictionary::find_subregion | ( | const std::string & | subregion_name | ) | const |
Definition at line 355 of file IdDictMgr.cxx.
void IdDictDictionary::generate_implementation | ( | const IdDictMgr & | idd, |
const std::string & | tag = "" |
||
) |
Definition at line 787 of file IdDictMgr.cxx.
int IdDictDictionary::get_label_value | ( | const std::string & | field, |
const std::string & | label, | ||
int & | value | ||
) | const |
Definition at line 338 of file IdDictMgr.cxx.
void IdDictDictionary::integrate_bits | ( | ) |
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 1234 of file IdDictMgr.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 1334 of file IdDictMgr.cxx.
int IdDictDictionary::reset | ( | size_t | index1, |
size_t | index2, | ||
size_t | region_index, | ||
Identifier & | packedId | ||
) | const |
void IdDictDictionary::reset_implementation | ( | ) |
Definition at line 850 of file IdDictMgr.cxx.
Definition at line 421 of file IdDictMgr.cxx.
|
inline |
Set the dictionary tag.
Definition at line 716 of file IdDictDefs.h.
void IdDictDictionary::set_do_checks | ( | bool | do_checks | ) |
Definition at line 2102 of file IdDictMgr.cxx.
void IdDictDictionary::set_do_neighbours | ( | bool | do_neighbours | ) |
Definition at line 2114 of file IdDictMgr.cxx.
|
inline |
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 986 of file IdDictMgr.cxx.
int IdDictDictionary::unpack | ( | 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, considering the provided prefix (result will include the prefix) and up to index2 - (index1 is assumed to be 0, i.e.
Unpack the bits32 id to a string, considering the provided prefix (result will include the prefix) and up to index2 - (index1 is assumed to be 0, i.e.
part of prefix).
First we need to check whether the specified identifier prefix really matches the Dictionary specifications.
ok we require that the region is at least as large as the prefix.
We have one region that matches the prefix. Let's now try to expand the bits32 from the fields of the region that are beyond the prefix.
this index extracted from the bits32 does not seem to match this field in the region... Let's try another region
this index extracted from the bits32 does not match this field in the region... Let's try another region
Definition at line 1671 of file IdDictMgr.cxx.
int IdDictDictionary::unpack | ( | const Identifier & | id, |
const ExpandedIdentifier & | prefix, | ||
size_t | index2, | ||
ExpandedIdentifier & | unpackedId | ||
) | const |
Unpack the value_type id to an expanded Identifier, considering the provided prefix (result will include the prefix) and up to index2 - (index1 is assumed to be 0, i.e.
Unpack the bits32 id to an expanded Identifier, considering the
provided prefix (result will include the prefix)
part of prefix).
First we need to check whether the specified identifier prefix really matches the Dictionary specifications.
ok we require that the region is at least as large as the prefix.
We have one region that matches the prefix. Let's now try to expand the bits32 from the fields of the region that are beyond the prefix.
this index extracted from the bits32 does not seem to match this field in the region... Let's try another region
this index extracted from the bits32 does not match this field in the region... Let's try another region
Definition at line 1510 of file IdDictMgr.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 1907 of file IdDictMgr.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 962 of file IdDictMgr.cxx.
std::vector<IdDictRegion*> IdDictDictionary::m_all_regions |
Definition at line 303 of file IdDictDefs.h.
std::string IdDictDictionary::m_author |
Definition at line 286 of file IdDictDefs.h.
std::string IdDictDictionary::m_date |
Definition at line 285 of file IdDictDefs.h.
|
private |
Definition at line 310 of file IdDictDefs.h.
|
private |
Definition at line 313 of file IdDictDefs.h.
|
private |
Definition at line 314 of file IdDictDefs.h.
std::map<std::string, IdDictField*> IdDictDictionary::m_fields |
Definition at line 300 of file IdDictDefs.h.
|
private |
Definition at line 309 of file IdDictDefs.h.
|
private |
Definition at line 312 of file IdDictDefs.h.
std::vector<IdDictGroup*> IdDictDictionary::m_groups |
Definition at line 304 of file IdDictDefs.h.
std::string IdDictDictionary::m_name |
Definition at line 283 of file IdDictDefs.h.
IdDictDictionary* IdDictDictionary::m_parent_dict |
Definition at line 306 of file IdDictDefs.h.
std::vector<IdDictRegion*> IdDictDictionary::m_regions |
Definition at line 302 of file IdDictDefs.h.
std::vector<std::string> IdDictDictionary::m_subdictionary_names |
Definition at line 305 of file IdDictDefs.h.
std::map<std::string, IdDictSubRegion*> IdDictDictionary::m_subregions |
Definition at line 301 of file IdDictDefs.h.
std::string IdDictDictionary::m_version |
Definition at line 284 of file IdDictDefs.h.