MrSID Decode SDK for Raster Reference Manual  9.5.4.4709
LTUtilStatusData Class Reference

Interface to the error data stack. More...

#include <lt_utilStatusData.h>

List of all members.

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 ()

Detailed Description

This class provides functions for pushing and popping data to and from the "error stack", used to pass information to accompany a simple status code.

Note:
For most users, the functions provided in the file lt_utilStatusStrings.h are sufficient for error reporting. Only applications which need to add their own error strings or perform internationalization need to use this class.
This error management system is expected to be substantially changed in a future release.

Example usage:

// 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::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 86 of file lt_utilStatusData.h.


Member Function Documentation

static void LTUtilStatusData::clear ( ) [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.

Returns:
success or failure status code
static bool LTUtilStatusData::isActive ( ) [static]
static LT_STATUS LTUtilStatusData::popBegin ( LT_STATUS status) [static]
static LT_STATUS LTUtilStatusData::popContext ( const char *&  context) [static]
static LT_STATUS LTUtilStatusData::popEnd ( ) [static]
static LT_STATUS LTUtilStatusData::popString ( char *&  value) [static]
static void LTUtilStatusData::pushBegin ( LT_STATUS  status) [static]
static void LTUtilStatusData::pushContext ( LT_STATUS  status,
const char *  context 
) [static]
static void LTUtilStatusData::pushDouble ( double  value) [static]
static void LTUtilStatusData::pushEnd ( ) [static]
static void LTUtilStatusData::pushFileSpec ( const LTFileSpec value) [static]
static void LTUtilStatusData::pushInt32 ( lt_int32  value) [static]
static void LTUtilStatusData::pushString ( const char *  value) [static]
static void LTUtilStatusData::pushUint32 ( lt_uint32  value) [static]

Applications should call this once after all other LizardTech functions have been called, to clean up memory.

Returns:
success or failure success code

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