Objective Systems, Inc.  
Home
About ASN.1
Products
Free Software
Documents
Services
Resources
Resellers
Customers
Careers
About Us
Contact Us
 

Google


Objective Systems, Inc.

OSContext Class Reference

Reference counted context class. More...

#include <rtxCppContext.h>

List of all members.

Public Member Functions

 OSContext ()
 The default constructor initializes the mCtxt member variable and sets the reference count variable (mCount) to zero.
 ~OSContext ()
 The destructor frees all memory held by the context.
OSCTXT * getPtr ()
 The getPtr method returns a pointer to the mCtxt member variable.
OSUINT32 getRefCount ()
 The getRefCount method returns the current reference count.
int getStatus () const
 The getStatus method returns the runtime status code value.
OSBOOL isInitialized ()
 Returns TRUE, if initialized correctly, FALSE otherwise.
void _ref ()
 The _ref method increases the reference count by one.
void _unref ()
 The _unref method decreases the reference count by one.
char * getErrorInfo ()
 Returns error text in a dynamic memory buffer.
char * getErrorInfo (size_t *pBufSize)
 Returns error text in a dynamic memory buffer.
char * getErrorInfo (char *pBuf, size_t &bufSize)
 Returns error text in a memory buffer.
void * memAlloc (size_t numocts)
 The memAlloc method allocates memory using the C runtime memory management functions.
void * memRealloc (void *ptr, size_t oldnumocts, size_t numocts)
 The memRealloc method reallocates memory using the C runtime memory management functions.
void memFreePtr (void *ptr)
 The memFreePtr method frees the memory at a specific location.
void printErrorInfo ()
 The printErrorInfo method prints information on errors contained within the context.
void resetErrorInfo ()
 The resetErrorInfo method resets information on errors contained within the context.
void setDiag (OSBOOL value=TRUE)
 The setDiag method will turn diagnostic tracing on or off.

Protected Attributes

OSCTXT mCtxt
 The mCtxt member variable is a standard C runtime context variable used in most C runtime function calls.
OSUINT32 mCount
 The mCount member variable holds the reference count of this context.
OSBOOL mbInitialized
 TRUE, if initialized correctly, FALSE otherwise.


Detailed Description

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.

Definition at line 57 of file rtxCppContext.h.


Member Function Documentation

char* OSContext::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 []'.

Parameters:
pBuf A pointer to a destination buffer to obtain the error text. If NULL, dynamic buffer will be allocated.
bufSize A reference to buffer size. If pBuf is NULL it will receive the size of allocated dynamic buffer.
Returns:
A pointer to a buffer with error text. If pBuf is not NULL, the return pointer will be equal to it. Otherwise, returns newly allocated buffer with error text. NULL, if error occured.

char* OSContext::getErrorInfo size_t *  pBufSize  ) 
 

Returns error text in a dynamic memory buffer.

Buffer will be allocated by 'operator new []'. The calling routine is responsible to free the memory by using 'operator delete []'.

Parameters:
pBufSize A pointer to buffer size.It will receive the size of allocated dynamic buffer.
Returns:
A pointer to a newly allocated buffer with error text.

char* OSContext::getErrorInfo  ) 
 

Returns error text in a dynamic memory buffer.

Buffer will be allocated by 'operator new []'. The calling routine is responsible to free the memory by using 'operator delete []'.

Returns:
A pointer to a newly allocated buffer with error text.

OSCTXT* OSContext::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.

Definition at line 94 of file rtxCppContext.h.

int OSContext::getStatus  )  const [inline]
 

The getStatus method returns the runtime status code value.

Returns:
Runtime status code:
  • 0 = success,
  • negative return value is error.

Definition at line 107 of file rtxCppContext.h.

OSBOOL OSContext::isInitialized  )  [inline]
 

Returns TRUE, if initialized correctly, FALSE otherwise.

Returns:
TRUE, if initialized correctly, FALSE otherwise.

Definition at line 115 of file rtxCppContext.h.

void* OSContext::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.

Parameters:
numocts - Number of bytes of memory to allocate

Definition at line 174 of file rtxCppContext.h.

void OSContext::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.

Parameters:
ptr - Pointer to a block of memory allocated with memAlloc

Definition at line 200 of file rtxCppContext.h.

void* OSContext::memRealloc void *  ptr,
size_t  oldnumocts,
size_t  numocts
[inline]
 

The memRealloc method reallocates memory using the C runtime memory management functions.

Parameters:
ptr - Original pointer containing dynamic memory to be resized.
oldnumocts - Number of bytes of memory already allocated
numocts - Number of bytes of memory to allocate
Returns:
Reallocated memory pointer

Definition at line 188 of file rtxCppContext.h.

void OSContext::setDiag OSBOOL  value = TRUE  )  [inline]
 

The setDiag method will turn diagnostic tracing on or off.

Parameters:
value - Boolean value (default = TRUE = on)

Definition at line 225 of file rtxCppContext.h.


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

This file was last modified on 8 Jan 2007.
XBinder, Version 1.1.9