VetsUtil base class.
More...
#include <MyBase.h>
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.
typedef void(* VetsUtil::MyBase::DiagMsgCB_T) (const char *msg) |
typedef void(* VetsUtil::MyBase::ErrMsgCB_T) (const char *msg, int err_code) |
VetsUtil::MyBase::MyBase |
( |
| ) |
|
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] | enable | Boolean flag to enable or disable error reporting |
Definition at line 242 of file MyBase.h.
const string& VetsUtil::MyBase::getClassName |
( |
| ) |
const |
|
inline |
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
-
msg | A pointer to null-terminated string. |
Definition at line 189 of file MyBase.h.
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 |
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
-
msg | A 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 |
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] | format | A '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] | cb | A 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] | fp | A 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 |
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] | format | A '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] | errcode | A application-defined error code |
[in] | format | A '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] | cb | A 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] | fp | A 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 |
char* VetsUtil::MyBase::DiagMsg |
|
static |
FILE* VetsUtil::MyBase::DiagMsgFilePtr |
|
static |
int VetsUtil::MyBase::DiagMsgSize |
|
static |
bool VetsUtil::MyBase::Enabled |
|
static |
int VetsUtil::MyBase::ErrCode |
|
static |
char* VetsUtil::MyBase::ErrMsg |
|
static |
FILE* VetsUtil::MyBase::ErrMsgFilePtr |
|
static |
int VetsUtil::MyBase::ErrMsgSize |
|
static |
The documentation for this class was generated from the following file:
- /Users/clyne/src/vapor/lib/common/MyBase.h