ATLAS Offline Software
ShowRequest.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef MUONCABLINGTOOLS_PRINTREQ_H
6 #define MUONCABLINGTOOLS_PRINTREQ_H
7 
8 #include "GaudiKernel/MsgStream.h"
9 #include <iostream>
10 #include <sstream>
11 
12 template <class Type> class ShowRequest {
13 public:
14  const Type* m_object;
15  bool m_detail;
16 
17 public:
18  ShowRequest(const Type&, bool);
19  ShowRequest(const Type*, bool);
21 };
22 
23 template <class Type> ShowRequest<Type>::ShowRequest(const Type& obj, bool detail) : m_object(&obj), m_detail(detail) {}
24 
25 template <class Type> ShowRequest<Type>::ShowRequest(const Type* obj, bool detail) : m_object(obj), m_detail(detail) {}
26 
27 template <class Type> std::ostream& operator<<(std::ostream& stream, const ShowRequest<Type>& print) {
28  std::ostringstream display;
29  print.m_object->Print(display, print.m_detail);
30  stream << display.str();
31  return stream;
32 }
33 
34 template <class Type> MsgStream& operator<<(MsgStream& stream, const ShowRequest<Type>& print) {
35  std::ostringstream display;
36  print.m_object->Print(display, print.m_detail);
37  stream << display.str();
38  return stream;
39 }
40 
41 #endif
ShowRequest::~ShowRequest
~ShowRequest()
Definition: ShowRequest.h:20
ShowRequest::m_object
const Type * m_object
Definition: ShowRequest.h:14
detail
Definition: extract_histogram_tag.cxx:14
AthenaPoolTestWrite.stream
string stream
Definition: AthenaPoolTestWrite.py:12
ShowRequest::ShowRequest
ShowRequest(const Type &, bool)
Definition: ShowRequest.h:23
operator<<
std::ostream & operator<<(std::ostream &stream, const ShowRequest< Type > &print)
Definition: ShowRequest.h:27
xAODType
Definition: ObjectType.h:13
pyroot.display
display
Definition: pyroot.py:44
ShowRequest
Definition: ShowRequest.h:12
Muon::print
std::string print(const MuPatSegment &)
Definition: MuonTrackSteering.cxx:28
ShowRequest::m_detail
bool m_detail
Definition: ShowRequest.h:15
python.PyAthena.obj
obj
Definition: PyAthena.py:135