last update 20 Sep 2009 |
#include <cvrStatus.h>
Classes | |
class | statusObject |
Class for status string storing and formatting. More... | |
Public Member Functions | |
status () | |
status (const status &other) | |
virtual | ~status () |
Error handling and report | |
const std::string & | getStatusString () const |
statusObject & | setStatusString (const char *msg) const |
statusObject & | setStatusString (const std::string &msg) const |
statusObject & | getStatusObject () const |
static void | setStatusMonitor (statusMonitor &monitor) |
This is sort of an interface, which does not inherit from cvr::object interface, since it is assumed that the objects that inherit from this class will also directly or indirectly inherit from cvr::object.
You can set a class inherited from cvr::statusMonitor to select how errors have to be reported. See the method status::setStatusMonitor and the nested class status::object for more information.
cvr::status::status | ( | ) |
Default constructor.
cvr::status::status | ( | const status & | other | ) |
Copy constructor.
virtual cvr::status::~status | ( | ) | [virtual] |
Destructor.
statusObject& cvr::status::getStatusObject | ( | ) | const |
Get a reference to the internal statusObject.
const std::string& cvr::status::getStatusString | ( | ) | const |
Return the last message set with setStatusString() and modified with the operators.
static void cvr::status::setStatusMonitor | ( | statusMonitor & | monitor | ) | [static] |
Set Status Monitor.
All functors in the CVR-Lib share this object, which controls what to do when the status string is set or changed. You can set it to throw an exception after a few milliseconds (such that many appendStatusString() calls can be done before the exception is thrown; see cvr::statusMonitorException), you can redirect the statusString directly to the std::cerr; see cvr::statusMonitorCerr), or you can do nothing but store internally the statusString (see cvr::statusMonitorInactive), which is the default behaviour.
If you implement an own class for this (like and error-log window) ensure that you follow the interface explained in cvr::statusMonitor to avoid some memory leaks.
You have to ensure that this method is called only once at a time in your application, especially if you use several threads.
statusObject& cvr::status::setStatusString | ( | const std::string & | msg | ) | const |
Set a status string.
msg | the const string to be reported next time by getStatusString(). The given string will be copied. This message will be usually set within the apply methods to indicate an error cause. |
statusObject& cvr::status::setStatusString | ( | const char * | msg | ) | const |
Set a status string.
msg | the const string to be reported next time by getStatusString(). The given string will be copied. This message will be usually set within the apply methods to indicate an error cause. |