6#include "Identifier/Identifier.h"
7#include "GaudiKernel/MsgStream.h"
12template <
typename Stream>
19 auto [ptr, ec] = std::to_chars(buf + 2, buf +
sizeof(buf),
id, 16);
21 os << std::string_view(buf, ptr);
26 const auto start =
id.data();
27 const auto end = start +
id.size();
28 static constexpr int base = 16;
30 const auto [p,ec] = std::from_chars(start+2, end,
m_id,
base);
31 if (ec != std::errc()){
32 throw std::runtime_error(
"Number was not parsed in Identifier::set");
43 auto [ptr, ec] = std::to_chars(buf + 2, buf +
sizeof(buf),
m_id, 16);
44 return std::string(buf, ptr);
void streamIdentifier(Stream &os, unsigned long long id)
MsgStream & operator<<(MsgStream &f, const Identifier &id)
std::string getString() const
Provide a string form of the identifier - hexadecimal.
value_type m_id
The only data member.
void show(std::ostream &out) const
Print out in hex form.
void set(std::string_view id)
build from a string form - hexadecimal