Main Page | Class List | Directories | File List | Class Members | File Members

ObitErr.c File Reference

ObitErr Error stack class function definitions. More...

#include <string.h>
#include "ObitErr.h"
#include "ObitMem.h"

Functions

ObitErrnewObitErr (void)
 Public: Constructor.
ObitErrObitErrRef (ObitErr *in)
 Public: Reference to object, update reference count.
ObitErrObitErrUnref (ObitErr *in)
 Public: Unreference object, destroy if no more references.
void ObitErrClear (ObitErr *in)
 Public: Clear error stack.
void ObitErrClearErr (ObitErr *in)
 Public: Clear only error messages and status in stack.
void ObitErrPush (ObitErr *in, ObitErrCode errLevel, gchar *errMsg)
 Public: Add entry in error stack.
void ObitErrPop (ObitErr *in, ObitErrCode *errLevel, gchar **errMsg)
 Public: Pop last entry from top of stack.
void ObitErrLog (ObitErr *in)
 Public: Write all entries in log file.
gboolean ObitErrIsA (ObitErr *in)
 Public: Returns true if input is a ObitErr*.


Detailed Description

ObitErr Error stack class function definitions.

This is an error stack class for obtaining tracebacks for error conditions. When an error is detected, it should be entered onto the ObitErr and the function returns. If an error level of OBIT_Traceback or higher has been entered the error member is set TRUE. Each function with an ObitErr argument should check at the beginning to see if an error condition already exists (error=TRUE) and if so return. Any function calling a function which encounters an error should add its message to the stack and return.

This class is a member of the Obit class and therefore cannot be derived from it. Also is not structured to be derived from.

Usage of member pointers.

The Ref and Unref member functions should always be used to make a copy of an object pointer or to release it. The ref function increments its reference count and returns a pointer. The unref function decrements the reference count, deleted the object if the value is below 1 and returns NULL. Unreferenced pointers should always be NULLed or set to another valid value.

Function Documentation

ObitErr* newObitErr void   ) 
 

Public: Constructor.

Returns:
the new object.

void ObitErrClear ObitErr in  ) 
 

Public: Clear error stack.

Parameters:
in Pointer to object to clear.
Returns:
NULL pointer.

void ObitErrClearErr ObitErr in  ) 
 

Public: Clear only error messages and status in stack.

Parameters:
in Pointer to object to clear.
Returns:
NULL pointer.

gboolean ObitErrIsA ObitErr in  ) 
 

Public: Returns true if input is a ObitErr*.

Parameters:
in Pointer to object to test.
Returns:
TRUE if member else FALSE.

void ObitErrLog ObitErr in  ) 
 

Public: Write all entries in log file.

Stack will be cleared when done

Parameters:
in Input ObitErr. NULL if there are no more messages.

void ObitErrPop ObitErr in,
ObitErrCode errLevel,
gchar **  errMsg
 

Public: Pop last entry from top of stack.

This item is then removed.

Parameters:
in Input ObitErr.
errLevel (output) Error level code.
errMsg (output) Error message (deallocate with g_free when done). NULL if there are no more messages.

void ObitErrPush ObitErr in,
ObitErrCode  errLevel,
gchar *  errMsg
 

Public: Add entry in error stack.

Parameters:
in Pointer to object to add message to.
errLevel Error level code.
errMsg Error message.

ObitErr* ObitErrRef ObitErr in  ) 
 

Public: Reference to object, update reference count.

This function should always be used to copy pointers as this will ensure a proper reference count.

Parameters:
in Pointer to object to link.
Returns:
the pointer to in.

ObitErr* ObitErrUnref ObitErr in  ) 
 

Public: Unreference object, destroy if no more references.

Parameters:
in Pointer to object to unlink.
Returns:
NULL pointer.


Generated on Fri Aug 31 22:13:05 2007 for Obit by  doxygen 1.3.9.1