VAPOR3 3.9.4
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
Wasp::MyBase Class Reference

Wasp base class. More...

#include <MyBase.h>

Inheritance diagram for Wasp::MyBase:
VAPoR::IResourceManager< std::pair< std::string, unsigned int >, Font > VAPoR::IResourceManager< std::string, ShaderProgram > NavigationUtils VAPoR::AnnotationRenderer VAPoR::BOVCollection VAPoR::BlkMemMgr VAPoR::CalcEngineMgr VAPoR::ControlExec VAPoR::DC VAPoR::DataMgr VAPoR::DataMgrFactory VAPoR::DerivedVar VAPoR::Font VAPoR::GeoImage VAPoR::GeoUtil VAPoR::GridHelper VAPoR::IResourceManager< K, T > VAPoR::ImageWriter VAPoR::ImpExp VAPoR::MatWaveBase VAPoR::NetCDFCollection VAPoR::NetCDFCpp VAPoR::NetCDFSimple VAPoR::ParamsBase VAPoR::ParamsContainer VAPoR::ParamsMgr VAPoR::Proj4API VAPoR::Proj4StringParser VAPoR::PyEngine VAPoR::RenParamsContainer VAPoR::RendererBase VAPoR::Shader VAPoR::ShaderProgram VAPoR::SignificanceMap VAPoR::Visualizer VAPoR::XmlNode VAPoR::XmlParser Wasp::EasyThreads Wasp::MyPython Wasp::OptionParser Wasp::Version

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.
 
static void SetErrMsg (int errcode, const char *format,...)
 Record a formatted error message and an error code.
 
static const char * GetErrMsg ()
 
static void SetErrCode (int err_code)
 Record an error code.
 
static int GetErrCode ()
 Retrieve the current error code.
 
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.
 
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 bool GetEnableErrMsg ()
 

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

Wasp base class.

Author
John Clyne
Version
0.1
Date
Mon Dec 13 17:15:12 MST 2004

Definition at line 67 of file MyBase.h.

Member Typedef Documentation

◆ DiagMsgCB_T

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

Definition at line 70 of file MyBase.h.

◆ ErrMsgCB_T

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

Definition at line 69 of file MyBase.h.

Constructor & Destructor Documentation

◆ MyBase()

Wasp::MyBase::MyBase ( )

Member Function Documentation

◆ EnableErrMsg()

static bool Wasp::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 238 of file MyBase.h.

◆ getClassName()

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

Definition at line 73 of file MyBase.h.

◆ GetDiagMsg()

static const char * Wasp::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 186 of file MyBase.h.

◆ GetDiagMsgCB()

static DiagMsgCB_T Wasp::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 208 of file MyBase.h.

◆ GetEnableErrMsg()

static bool Wasp::MyBase::GetEnableErrMsg ( )
inlinestatic

Definition at line 245 of file MyBase.h.

◆ GetErrCode()

static int Wasp::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 123 of file MyBase.h.

◆ GetErrMsg()

static const char * Wasp::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 106 of file MyBase.h.

◆ GetErrMsgCB()

static ErrMsgCB_T Wasp::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 145 of file MyBase.h.

◆ SetClassName()

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

Definition at line 261 of file MyBase.h.

◆ SetDiagMsg()

static void Wasp::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()

◆ SetDiagMsgCB()

static void Wasp::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 197 of file MyBase.h.

◆ SetDiagMsgFilePtr()

static void Wasp::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 219 of file MyBase.h.

◆ SetErrCode()

static void Wasp::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 114 of file MyBase.h.

◆ SetErrMsg() [1/2]

static void Wasp::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()

Referenced by VAPoR::SetHDF5PluginPath().

◆ SetErrMsg() [2/2]

static void Wasp::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()

◆ SetErrMsgCB()

static void Wasp::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 134 of file MyBase.h.

◆ SetErrMsgFilePtr() [1/2]

static const FILE * Wasp::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 165 of file MyBase.h.

◆ SetErrMsgFilePtr() [2/2]

static void Wasp::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 156 of file MyBase.h.

Member Data Documentation

◆ DiagMsg

char* Wasp::MyBase::DiagMsg
static

Definition at line 254 of file MyBase.h.

◆ DiagMsgCB

DiagMsgCB_T Wasp::MyBase::DiagMsgCB
static

Definition at line 257 of file MyBase.h.

◆ DiagMsgFilePtr

FILE* Wasp::MyBase::DiagMsgFilePtr
static

Definition at line 256 of file MyBase.h.

◆ DiagMsgSize

int Wasp::MyBase::DiagMsgSize
static

Definition at line 255 of file MyBase.h.

◆ Enabled

bool Wasp::MyBase::Enabled
static

Definition at line 258 of file MyBase.h.

◆ ErrCode

int Wasp::MyBase::ErrCode
static

Definition at line 249 of file MyBase.h.

◆ ErrMsg

char* Wasp::MyBase::ErrMsg
static

Definition at line 248 of file MyBase.h.

◆ ErrMsgCB

ErrMsgCB_T Wasp::MyBase::ErrMsgCB
static

Definition at line 252 of file MyBase.h.

◆ ErrMsgFilePtr

FILE* Wasp::MyBase::ErrMsgFilePtr
static

Definition at line 251 of file MyBase.h.

◆ ErrMsgSize

int Wasp::MyBase::ErrMsgSize
static

Definition at line 250 of file MyBase.h.


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