VAPoR  3.0.0
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
VetsUtil::MyBase Class Reference

VetsUtil base class. More...

#include <MyBase.h>

Inheritance diagram for VetsUtil::MyBase:
VAPoR::DataMgrV3_0 VAPoR::DC VAPoR::NetCDFCpp VAPoR::Params VAPoR::RendererBase VAPoR::Visualizer VAPoR::DCWRF VAPoR::VDC VAPoR::WASP VAPoR::AnimationParams VAPoR::BasicParams VAPoR::RegionParams VAPoR::RenderParams VAPoR::ViewpointParams VAPoR::Renderer

Public Types

typedef void(* ErrMsgCB_T) (const char *msg, int err_code)
 
typedef void(* DiagMsgCB_T) (const char *msg)
 

Public Member Functions

 MyBase ()
 
const string & getClassName () const
 

Static Public Member Functions

static void SetErrMsg (const char *format,...)
 Record a formatted error message. More...
 
static void SetErrMsg (int errcode, const char *format,...)
 Record a formatted error message and an error code. More...
 
static const char * GetErrMsg ()
 
static void SetErrCode (int err_code)
 Record an error code. More...
 
static int GetErrCode ()
 Retrieve the current error code. More...
 
static void SetErrMsgCB (ErrMsgCB_T cb)
 
static ErrMsgCB_T GetErrMsgCB ()
 
static void SetErrMsgFilePtr (FILE *fp)
 
static const FILE * SetErrMsgFilePtr ()
 
static void SetDiagMsg (const char *format,...)
 Record a formatted diagnostic message. More...
 
static const char * GetDiagMsg ()
 
static void SetDiagMsgCB (DiagMsgCB_T cb)
 
static DiagMsgCB_T GetDiagMsgCB ()
 
static void SetDiagMsgFilePtr (FILE *fp)
 
static bool EnableErrMsg (bool enable)
 

Static Public Attributes

static char * ErrMsg
 
static int ErrCode
 
static int ErrMsgSize
 
static FILE * ErrMsgFilePtr
 
static ErrMsgCB_T ErrMsgCB
 
static char * DiagMsg
 
static int DiagMsgSize
 
static FILE * DiagMsgFilePtr
 
static DiagMsgCB_T DiagMsgCB
 
static bool Enabled
 

Protected Member Functions

void SetClassName (const string &name)
 

Detailed Description

VetsUtil base class.

Author
John Clyne
Version
0.1
Date
Mon Dec 13 17:15:12 MST 2004 A collection of general purpose utilities - things that probably should be in the STL but aren't.

Definition at line 68 of file MyBase.h.

Member Typedef Documentation

typedef void(* VetsUtil::MyBase::DiagMsgCB_T) (const char *msg)

Definition at line 72 of file MyBase.h.

typedef void(* VetsUtil::MyBase::ErrMsgCB_T) (const char *msg, int err_code)

Definition at line 71 of file MyBase.h.

Constructor & Destructor Documentation

VetsUtil::MyBase::MyBase ( )

Member Function Documentation

static bool VetsUtil::MyBase::EnableErrMsg ( bool  enable)
inlinestatic

Get the file pointer to whence diagnostic messages are written

This method returns the error message file pointer most recently set with SetDiagMsgFilePtr().

See also
SetDiagMsgFilePtr() Enable or disable error message reporting.

When disabled calls to SetErrMsg() report no error messages either through the error message callback or the error message FILE pointer.

Parameters
[in]enableBoolean flag to enable or disable error reporting

Definition at line 242 of file MyBase.h.

const string& VetsUtil::MyBase::getClassName ( ) const
inline

Definition at line 75 of file MyBase.h.

static const char* VetsUtil::MyBase::GetDiagMsg ( )
inlinestatic

Retrieve the current diagnostic message

Retrieves the last error message set with SetDiagMsg(). It is the caller's responsibility to copy the message returned to user space.

See also
SetDiagMsg()
Return values
msgA pointer to null-terminated string.

Definition at line 189 of file MyBase.h.

static DiagMsgCB_T VetsUtil::MyBase::GetDiagMsgCB ( )
inlinestatic

Get the callback function for error messages

Get the callback function to be called whenever SetDiagMsg() is called. This method returns the address of the callback function set with the most recent call to SetDiagMsgCB(). If no callback function is defined, NULL is returned.

See also
SetDiagMsgCB

Definition at line 212 of file MyBase.h.

static int VetsUtil::MyBase::GetErrCode ( )
inlinestatic

Retrieve the current error code.

Retrieves the last error code set either explicity with SetErrCode() or indirectly with a call to SetErrMsg().

See also
SetErrMsg(), SetErrCode()
Return values
codeAn erroor code

Definition at line 126 of file MyBase.h.

static const char* VetsUtil::MyBase::GetErrMsg ( )
inlinestatic

Retrieve the current error message

Retrieves the last error message set with SetErrMsg(). It is the caller's responsibility to copy the message returned to user space.

See also
SetErrMsg(), SetErrCode()
Return values
msgA pointer to null-terminated string.

Definition at line 109 of file MyBase.h.

static ErrMsgCB_T VetsUtil::MyBase::GetErrMsgCB ( )
inlinestatic

