48 #ifndef _MIRA_ERRORSERVICE_H_ 49 #define _MIRA_ERRORSERVICE_H_ 51 #include <serialization/adapters/std/vector> 83 template<
typename Reflector>
86 r.member(
"Category", category,
"The error category.");
87 r.member(
"Authority", authority,
88 "The authority that reports the error.");
89 r.member(
"TrText", trText,
90 "The error text that is used for translation of errors.");
91 r.member(
"Message", message,
92 "The error message that will not be translated.");
93 r.member(
"Count", count,
94 "Number of error occurrences.");
95 r.member(
"TimeStamp", timestamp,
96 "Timestamp of last occurrence of the error.");
110 template<
typename Reflector>
113 r.interface(
"IError");
115 "category",
"error category",
"authority",
"reporting authority",
116 "errorTxt",
"error text (can be used for translation)",
117 "message",
"error message (will not be translated)");
119 "category",
"error category",
"authority",
"reporting authority");
121 "Reset all errors for an authority",
122 "authority",
"authority that reported the errors");
124 "Get number of errors for an authority",
125 "authority",
"authority that reported the errors");
128 "Translate an error text",
129 "error",
"error text",
"language",
"language to translate to");
140 void setError(
const std::string& category,
const std::string& authority,
141 const std::string& errorTxt,
const std::string& message);
148 void resetError(
const std::string& category,
const std::string& authority);
154 void resetErrors(
const std::string& authority);
160 uint32 getErrorCount(
const std::string& authority);
165 ErrorVector getErrors();
170 std::string getErrorText(
const std::string& error,
const std::string& language);
178 boost::shared_ptr<SQLiteDB>
mDB;
std::string getErrorText(const std::string &error, const std::string &language)
Get a translation of an error text for the specified language.
void reflect(Reflector &r)
Definition: ErrorService.h:84
ErrorVector getErrors()
Get all errors from the database.
std::vector< Error > ErrorVector
A vector of errors.
Definition: ErrorService.h:103
Class that allows to store errors persistently in a SQLite database.
Definition: ErrorService.h:66
specialize cv::DataType for our ImgPixel and inherit from cv::DataType<Vec>
Definition: IOService.h:67
Authority & mAuthority
Definition: ErrorService.h:176
Wrapper class for boost::posix_time::ptime for adding more functionality to it.
Definition: Time.h:418
std::string trText
Definition: ErrorService.h:78
boost::shared_ptr< SQLiteDB > mDB
Definition: ErrorService.h:178
void resetErrors(const std::string &authority)
Reset all errors for the given authority.
uint32 getErrorCount(const std::string &authority)
Get number of errors for the given authority.
std::string mErrorDBFilename
Definition: ErrorService.h:177
#define MIRA_FRAMEWORK_EXPORT
Definition: FrameworkExports.h:61
uint32 count
Definition: ErrorService.h:80
void resetError(const std::string &category, const std::string &authority)
Reset errors in a category for the given authority.
Authorities act as a facade to the framework.
Definition: Authority.h:94
void setError(const std::string &category, const std::string &authority, const std::string &errorTxt, const std::string &message)
Stores an error in a category for the given authority in the database.
std::string authority
Definition: ErrorService.h:77
void reflect(Reflector &r)
Reflect method for serialization.
Definition: ErrorService.h:111
boost::mutex mMutex
Definition: ErrorService.h:174
Error informations.
Definition: ErrorService.h:74
std::string message
Definition: ErrorService.h:79
std::string category
Definition: ErrorService.h:76
Error()
Definition: ErrorService.h:99
The framework that holds all manager classes and provides startup and shutdown of all framework relat...
Time timestamp
Definition: ErrorService.h:81