ATLAS Offline Software
Loading...
Searching...
No Matches
Identifier.cxx File Reference
#include "Identifier/Identifier.h"
#include "GaudiKernel/MsgStream.h"
#include <charconv>
#include <iostream>
Include dependency graph for Identifier.cxx:

Go to the source code of this file.

Functions

template<typename Stream>
void streamIdentifier (Stream &os, unsigned long long id)
MsgStream & operator<< (MsgStream &f, const Identifier &id)
std::ostream & operator<< (std::ostream &os, const Identifier &id)

Function Documentation

◆ operator<<() [1/2]

MsgStream & operator<< ( MsgStream & f,
const Identifier & id )

Definition at line 55 of file Identifier.cxx.

55 {
56 streamIdentifier(f, id.get_compact());
57 return f;
58}
void streamIdentifier(Stream &os, unsigned long long id)

◆ operator<<() [2/2]

std::ostream & operator<< ( std::ostream & os,
const Identifier & id )

Definition at line 60 of file Identifier.cxx.

60 {
61 streamIdentifier(os, id.get_compact());
62 return os;
63}

◆ streamIdentifier()

template<typename Stream>
void streamIdentifier ( Stream & os,
unsigned long long id )

Definition at line 13 of file Identifier.cxx.

13 {
14 //This is faster than std::format and uses no allocations.
15 //Please don't switch to std::format without performance checks
16 char buf[32];
17 buf[0] = '0';
18 buf[1] = 'x';
19 auto [ptr, ec] = std::to_chars(buf + 2, buf + sizeof(buf), id, 16);
20
21 os << std::string_view(buf, ptr);
22}
void * ptr(T *p)
Definition SGImplSvc.cxx:74