8 #ifndef COMMONMESSAGING_H_
9 #define COMMONMESSAGING_H_
10 #include "GaudiKernel/IService.h"
11 #include "GaudiKernel/ISvcLocator.h"
12 #include "GaudiKernel/IMessageSvc.h"
13 #include "GaudiKernel/MsgStream.h"
14 #include "GaudiKernel/SmartIF.h"
15 #include "GaudiKernel/GaudiException.h"
24 #define generate_has_( method, args ) \
25 template <typename T, typename SFINAE = void> \
26 struct has_ ## method : std::false_type {}; \
27 template <typename T> \
28 struct has_ ## method<T, is_valid_t<decltype(std::declval<const T&>().method args)>> : std::true_type {};
30 #define generate_add_(method, ret, args ) \
31 template <typename Base, bool> struct add_ ## method; \
32 template <typename Base> \
33 struct add_ ## method <Base,false> : public Base { \
36 template <typename Base> \
37 struct add_ ## method <Base, true> : public Base { \
39 virtual ~add_ ## method () = default; \
40 virtual ret method args const = 0; \
44 template <
typename>
struct void_t {
typedef void type; };
59 template <
typename BASE>
76 m_msgsvc = this->serviceLocator();
81 #if defined(GAUDI_V20_COMPAT) && !defined(G21_NO_DEPRECATED)
93 if (
UNLIKELY((!m_msgStream) || (!m_streamWithService))) {
96 m_streamWithService =
ms.isValid();
112 return msgStream() <<
level;
144 return msgStream().level();
157 mutable std::unique_ptr<MsgStream> m_msgStream;
160 mutable bool m_streamWithService =
false;
164 void updateMsgStreamOutputLevel(
int level) {
165 if (m_msgStream) m_msgStream->
setLevel(level);
Definition of the MsgStream class used to transmit messages.
Small smart pointer class with automatic reference counting for IInterface.
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
generate_has_(name,()) generate_add_(name
#define generate_add_(method, ret, args)
implementation_detail::add_serviceLocator< Base,!implementation_detail::has_serviceLocator< Base >::value > add_serviceLocator
void setLevel(int level)
Update outputlevel.
typename void_t< T >::type is_valid_t
implementation_detail::add_name< Base,!implementation_detail::has_name< Base >::value > add_name