ATLAS Offline Software
Loading...
Searching...
No Matches
IdDictFieldImplementation.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4
10
12#include "GaudiKernel/MsgStream.h"
13#include <iostream>
14#include <format>
15#include <string>
16#include <string_view>
17
18
19const IdDictRange*
21
22void
26
27void
29 std::cout << show_to_string() << std::endl;
30}
31
33 // Build the indexes list once
34 const auto& idx = m_ored_field.get_indexes();
35 std::string indexes;
36 indexes.reserve(idx.size() * 3);
37 for (std::size_t i = 0; i < idx.size(); ++i) {
38 if (i) indexes.push_back(' ');
39 indexes += std::to_string(idx[i]);
40 }
41 // Mode string
42 std::string_view mode =
43 m_ored_field.isBounded() ? "both_bounded"
44 : m_ored_field.isEnumerated() ? "enumerated"
45 : "unknown";
46 try{
47 return std::format(
48 "decode {:d} vals {:<15} "
49 "mask/zero mask/shift/bits/offset {:<3x} {:<3x} {:<3} {:<3} {:<3} "
50 "indexes {:<20} mode {} ",
52 static_cast<std::string>(m_ored_field),
53 m_mask,
55 m_shift,
56 m_bits,
58 indexes,
59 mode);
60 } catch (std::format_error & ){
61 return {};
62 }
63}
64
66std::ostream & operator<<(std::ostream & os, const IdDictFieldImplementation &idfi){
67 os<<idfi.show_to_string();
68 return os;
69}
70
72MsgStream & operator<<(MsgStream & ms, const IdDictFieldImplementation &idfi){
73 ms<<idfi.show_to_string();
74 return ms;
75}
76
77
std::ostream & operator<<(std::ostream &os, const IdDictFieldImplementation &idfi)
stream insertion operator uses show_to_string
IdDictFieldImplementation is used to capture the specification of a single field of an Identifier.
const IdDictRange * range() const
Accessors.
void set_range(const IdDictRange *range)
Modifiers.
std::string show_to_string(void) const