00001 #ifndef ROOT_CORE_UTILS__PRINT_MSG_H
00002 #define ROOT_CORE_UTILS__PRINT_MSG_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00016
00017
00018
00019 #include <RootCoreUtils/Global.h>
00020
00021 #include <string>
00022 #include <RootCoreUtils/MessageType.h>
00023
00024 class TString;
00025
00026 namespace RCU
00027 {
00028 void send_message (const char *package, const char *file, unsigned line,
00029 MessageType type, const char *msg);
00030 void send_message (const char *package, const char *file, unsigned line,
00031 MessageType type, const std::string& msg);
00032 void send_message (const char *package, const char *file, unsigned line,
00033 MessageType type, const TString& msg);
00034 [[noreturn]] void
00035 send_message_abort (const char *package, const char *file, unsigned line,
00036 MessageType type, const char *msg);
00037 [[noreturn]] void
00038 send_message_abort (const char *package, const char *file, unsigned line,
00039 MessageType type, const std::string& msg);
00040 [[noreturn]] void
00041 send_message_abort (const char *package, const char *file, unsigned line,
00042 MessageType type, const TString& msg);
00043 }
00044
00045 #ifndef ROOTCORE_PACKAGE
00046 #define ROOTCORE_PACKAGE 0
00047 #endif
00048
00049 #define RCU_PRINT_MSG(message) \
00050 ::RCU::send_message (ROOTCORE_PACKAGE, __FILE__, __LINE__, ::RCU::MESSAGE_REGULAR, (message));
00051
00052 #define RCU_WARN_MSG(message) \
00053 ::RCU::send_message (ROOTCORE_PACKAGE, __FILE__, __LINE__, ::RCU::MESSAGE_WARNING, (message));
00054
00055 #define RCU_ERROR_MSG(message) \
00056 ::RCU::send_message (ROOTCORE_PACKAGE, __FILE__, __LINE__, ::RCU::MESSAGE_ERROR, (message));
00057
00058 #define RCU_THROW_MSG(message) \
00059 ::RCU::send_message_abort (ROOTCORE_PACKAGE, __FILE__, __LINE__, ::RCU::MESSAGE_EXCEPTION, (message));
00060
00061 #endif