ATLAS Offline Software
Loading...
Searching...
No Matches
PrintHelpers.h
Go to the documentation of this file.
1// Dear emacs, this is -*- c++ -*-
2
3/*
4 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
5*/
6
7// $Id: PrintHelpers.h 646509 2015-02-12 16:43:18Z krasznaa $
8#ifndef XAODCORE_TOOLS_PRINTHELPERS_H
9#define XAODCORE_TOOLS_PRINTHELPERS_H
10
11// System include(s):
12#include <concepts>
13#include <iosfwd>
14#include <format>
15
16// Forward declaration(s):
17namespace SG {
18 class AuxElement;
19}
20
33std::ostream& operator<< ( std::ostream& out, const SG::AuxElement& obj );
34
35namespace xAOD {
36
45 void dump( const SG::AuxElement& obj );
46
47 std::string toString ( const SG::AuxElement& obj );
48
49} // namespace xAOD
50
51
52namespace std {
53
54
55// C++23 compatible formatter.
56template <std::derived_from<SG::AuxElement> T>
57struct formatter<T>
58 : public formatter<string_view>
59{
60 template <class FmtContext>
61 FmtContext::iterator format(const T& k, FmtContext& ctx) const
62 {
63 return formatter<string_view>::format( xAOD::toString( k ), ctx );
64 }
65};
66
67
68} // namespace std
69
70
71#endif // XAODCORE_TOOLS_PRINTHELPERS_H
std::ostream & operator<<(std::ostream &out, const SG::AuxElement &obj)
Operator printing the payload of an xAOD object.
Forward declaration.
AuxElement(SG::AuxVectorData *container, size_t index)
Base class for elements of a container that can have aux data.
unsigned long long T
STL namespace.
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
void dump(const SG::AuxElement &obj)
Helper function for dumping xAOD objects on the screen in PyROOT.
std::string toString(const SG::AuxElement &obj)
FmtContext::iterator format(const T &k, FmtContext &ctx) const