2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
5 //-----------------------------------------------
6 inline ExpandedIdentifier::ExpandedIdentifier(const ExpandedIdentifier& other,
8 if (start < other.fields()) {
9 element_vector::const_iterator it = other.m_fields.begin();
11 m_fields.insert(m_fields.end(), it, other.m_fields.end());
17 ExpandedIdentifier::add(element_type value){
18 // Max size of id levels should be < 12
19 m_fields.push_back(value);
22 inline ExpandedIdentifier&
23 ExpandedIdentifier::operator<<(element_type value){
24 // Max size of id levels should be < 12
25 m_fields.push_back(value);
29 inline ExpandedIdentifier::element_type& ExpandedIdentifier::operator[](
31 // Raises an exception if index is out-of-bounds.
32 return m_fields.at(index);
36 ExpandedIdentifier::clear(){
40 inline ExpandedIdentifier::element_type ExpandedIdentifier::operator[](
41 size_type index) const{
42 // Raises an exception if index is out-of-bounds.
43 return m_fields.at(index);
46 inline ExpandedIdentifier::size_type
47 ExpandedIdentifier::fields() const{
48 return (m_fields.size());
51 // Comparison operators
53 ExpandedIdentifier::operator==(const ExpandedIdentifier& other) const{
54 if (fields() != other.fields()) return false;
55 return (m_fields == other.m_fields);
58 inline auto ExpandedIdentifier::operator <=>( const ExpandedIdentifier& other) const{
59 return std::lexicographical_compare_three_way(m_fields.begin(), m_fields.end(),
60 other.m_fields.begin(), other.m_fields.end());
65 ExpandedIdentifier::match(const ExpandedIdentifier& other) const{
66 const auto &[vsmall, vbig] = std::minmax(m_fields, other.m_fields,
67 [](const auto & a1, const auto& a2){return a1.size()<a2.size();});
68 return std::equal(vsmall.begin(), vsmall.end(), vbig.begin());