ATLAS Offline Software
Loading...
Searching...
No Matches
TrigConfMessaging.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_TRIGCONFMESSAGING_H
6#define TRIGCONFBASE_TRIGCONFMESSAGING_H 1
7
14
15#include <string>
16#include <boost/thread/tss.hpp>
19
20namespace TrigConf {
21
29 public:
30
34 TrigConfMessaging (const std::string& name) :
36 {}
37
39 virtual ~TrigConfMessaging() = default;
40
46 bool msgLvl (const MSGTC::Level lvl) const;
47
52 MsgStreamTC& msg() const;
53
58 MsgStreamTC& msg (const MSGTC::Level lvl) const;
59
63 const std::string& getName() const;
64
65 private:
67 TrigConfMessaging( const TrigConfMessaging& rhs ) = delete;
69
71 mutable boost::thread_specific_ptr<MsgStreamTC> m_msg_tls;
72 std::string m_name;
73 };
74
75 inline bool TrigConfMessaging::msgLvl (const MSGTC::Level lvl) const
76 {
77 if (msg().level() <= lvl) {
78 msg() << lvl;
79 return true;
80 }
81 else {
82 return false;
83 }
84 }
85
87 {
88 MsgStreamTC* ms = m_msg_tls.get();
89 if (!ms) {
90 ms = new MsgStreamTC(m_name);
91 m_msg_tls.reset(ms);
92 }
93 return *ms;
94 }
95
97 {
98 return msg() << lvl;
99 }
100
101 inline const std::string& TrigConfMessaging::getName() const {
102 return m_name;
103 }
104} // namespace TrigConf
105
106#endif
MsgStream for TrigConf classes.
MsgStreamTC class to be used in TrigConf equivalent to Gaudi's MsgStream.
virtual ~TrigConfMessaging()=default
Destructor.
TrigConfMessaging & operator=(const TrigConfMessaging &rhs)=delete
bool msgLvl(const MSGTC::Level lvl) const
Test the output level.
TrigConfMessaging(const TrigConfMessaging &rhs)=delete
const std::string & getName() const
name accessor
boost::thread_specific_ptr< MsgStreamTC > m_msg_tls
MsgStreamTC instance (a std::cout like with print-out levels)
MsgStreamTC & msg() const
The standard message stream.
TrigConfMessaging(const std::string &name)
Constructor with parameters.
Forward iterator to traverse the main components of the trigger configuration.
Definition Config.h:22