class OSRTContext |
Reference counted context class. This keeps track of all encode/decode function variables between function invocations. It is reference counted to allow a message buffer and type class to share access to it.
Public Member Functions | |
---|---|
OSRTContext () | |
~OSRTContext () | |
EXTRTMETHOD void | _ref () |
EXTRTMETHOD void | _unref () |
EXTRTMETHOD char * | getErrorInfo () |
EXTRTMETHOD char * | getErrorInfo ( size_t *) |
EXTRTMETHOD char * | getErrorInfo (char *, size_t &) |
OSCTXT * | getPtr () |
const OSCTXT * | getPtr () |
EXTRTMETHOD OSUINT32 | getRefCount () |
int | getStatus () |
OSBOOL | isInitialized () |
void * | memAlloc ( size_t ) |
void | memFreeAll () |
void | memFreePtr (void *) |
void * | memRealloc (void *, size_t ) |
void | memReset () |
void | printErrorInfo () |
void | resetErrorInfo () |
OSBOOL | setDiag ( OSBOOL ) |
EXTRTMETHOD int | setRunTimeKey (const OSOCTET *, size_t ) |
int | setStatus (int) |
Private Member Functions | |
---|---|
OSRTContext ( OSCTXT *) |
Protected Attributes | |
---|---|
OSUINT32 | mCount |
OSCTXT | mCtxt |
int | mStatus |
OSBOOL | mbInitialized |
EXTRTMETHOD | OSRTContext | ( | ) |
The default constructor initializes the mCtxt member variable and sets the reference count variable (mCount) to zero.
EXTRTMETHOD | ~OSRTContext | ( | ) | [virtual] |
The destructor frees all memory held by the context.
EXTRTMETHOD char * | getErrorInfo | ( | ) |
Returns error text in a dynamic memory buffer. Buffer will be allocated using 'operator new []'. The calling routine is responsible for freeing the memory by using 'operator delete []'.
EXTRTMETHOD char * | getErrorInfo | ( | size_t * | pBufSize | ) |
Returns error text in a dynamic memory buffer. Buffer will be allocated using 'operator new []'. The calling routine is responsible for freeing the memory by using 'operator delete []'.
size_t * pBufSize | A pointer to buffer size. It will receive the size of allocated dynamic buffer, or (size_t)-1 if an error occurred. |
EXTRTMETHOD char * | getErrorInfo | ( | char * | pBuf, |
size_t & | bufSize | |||
) |
Returns error text in a memory buffer. If buffer pointer is specified in parameters (not NULL) then error text will be copied in the passed buffer. Otherwise, this method allocates memory using the 'operator new []' function. The calling routine is responsible to free the memory by using 'operator delete []'.
char * pBuf | A pointer to a destination buffer to obtain the error text. If NULL, dynamic buffer will be allocated. |
size_t & bufSize | A reference to buffer size. If pBuf is NULL it will receive the size of allocated dynamic buffer. |
OSCTXT * | getPtr | ( | ) | [inline] |
The getPtr method returns a pointer to the mCtxt member variable. A user can use this function to get the the context pointer variable for use in a C runtime function call.
EXTRTMETHOD OSUINT32 | getRefCount | ( | ) |
The getRefCount method returns the current reference count.
int | getStatus | ( | ) | const [inline] |
The getStatus method returns the runtime status code value.
OSBOOL | isInitialized | ( | ) | [inline] |
Returns TRUE, if initialized correctly, FALSE otherwise.
void * | memAlloc | ( | size_t | numocts | ) | [inline] |
The memAlloc method allocates memory using the C runtime memory management functions. The memory is tracked in the underlying context structure. When both this OSXSDGlobalElement derived control class object and the message buffer object are destroyed, this memory will be freed.
size_t numocts | - Number of bytes of memory to allocate |
void | memFreeAll | ( | ) | [inline] |
The memFreeAll method will free all memory currently tracked within the context. This includes all memory allocated with the memAlloc method as well as any memory allocated using the C rtxMemAlloc function with the context returned by the getCtxtPtr method.
void | memFreePtr | ( | void * | ptr | ) | [inline] |
The memFreePtr method frees the memory at a specific location. This memory must have been allocated using the memAlloc method described earlier.
void * ptr | - Pointer to a block of memory allocated with memAlloc |
void * | memRealloc | ( | void * | ptr, |
size_t | numocts | |||
) | [inline] |
The memRealloc method reallocates memory using the C runtime memory management functions.
void * ptr | - Original pointer containing dynamic memory to be resized. |
size_t numocts | - Number of bytes of memory to allocate |
void | memReset | ( | ) | [inline] |
The memReset method resets dynamic memory using the C runtime memory management functions.
void | printErrorInfo | ( | ) | [inline] |
The printErrorInfo method prints information on errors contained within the context.
void | resetErrorInfo | ( | ) | [inline] |
The resetErrorInfo method resets information on errors contained within the context.
OSBOOL | setDiag | ( | OSBOOL | value = TRUE | ) | [inline] |
The setDiag method will turn diagnostic tracing on or off.
OSBOOL value = TRUE | - Boolean value (default = TRUE = on) |
EXTRTMETHOD int | setRunTimeKey | ( | const OSOCTET * | key, |
size_t | keylen | |||
) | [virtual] |
This method sets run-time key to the context. This method does nothing for unlimited redistribution libraries.
int | setStatus | ( | int | stat | ) | [inline] |
This method sets error status in the context.
int stat | Status value. |
OSUINT32 | mCount | [protected] |
The mCount member variable holds the reference count of this context.
OSCTXT | mCtxt | [protected] |
The mCtxt member variable is a standard C runtime context variable used in most C runtime function calls.
int | mStatus | [protected] |
The mStatus variable holds the return status from C run-time function calls. The getStatus method will either return this status or the last status on the context error list.
OSBOOL | mbInitialized | [protected] |
TRUE, if initialized correctly, FALSE otherwise
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.