ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigConfiguration
TrigConfBase
TrigConfBase
Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#ifndef TRIGCONFBASE_MSGSTREAM_H
6
#define TRIGCONFBASE_MSGSTREAM_H 1
12
13
#include <sstream>
14
15
class
IMessageSvc;
16
17
namespace
TrigConf
{
18
20
namespace
MSGTC
{
21
enum
Level
{
22
NIL
= 0,
23
VERBOSE
,
24
DEBUG
,
25
INFO
,
26
WARNING
,
27
ERROR
,
28
FATAL
,
29
ALWAYS
,
30
NUM_LEVELS
31
};
32
}
33
48
class
MsgStreamTC
:
public
std::ostringstream {
49
public
:
50
MsgStreamTC
(
const
std::string&
name
);
51
53
MSGTC::Level
level
() {
return
m_level
;}
54
56
void
setLevel
(
MSGTC::Level
lvl);
57
58
// set width for printing the name
59
void
setWidth
(
unsigned
int
width
) {
60
m_width
=
width
;
61
}
62
64
MsgStreamTC
&
operator<<
(
MSGTC::Level
lvl) {
65
lvl = (lvl >=
MSGTC::NUM_LEVELS
) ?
MSGTC::ALWAYS
: (lvl<
MSGTC::NIL
) ?
MSGTC::NIL
: lvl;
66
m_active
= ((
m_msgLevel
=lvl) >=
m_level
);
// active if message level >= stream level
67
return
*
this
;
68
}
69
71
template
<
typename
T>
72
MsgStreamTC
&
operator<<
(
const
T& t) {
73
if
(
m_active
) *
static_cast<
std::ostringstream*
>
(
this
) << t;
74
return
*
this
;
75
}
76
78
MsgStreamTC
&
operator<<
(std::ios& (*f)(std::ios&)) {
79
if
(
m_active
) f(*
this
);
80
return
*
this
;
81
}
82
84
MsgStreamTC
&
operator<<
( std::ostream& (*f)(std::ostream&)) {
85
if
(
m_active
) f(*
this
);
86
return
*
this
;
87
}
88
90
MsgStreamTC
&
operator<<
(
MsgStreamTC
& (*f)(
MsgStreamTC
&)) {
91
if
(
m_active
) f(*
this
);
92
return
*
this
;
93
}
94
96
void
doOutput
();
97
99
bool
isActive
() {
return
m_active
; }
100
102
void
setName
(
const
std::string &
name
) {
m_name
=
name
; }
103
104
private
:
105
bool
m_active
;
106
MSGTC::Level
m_level
;
107
MSGTC::Level
m_msgLevel
;
108
std::string
m_name
;
109
unsigned
int
m_width
{ 30 };
110
};
111
113
inline
MsgStreamTC
&
endmsgtc
(
MsgStreamTC
& s) {
114
if
(s.isActive()) s.doOutput();
115
return
s;
116
}
117
118
}
// namespace TrigConf
119
120
#endif
width
const double width
Definition
TTileTripReader.cxx:24
TrigConf::MsgStreamTC
MsgStreamTC class to be used in TrigConf equivalent to Gaudi's MsgStream.
Definition
Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:48
TrigConf::MsgStreamTC::isActive
bool isActive()
Is the stream active?
Definition
Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:99
TrigConf::MsgStreamTC::m_level
MSGTC::Level m_level
stream level
Definition
Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:106
TrigConf::MsgStreamTC::m_name
std::string m_name
stream name
Definition
Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:108
TrigConf::MsgStreamTC::m_msgLevel
MSGTC::Level m_msgLevel
current message level
Definition
Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:107
TrigConf::MsgStreamTC::setLevel
void setLevel(MSGTC::Level lvl)
Set message level of stream.
Definition
Trigger/TrigConfiguration/TrigConfBase/Root/MsgStream.cxx:52
TrigConf::MsgStreamTC::m_width
unsigned int m_width
width for printing owner name
Definition
Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:109
TrigConf::MsgStreamTC::operator<<
MsgStreamTC & operator<<(MSGTC::Level lvl)
Output operator for message levels.
Definition
Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:64
TrigConf::MsgStreamTC::MsgStreamTC
MsgStreamTC(const std::string &name)
Definition
Trigger/TrigConfiguration/TrigConfBase/Root/MsgStream.cxx:41
TrigConf::MsgStreamTC::setName
void setName(const std::string &name)
set the name if you want to change the message stream name
Definition
Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:102
TrigConf::MsgStreamTC::level
MSGTC::Level level()
Return message level of stream.
Definition
Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:53
TrigConf::MsgStreamTC::doOutput
void doOutput()
Print the current message buffer.
Definition
Trigger/TrigConfiguration/TrigConfBase/Root/MsgStream.cxx:60
TrigConf::MsgStreamTC::setWidth
void setWidth(unsigned int width)
Definition
Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:59
TrigConf::MsgStreamTC::m_active
bool m_active
stream active?
Definition
Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:105
TrigConf::MSGTC
Messsage levels matching the Gaudi definition.
Definition
Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:20
TrigConf::MSGTC::Level
Level
Definition
Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:21
TrigConf::MSGTC::DEBUG
@ DEBUG
Definition
Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:24
TrigConf::MSGTC::ERROR
@ ERROR
Definition
Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:27
TrigConf::MSGTC::VERBOSE
@ VERBOSE
Definition
Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:23
TrigConf::MSGTC::NUM_LEVELS
@ NUM_LEVELS
Definition
Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:30
TrigConf::MSGTC::FATAL
@ FATAL
Definition
Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:28
TrigConf::MSGTC::NIL
@ NIL
Definition
Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:22
TrigConf::MSGTC::WARNING
@ WARNING
Definition
Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:26
TrigConf::MSGTC::INFO
@ INFO
Definition
Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:25
TrigConf::MSGTC::ALWAYS
@ ALWAYS
Definition
Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:29
TrigConf
Forward iterator to traverse the main components of the trigger configuration.
Definition
Config.h:22
TrigConf::endmsgtc
MsgStreamTC & endmsgtc(MsgStreamTC &s)
End of message.
Definition
Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:113
TrigConf::name
Definition
HLTChainList.h:35
Generated on
for ATLAS Offline Software by
1.17.0