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(const std::string& msg, const char* file=NULL, int line=0) MIRA_NOEXCEPT_OR_NOTHROW : \ 76 Base(msg, file, line) {} \ 78 virtual void raise(bool recursive = false) { throw *this; } \ 104 template<
typename Reflector>
106 uint32 count =
mInfos.size();
107 r.member(
"InfoCount", count,
"Number of info fields");
109 for (std::list<Exception::Info>::const_iterator it =
mInfos.begin(); it !=
mInfos.end(); ++it) {
110 r.member((
"Info"+std::to_string(n)+
"Message").c_str(), it->message,
"Message");
111 r.member((
"Info"+std::to_string(n)+
"File").c_str(), it->file,
"File");
112 r.member((
"Info"+std::to_string(n)+
"Line").c_str(), it->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:315
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:238
#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:316
$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:314
#define MIRA_OBJECT(classIdentifier)
Use this MACRO if you like the factory to automatically extract the class name from the given identif...
Definition: FactoryMacros.h:183
Base class for exceptions.
Definition: Exception.h:194
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