|
Developer Documentation |
|
Centre for Vision, Speech & Signal Processing |
| 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;
-
- typedef char FnBuf;
-
Variables:
- FnBuf functionName;
-
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.
- ErrorEventC(const ErrorEventC & ee)
-
It is not possible to create a copy of error engine.
- const ErrorEventC & operator=(const ErrorEventC & ee)
-
It is not possible to assign to an error engine.
- 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.
- const TextBufferC & operator=(const TextBufferC & msg)
-
It is not possible to assign to the message.
- operator char *()
-
IAPS - Image analysis program system.
End of include file TextBuf.hh
|
Programmer:Radek Marik, Documentation by CxxDoc: Tue Mar 20 10:49:27 2001
|