8 #ifndef COMMONMESSAGING_H_ 9 #define COMMONMESSAGING_H_ 24 #define generate_( method, ret, args ) \ 26 template <typename T, typename SFINAE = void> \ 27 struct has_ ## method : std::false_type {}; \ 28 template <typename T> \ 29 struct has_ ## method<T, is_valid_t<decltype(std::declval<const T&>().method args)>> : std::true_type {}; \ 31 template <typename Base> \ 32 struct add_ ## method : public Base { \ 34 virtual ~add_ ## method () = default; \ 35 virtual ret method args const = 0; \ 49 implementation_detail::add_name< Base>>
::type;
52 implementation_detail::add_serviceLocator< Base>>
::type;
62 virtual void create_msgSvc()
const = 0;
63 virtual void create_msgStream()
const = 0;
71 if (
UNLIKELY(!m_msgsvc)) create_msgSvc();
75 #if defined(GAUDI_V20_COMPAT) && !defined(G21_NO_DEPRECATED) 81 [[
deprecated(
"will be removed in v29r0, use msgSvc() instead, see https://gitlab.cern.ch/gaudi/Gaudi/merge_requests/80")]]
89 if (
UNLIKELY((m_createMsgStream))) create_msgStream();
104 return msgStream() <<
level;
136 if (
UNLIKELY(!m_msgStream)) create_msgStream();
162 template <
typename BASE>
174 m_msgsvc = this->serviceLocator();
179 m_createMsgStream = (!
ms.isValid() || !m_msgStream);
180 m_level = m_msgStream ? m_msgStream->level() :
MSG::NIL;
187 if (level !=
MSG::NIL && level != m_level) {
189 msgSvc()->setOutputLevel(this->
name(), level);
191 if (m_msgStream) m_msgStream->setLevel(level);
193 debug() <<
"Property update for OutputLevel : new value = " << level <<
endmsg;
Definition of the MsgStream class used to transmit messages.
typename std::conditional< implementation_detail::has_serviceLocator< Base >::value, Base, implementation_detail::add_serviceLocator< Base >>::type add_serviceLocator
Small smart pointer class with automatic reference counting for IInterface.
MsgStream & msg() const
shortcut for the method msgStream(MSG::INFO)
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
MsgStream & info() const
shortcut for the method msgStream(MSG::INFO)
MsgStream & verbose() const
shortcut for the method msgStream(MSG::VERBOSE)
struct deprecated("use MergingTransformer instead")]] ListTransformer
SmartIF< IMessageSvc > m_msgsvc
Pointer to the message service;.
class MergingTransformer< Out(const vector_of_const_< In > void
std::unique_ptr< MsgStream > m_msgStream
The predefined message stream.
void create_msgSvc() const override final
cold functionality
MsgStream & err() const
shortcut for the method msgStream(MSG::ERROR)
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
MsgStream & warning() const
shortcut for the method msgStream(MSG::WARNING)
void updateMsgStreamOutputLevel(int level)
Update the output level of the cached MsgStream.
void create_msgStream() const override final
MSG::Level outputLevel() const __attribute__((deprecated))
Backward compatibility function for getting the output level.
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
generate_(name, const std::string &,()) generate_(serviceLocator
MsgStream & msgStream() const
Return an uninitialized MsgStream.
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
typename std::conditional< implementation_detail::has_name< Base >::value, Base, implementation_detail::add_name< Base >>::type add_name
typename void_t< T >::type is_valid_t
MsgStream & msgStream(const MSG::Level level) const
Predefined configurable message stream for the efficient printouts.
MsgStream & fatal() const
shortcut for the method msgStream(MSG::FATAL)
MSG::Level msgLevel() const
get the output level from the embedded MsgStream
MsgStream & always() const
shortcut for the method msgStream(MSG::ALWAYS)
bool m_createMsgStream
Flag to trigger a new MsgStream.
bool msgLevel(MSG::Level lvl) const
get the output level from the embedded MsgStream
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.