OSRTCtxtHolder Class Reference

class OSRTCtxtHolder : public OSRTCtxtHolderIF

Abstract message buffer or stream interface class. This is the base class for both the in-memory message buffer classes and the run-time stream classes.

Inherits from

Public Member Functions
EXTRTMETHOD OSRTCtxtPtrgetContext()
EXTRTMETHOD OSCTXT *getCtxtPtr()
EXTRTMETHOD char *getErrorInfo()
EXTRTMETHOD char *getErrorInfo(char *, size_t &)
EXTRTMETHOD intgetStatus()
EXTRTMETHOD voidprintErrorInfo()
EXTRTMETHOD voidresetErrorInfo()
Protected Member Functions
OSRTCtxtHolder(OSRTContext *)
~OSRTCtxtHolder()
Inherited Functions
OSRTCtxtHolderIF::~OSRTCtxtHolderIF()
Protected Attributes
OSRTCtxtPtr mpContext

Constructor & Destructor Documentation

OSRTCtxtHolder(OSRTContext *)

EXTRTMETHODOSRTCtxtHolder(OSRTContext *pContext = 0)[protected]

The protected constructor creates a new context and sets the buffer class type.

Parameters

OSRTContext * pContext = 0Pointer to a context to use. If NULL, new context will be allocated.

~OSRTCtxtHolder()

~OSRTCtxtHolder()[protected, inline, virtual]

Member Functions Documentation

getContext()

EXTRTMETHOD OSRTCtxtPtrgetContext()[virtual]

The getContext method returns the underlying context smart-pointer object.

getCtxtPtr()

EXTRTMETHOD OSCTXT *getCtxtPtr()[virtual]

The getCtxtPtr method returns the underlying C runtime context. This context can be used in calls to C runtime functions.

getErrorInfo()

EXTRTMETHOD char *getErrorInfo()[virtual]

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 []'.

getErrorInfo(char *, size_t &)

EXTRTMETHOD char *getErrorInfo(char *pBuf,
size_t &bufSize
)[virtual]

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

char * pBufA pointer to a destination buffer to obtain the error text. If NULL, dynamic buffer will be allocated.
size_t & bufSizeA reference to buffer size. If pBuf is NULL it will receive the size of allocated dynamic buffer.

getStatus()

EXTRTMETHOD intgetStatus()const [virtual]

This method returns the completion status of previous operation. It can be used to check completion status of constructors or methods, which do not return completion status. If error occurs, use printErrorInfo method to print out the error's description and stack trace. Method resetError can be used to reset error to continue operations after recovering from the error.

printErrorInfo()

EXTRTMETHOD voidprintErrorInfo()[virtual]

The printErrorInfo method prints information on errors contained within the context.

resetErrorInfo()

EXTRTMETHOD voidresetErrorInfo()[virtual]

The resetErrorInfo method resets information on errors contained within the context.

Member Data Documentation

OSRTCtxtPtr mpContext

OSRTCtxtPtr mpContext[protected]

The mpContext member variable holds a reference-counted C runtime variable. This context is used in calls to all C run-time functions.