Get the callback function for error messages

Get the callback function to be called whenever SetErrMsg() is called. This method returns the address of the callback function set with the most recent call to SetErrMsgCB(). If no callback function is defined, NULL is returned.

See also
SetErrMsgCB

Definition at line 148 of file MyBase.h.

void VetsUtil::MyBase::SetClassName ( const string &  name)
inlineprotected

Definition at line 262 of file MyBase.h.

static void VetsUtil::MyBase::SetDiagMsg ( const char *  format,
  ... 
)
static

Record a formatted diagnostic message.

Formats and records a diagnostic message. Subsequent calls will overwrite the stored error message. This method differs from SetErrMsg() only in that no associated error code is set - the message is considered diagnostic only, not an error.

Parameters
[in]formatA 'C' style sprintf format string.
[in]arg...Arguments to format
See also
GetDiagMsg()
static void VetsUtil::MyBase::SetDiagMsgCB ( DiagMsgCB_T  cb)
inlinestatic

Set a callback function for diagnostic messages

Set the callback function to be called whenever SetDiagMsg() is called. The callback function, cb, will be called and passed the formatted error message as an argument. The default callback function is NULL, i.e. no function is called

Parameters
[in]cbA callback function or NULL

Definition at line 201 of file MyBase.h.

static void VetsUtil::MyBase::SetDiagMsgFilePtr ( FILE *  fp)
inlinestatic

Set the file pointer to whence diagnostic messages are written

This method permits the specification of a file pointer to which all messages logged with SetDiagMsg() will be written. The default file pointer is NULL. I.e. by default error messages logged by SetDiagMsg() are not written.

Parameters
[in]fpA file pointer opened for writing or NULL
See also
SetDiagMsg()

Definition at line 223 of file MyBase.h.

static void VetsUtil::MyBase::SetErrCode ( int  err_code)
inlinestatic

Record an error code.

Sets the error code to the indicated value.

Parameters
[in]err_codeThe error code
See also
GetErrMsg(), GetErrCode(), SetErrMsg()

Definition at line 117 of file MyBase.h.

static void VetsUtil::MyBase::SetErrMsg ( const char *  format,
  ... 
)
static

Record a formatted error message.

Formats and records an error message. Subsequent calls will overwrite the stored error message. The method will also set the error code to 1.

Parameters
[in]formatA 'C' style sprintf format string.
[in]args...Arguments to format
See also
GetErrMsg(), GetErrCode()
static void VetsUtil::MyBase::SetErrMsg ( int  errcode,
const char *  format,
  ... 
)
static

Record a formatted error message and an error code.

Formats and records an error message. Subsequent calls will overwrite the stored error message. The method will also set the error code to err_code.

Parameters
[in]errcodeA application-defined error code
[in]formatA 'C' style sprintf format string.
[in]arg...Arguments to format
See also
GetErrMsg(), GetErrCode()
static void VetsUtil::MyBase::SetErrMsgCB ( ErrMsgCB_T  cb)
inlinestatic

Set a callback function for error messages

Set the callback function to be called whenever SetErrMsg() is called. The callback function, cb, will be called and passed the formatted error message and the error code as an argument. The default callback function is NULL, i.e. no function is called

Parameters
[in]cbA callback function or NULL

Definition at line 137 of file MyBase.h.

static void VetsUtil::MyBase::SetErrMsgFilePtr ( FILE *  fp)
inlinestatic

Set the file pointer to whence error messages are written

This method permits the specification of a file pointer to which all messages logged with SetErrMsg() will be written. The default file pointer is NULL. I.e. by default error messages logged by SetErrMsg() are not written.

Parameters
[in]fpA file pointer opened for writing or NULL
See also
SetErrMsg()

Definition at line 159 of file MyBase.h.

static const FILE* VetsUtil::MyBase::SetErrMsgFilePtr ( )
inlinestatic

Get the file pointer to whence error messages are written

This method returns the error message file pointer most recently set with SetErrMsgFilePtr().

See also
SetErrMsgFilePtr()

Definition at line 168 of file MyBase.h.

Member Data Documentation

char* VetsUtil::MyBase::DiagMsg
static

Definition at line 253 of file MyBase.h.

DiagMsgCB_T VetsUtil::MyBase::DiagMsgCB
static

Definition at line 256 of file MyBase.h.

FILE* VetsUtil::MyBase::DiagMsgFilePtr
static

Definition at line 255 of file MyBase.h.

int VetsUtil::MyBase::DiagMsgSize
static

Definition at line 254 of file MyBase.h.

bool VetsUtil::MyBase::Enabled
static

Definition at line 257 of file MyBase.h.

int VetsUtil::MyBase::ErrCode
static

Definition at line 248 of file MyBase.h.

char* VetsUtil::MyBase::ErrMsg
static

Definition at line 244 of file MyBase.h.

ErrMsgCB_T VetsUtil::MyBase::ErrMsgCB
static

Definition at line 251 of file MyBase.h.

FILE* VetsUtil::MyBase::ErrMsgFilePtr
static

Definition at line 250 of file MyBase.h.

int VetsUtil::MyBase::ErrMsgSize
static

Definition at line 249 of file MyBase.h.


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