User Documentation
Centre for Vision, Speech & Signal Processing
DEVELOP IN NAMESPACE AMMA TREE ROOT AMMA SEARCH AMMA HOME
 

  PUBLIC
ErrorEventC::ErrorEventC(const SizeT)
ErrorEventC::Finish(const StatusT)
ErrorEventC::Exit(const StatusT)
ErrorEventC::Warning(void)
ErrorEventC::Function(FunctionNameT)
TextBufferC::operator const char *(void) const
TextBufferC::RewindToStart(void)
ErrorEventC
 
Class ErrorEventC implements very simple error handling.
 
include "amma/Error.hh"
User Level:Default
Library:Mtype
Section:Basic Types
In Scope:std

Comments:
It serves as a simple interface on different platforms (at the moment UNIX, MS WINDOWS are supported). The class object is able to save a message of characters and properly terminate a program. If the name of the function which triggers the error is not set, the terminating function Exit broadcasts only abbreviated message. Having set the function name a full error message is broadcasted. The action triggering member functions can be redefined in a derived class. In such way one can change the error handling of the whole library.

The instance errAMMA of the ErrorEventC class serves as a standard error handling engine.

Parent Classes: Enumerated types:
enum anon_enum?3 { MAX_MESSAGE = 1000, MAX_FUNCTION = 100 } ;

Typedefs:
typedef int SizeT;
The size of the biggest message.

typedef int StatusT;

typedef const char * FunctionNameT;

Variables:
Methods:
ErrorEventC(const SizeT size = MAX_MESSAGE)
Creates the error handling engine. It should be created at the beginning of the execution of a program, otherwise there can be problems with allocation of memory. Triggering of actions. ----------------------

void Finish(const StatusT st = EXIT_FAILURE)
Terminates the execution of the program with status 'st'. This is used where the error is reported in the normal cource of the program. Using Exit(st);

void Exit(const StatusT st = EXIT_FAILURE)
Terminates the execution of the program with status 'st'. This terminates the program with a signal. This should be used when an unexpected event occures which is best traced with a debugger.

void Warning()
The engine sends the message about a suspicious event to the error device. Additional information. -----------------------

ErrorEventC & Function(FunctionNameT name)
Sets the name of function which triggers an error.

#include "amma/TextBuf.hh"
operator const char *() const
Returns the pointer to the beginning of the buffer storing an text message. inline operator char * (); Returns the pointer to the beginning of the buffer storing an text message.

void RewindToStart()
Resets the textbuffer to be as just constructed.


Programmer:Radek Marik, Documentation by CxxDoc: Tue Mar 20 10:48:08 2001