#include <lt_utilStatusData.h>
Static Public Member Functions | |
static LT_STATUS | initialize () |
initialize the error stack | |
static LT_STATUS | terminate () |
cleanup | |
static bool | isActive () |
static void | pushBegin (LT_STATUS status) |
static void | pushContext (LT_STATUS status, const char *context) |
static void | pushUint32 (lt_uint32 value) |
static void | pushInt32 (lt_int32 value) |
static void | pushString (const char *value) |
static void | pushDouble (double value) |
static void | pushFileSpec (const LTFileSpec &value) |
static void | pushEnd () |
static LT_STATUS | popBegin (LT_STATUS &status) |
static LT_STATUS | popContext (const char *&context) |
static LT_STATUS | popString (char *&value) |
static LT_STATUS | popEnd () |
static void | clear () |
This error management system is expected to be substantially changed in a future release.
// IN APPLICATION LTUtilStatus::initialize(); ... // IN SOME LIBRARY LT_STATUS sts = someFunction("foo.txt",99); if (!LT_SUCCESS(sts)) { LTUtilStatusData::pushBegin(sts); LTUtilStatusData::pushString("foo.txt"); LTUtilStatusData::pushEnd(); return sts; } ... // IN LT_LIB_UTILS LT_STATUS sts; char* str; int i; LTUtilStatusData::popBegin(sts); // parse string for code sts to determine needed data items... LTUtilStatusData::popString(str); LTUtilStatusData::popInt32(i); LTUtilStatusData::popEnd(); ... // IN APPLICATION LTUtilStatusData::terminate(); *
To set error data, you must first do pushBegin(), then push zero or more other data items (called Records), then do a pushEnd().
To retrieve error data, you must first do a popBegin(), followed by pops of whatever you pushed, then do a popEnd().
Note it is assumed the popper knows the order and type of things to be popped off. (This is not really a problem, since the status code is associated with a string which will contain d, s, etc telling him what to do. Furthermore, the only person who should ever need to use the pop calls will be lt_lib_statusStrings.)
If you do not call initialize(), the push and pop operations will do nothing. This way, apps need not use the StatusData system if they do not wish to.
Definition at line 96 of file lt_utilStatusData.h.
static LT_STATUS LTUtilStatusData::initialize | ( | ) | [static] |
Applications should call this once prior to any other LizardTech functions, to enable the error reporting system. If not called, then any calls to pushData() will be no-ops, and the integral status code will map to an unintepretted string.
static LT_STATUS LTUtilStatusData::terminate | ( | ) | [static] |
Applications should call this once after all other LizardTech functions have been called, to clean up memory.
static bool LTUtilStatusData::isActive | ( | ) | [static] |
static void LTUtilStatusData::pushBegin | ( | LT_STATUS | status | ) | [static] |
static void LTUtilStatusData::pushContext | ( | LT_STATUS | status, | |
const char * | context | |||
) | [static] |
static void LTUtilStatusData::pushUint32 | ( | lt_uint32 | value | ) | [static] |
static void LTUtilStatusData::pushInt32 | ( | lt_int32 | value | ) | [static] |
static void LTUtilStatusData::pushString | ( | const char * | value | ) | [static] |
static void LTUtilStatusData::pushDouble | ( | double | value | ) | [static] |
static void LTUtilStatusData::pushFileSpec | ( | const LTFileSpec & | value | ) | [static] |
static void LTUtilStatusData::pushEnd | ( | ) | [static] |
static LT_STATUS LTUtilStatusData::popContext | ( | const char *& | context | ) | [static] |
static LT_STATUS LTUtilStatusData::popString | ( | char *& | value | ) | [static] |
static LT_STATUS LTUtilStatusData::popEnd | ( | ) | [static] |
static void LTUtilStatusData::clear | ( | ) | [static] |
LizardTech |