DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
macro.hpp File Reference
#include <ers/ers.hpp>
#include <ers/StreamFactory.hpp>
#include <ers/StandardStreamOutput.hpp>
#include <boost/preprocessor/cat.hpp>
Include dependency graph for macro.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define ERS_REGISTER_OUTPUT_STREAM(class, name, param)
 
#define ERS_INTERNAL_DEBUG(level, message)
 
#define ERS_INTERNAL_INFO(message)
 
#define ERS_INTERNAL_WARNING(message)
 
#define ERS_INTERNAL_ERROR(message)
 
#define ERS_INTERNAL_FATAL(message)
 

Macro Definition Documentation

◆ ERS_INTERNAL_DEBUG

#define ERS_INTERNAL_DEBUG ( level,
message )
Value:
{ \
if ( ers::debug_level() >= level ) \
{ \
std::ostringstream out; \
out << message; \
ers::InternalMessage info( ERS_HERE, out.str() ); \
info.set_severity( ers::Severity( ers::Debug, level ) ); \
ers::StandardStreamOutput::println( std::cout, info, 0 ); \
} }
#define ERS_HERE
int debug_level()
Definition ers.hpp:66
@ Debug
Definition Severity.hpp:26

Definition at line 26 of file macro.hpp.

26#define ERS_INTERNAL_DEBUG( level, message ) { \
27if ( ers::debug_level() >= level ) \
28{ \
29 std::ostringstream out; \
30 out << message; \
31 ers::InternalMessage info( ERS_HERE, out.str() ); \
32 info.set_severity( ers::Severity( ers::Debug, level ) ); \
33 ers::StandardStreamOutput::println( std::cout, info, 0 ); \
34} }

◆ ERS_INTERNAL_ERROR

#define ERS_INTERNAL_ERROR ( message)
Value:
{ \
std::ostringstream out; \
out << message; \
ers::InternalMessage info( ERS_HERE, out.str() ); \
info.set_severity( ers::Error ); \
ers::StandardStreamOutput::println( std::cerr, info, 0 ); \
}
@ Error
Definition Severity.hpp:26

Definition at line 52 of file macro.hpp.

52#define ERS_INTERNAL_ERROR( message ) { \
53 std::ostringstream out; \
54 out << message; \
55 ers::InternalMessage info( ERS_HERE, out.str() ); \
56 info.set_severity( ers::Error ); \
57 ers::StandardStreamOutput::println( std::cerr, info, 0 ); \
58}

◆ ERS_INTERNAL_FATAL

#define ERS_INTERNAL_FATAL ( message)
Value:
{ \
std::ostringstream out; \
out << message; \
ers::InternalMessage info( ERS_HERE, out.str() ); \
info.set_severity( ers::Fatal ); \
ers::StandardStreamOutput::println( std::cerr, info, 0 ); \
::exit( 13 ); \
}
@ Fatal
Definition Severity.hpp:26

Definition at line 60 of file macro.hpp.

60#define ERS_INTERNAL_FATAL( message ) { \
61 std::ostringstream out; \
62 out << message; \
63 ers::InternalMessage info( ERS_HERE, out.str() ); \
64 info.set_severity( ers::Fatal ); \
65 ers::StandardStreamOutput::println( std::cerr, info, 0 ); \
66 ::exit( 13 ); \
67}

◆ ERS_INTERNAL_INFO

#define ERS_INTERNAL_INFO ( message)
Value:
{ \
std::ostringstream out; \
out << message; \
ers::InternalMessage info( ERS_HERE, out.str() ); \
info.set_severity( ers::Information ); \
ers::StandardStreamOutput::println( std::cout, info, 0 ); \
}
@ Information
Definition Severity.hpp:26

Definition at line 36 of file macro.hpp.

36#define ERS_INTERNAL_INFO( message ) { \
37 std::ostringstream out; \
38 out << message; \
39 ers::InternalMessage info( ERS_HERE, out.str() ); \
40 info.set_severity( ers::Information ); \
41 ers::StandardStreamOutput::println( std::cout, info, 0 ); \
42}

◆ ERS_INTERNAL_WARNING

#define ERS_INTERNAL_WARNING ( message)
Value:
{ \
std::ostringstream out; \
out << message; \
ers::InternalMessage info( ERS_HERE, out.str() ); \
info.set_severity( ers::Warning ); \
ers::StandardStreamOutput::println( std::cerr, info, 0 ); \
}
@ Warning
Definition Severity.hpp:26

Definition at line 44 of file macro.hpp.

44#define ERS_INTERNAL_WARNING( message ) { \
45 std::ostringstream out; \
46 out << message; \
47 ers::InternalMessage info( ERS_HERE, out.str() ); \
48 info.set_severity( ers::Warning ); \
49 ers::StandardStreamOutput::println( std::cerr, info, 0 ); \
50}

◆ ERS_REGISTER_OUTPUT_STREAM

#define ERS_REGISTER_OUTPUT_STREAM ( class,
name,
param )
Value:
namespace { \
struct BOOST_PP_CAT( OutputStreamRegistrator, __LINE__ ) { \
static ers::OutputStream * create( const std::string & param ) \
{ return new class( param ); } \
BOOST_PP_CAT( OutputStreamRegistrator, __LINE__ ) ()\
{ ers::StreamFactory::instance().register_out_stream( name, create ); } \
} BOOST_PP_CAT( registrator, __LINE__ ); \
}
ERS abstract output stream interface.

Definition at line 16 of file macro.hpp.

16#define ERS_REGISTER_OUTPUT_STREAM( class, name, param ) \
17namespace { \
18 struct BOOST_PP_CAT( OutputStreamRegistrator, __LINE__ ) { \
19 static ers::OutputStream * create( const std::string & param ) \
20 { return new class( param ); } \
21 BOOST_PP_CAT( OutputStreamRegistrator, __LINE__ ) ()\
22 { ers::StreamFactory::instance().register_out_stream( name, create ); } \
23 } BOOST_PP_CAT( registrator, __LINE__ ); \
24}