47 #ifndef _MIRA_EXCEPTIONS_H_ 48 #define _MIRA_EXCEPTIONS_H_ 66 #define MIRA_DEFINE_SERIALIZABLE_EXCEPTION(Ex, Base) \ 67 class Ex : public Base \ 71 friend class mira::ClassFactoryDefaultConstClassBuilder; \ 72 Ex() MIRA_NOEXCEPT_OR_NOTHROW {} \ 75 Ex(std::string msg, const char* file=NULL, int line=0) MIRA_NOEXCEPT_OR_NOTHROW : \ 76 Base(std::move(msg), file, line) {} \ 78 void raise(bool recursive = false) override { throw *this; } \ 104 template<
typename Reflector>
106 uint32 count =
mInfos.size();
107 r.member(
"InfoCount", count,
"Number of info fields");
109 for (
const auto& i :
mInfos) {
110 r.member((
"Info"+std::to_string(n)+
"Message").c_str(), i.message,
"Message");
111 r.member((
"Info"+std::to_string(n)+
"File").c_str(), i.file,
"File");
112 r.member((
"Info"+std::to_string(n)+
"Line").c_str(), i.line,
"Line");
115 r.member(
"Stack",
mStack,
"Call stack");
116 r.member(
"ThreadID",
mThreadID,
"Thread ID");
119 template<
typename Reflector>
122 r.member(
"InfoCount", count,
"Number of info fields");
126 for (uint64 n = 0; n < count; ++n) {
127 r.member((
"Info"+std::to_string(n)+
"Message").c_str(),
message,
"Message");
128 r.member((
"Info"+std::to_string(n)+
"File").c_str(),
file,
"File");
129 r.member((
"Info"+std::to_string(n)+
"Line").c_str(), line,
"Line");
133 r.member(
"Stack",
mStack,
"Call stack");
134 r.member(
"ThreadID",
mThreadID,
"Thread ID");
139 virtual void raise(
bool recursive =
false) = 0;
MIRA_SPLIT_REFLECT_MEMBER void reflectRead(Reflector &r)
Definition: Exceptions.h:105
CallStack mStack
Definition: Exception.h:320
PropertyHint file(const std::string &filters=std::string(), bool save=false)
Tells the property editor that the path is for a file, and that it should show a "File Open"/"File Sa...
Definition: Path.h:247
specialize cv::DataType for our ImgPixel and inherit from cv::DataType<Vec>
Definition: IOService.h:67
SerializableException()
Definition: Exceptions.h:91
#define MIRA_SPLIT_REFLECT_MEMBER
Macro that insert a class member reflect() method just splitting reflection into a reflectRead() and ...
Definition: SplitReflect.h:209
#define MIRA_DEFINE_SERIALIZABLE_EXCEPTION(Ex, Base)
Macro for easily defining a new serializable exception class.
Definition: Exceptions.h:66
ThreadID mThreadID
Definition: Exception.h:321
#define MIRA_ABSTRACT_OBJECT(classIdentifier)
Use this MACRO instead of MIRA_OBJECT to declare the class as abstract.
Definition: FactoryMacros.h:235
$Header file containing base classes to enable class creation using a class factory$ ...
std::string message() const MIRA_NOEXCEPT_OR_NOTHROW
Similar to what().
The object class acts as a generic base class for classes which should be used with the classFactory...
Definition: Object.h:144
SerializableException(const std::string &msg, const char *file=NULL, int line=0) MIRA_NOEXCEPT_OR_NOTHROW
Definition: Exceptions.h:94
#define MIRA_NOEXCEPT_OR_NOTHROW
Definition: NoExcept.h:99
std::list< Info > mInfos
Definition: Exception.h:319
Base class for exceptions.
Definition: Exception.h:199
friend class ClassFactoryDefaultConstClassBuilder
Definition: Exceptions.h:90
void reflectWrite(Reflector &r)
Definition: Exceptions.h:120
virtual ~SerializableException() MIRA_NOEXCEPT_OR_NOTHROW
Definition: Exceptions.h:97
boost::shared_ptr< SerializableException > SerializableExceptionPtr
Definition: Exceptions.h:142
Definition: Exceptions.h:85