Main Page | Modules | Class List | File List | Class Members | File Members

Gan_ErrorTrace Struct Reference
[Error Handling]

Stores details of single error in an error trace. More...

#include <gandalf/common/gan_err_trace.h>

List of all members.

Public Attributes

int f_static_record
int f_static_message
int f_spare
const char * func_name
int err_code
const char * file_name
int line_number
char * message
int number

Detailed Description

Stores details of single error in an error trace.

Error trace is a last in, first out stack of structures containing details of recorded errors. The stack is implemented as a linked list that is traversed by following 'prev' links.

The bottom (oldest) and 2nd to bottom record of the error trace are statically allocated, while all others are dynamically allocated (malloc'd). Important that gan_et_flush doesn't try to free() the statically allocated records.

prev Address of previous (next oldest) record in error trace Prev for last record is NULL.
f_static_record Is this record statically or dynamically allocated If it's static, don't try and free() it.
f_static_message Is the text message in this record is contained in a statically or dynamically allocated char array. If it's static, don't try and free() it.
f_spare Whether is record contains details for an error, or is spare.
func_name Name of function in which error occurs
err_code Numeric code of error. Default set is defined in gan_exception_codes*.h
file_name Name of file in which error occurs
line_number Line in file at which error occurs
message Message string describing error
number Number attached to error
A record has the status "spare" and "not spare". A spare record is always kept in advance so that a deep error can be registered in a memory shortage situation. A record is designated spare when it carries and error code of EC_DFT_SPARE.

The text message pointed to by "message" normally resides in a dynamically allocated char array, except for the deep error message which resides in a static char array. Therefore if the error code is EC_DFT_DEEP_ERROR, then the message char array should never be subjected to free().

Member Data Documentation

int Gan_ErrorTrace::f_spare


int Gan_ErrorTrace::f_static_message


int Gan_ErrorTrace::f_static_record


struct Gan_ErrorTrace* Gan_ErrorTrace::prev

Prev => last in, first out

The documentation for this struct was generated from the following file:
Generated on Fri Mar 17 12:44:53 2006 by  doxygen