CVR-Lib last update 20 Sep 2009

cvr::status Class Reference
[Programming interfaces]

Base class for all CVR-Lib objects that have a status for error handling. More...

#include <cvrStatus.h>

Inheritance diagram for cvr::status:

Inheritance graph
[legend]
Collaboration diagram for cvr::status:

Collaboration graph
[legend]

List of all members.

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
statusObjectsetStatusString (const char *msg) const
statusObjectsetStatusString (const std::string &msg) const
statusObjectgetStatusObject () const
static void setStatusMonitor (statusMonitor &monitor)


Detailed Description

Base class for all CVR-Lib objects that have a status for error handling.

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.

See also:
cvr::statusMonitor, cvr::status::object

Constructor & Destructor Documentation

cvr::status::status (  ) 

Default constructor.

cvr::status::status ( const status other  ) 

Copy constructor.

virtual cvr::status::~status (  )  [virtual]

Destructor.


Member Function Documentation

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.

Parameters:
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.
Note that the change of the status string is not considered as a change in the functor status.

statusObject& cvr::status::setStatusString ( const char *  msg  )  const

Set a status string.

Parameters:
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.
Note that the change of the status string is not considered as a change in the functor status.


The documentation for this class was generated from the following file:

Generated on Sun Sep 20 22:08:40 2009 for CVR-Lib by Doxygen 1.5.8