OSRTCtxtHolder Class Reference
Abstract message buffer or stream interface class. More...
#include <OSRTCtxtHolder.h>
Inheritance diagram for OSRTCtxtHolder:
![](classOSRTCtxtHolder.png)
Public Member Functions | |
virtual EXTRTMETHOD OSRTCtxtPtr | getContext () |
The getContext method returns the underlying context smart-pointer object. | |
virtual EXTRTMETHOD OSCTXT * | getCtxtPtr () |
The getCtxtPtr method returns the underlying C runtime context. | |
virtual EXTRTMETHOD char * | getErrorInfo () |
Returns error text in a dynamic memory buffer. | |
virtual EXTRTMETHOD char * | getErrorInfo (char *pBuf, size_t &bufSize) |
Returns error text in a memory buffer. | |
virtual EXTRTMETHOD int | getStatus () const |
This method returns the completion status of previous operation. | |
virtual EXTRTMETHOD void | printErrorInfo () |
The printErrorInfo method prints information on errors contained within the context. | |
virtual EXTRTMETHOD void | resetErrorInfo () |
The resetErrorInfo method resets information on errors contained within the context. | |
Protected Member Functions | |
EXTRTMETHOD | OSRTCtxtHolder (OSRTContext *pContext=0) |
The protected constructor creates a new context and sets the buffer class type. | |
virtual | ~OSRTCtxtHolder () |
Protected Attributes | |
OSRTCtxtPtr | mpContext |
The mpContext member variable holds a reference-counted C runtime variable. |
Detailed Description
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.
Definition at line 38 of file OSRTCtxtHolder.h.
Constructor & Destructor Documentation
EXTRTMETHOD OSRTCtxtHolder::OSRTCtxtHolder | ( | OSRTContext * | pContext = 0 |
) | [protected] |
The protected constructor creates a new context and sets the buffer class type.
- Parameters:
-
pContext Pointer to a context to use. If NULL, new context will be allocated.
Member Function Documentation
virtual EXTRTMETHOD OSRTCtxtPtr OSRTCtxtHolder::getContext | ( | ) | [virtual] |
The getContext method returns the underlying context smart-pointer object.
- Returns:
- Context smart pointer object.
Implements OSRTCtxtHolderIF.
Reimplemented in OSRTInputStream, OSRTMessageBuffer, OSRTOutputStream, and OSRTStream.
Referenced by OSRTStream::getContext(), and OSRTMessageBuffer::getContext().
virtual EXTRTMETHOD OSCTXT* OSRTCtxtHolder::getCtxtPtr | ( | ) | [virtual] |
The getCtxtPtr method returns the underlying C runtime context.
This context can be used in calls to C runtime functions.
- Returns:
- The pointer to C runtime context.
Implements OSRTCtxtHolderIF.
Reimplemented in OSRTInputStream, OSRTMessageBuffer, OSRTOutputStream, and OSRTStream.
Referenced by OSRTMessageBuffer::getByteIndex(), OSRTStream::getCtxtPtr(), OSRTMessageBuffer::getCtxtPtr(), and OSRTMessageBuffer::getMsgPtr().
virtual EXTRTMETHOD char* OSRTCtxtHolder::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 []'.
- Returns:
- A pointer to a newly allocated buffer with error text.
Implements OSRTCtxtHolderIF.
Reimplemented in OSRTInputStream, OSRTMessageBuffer, OSRTOutputStream, and OSRTStream.
Referenced by OSRTStream::getErrorInfo(), and OSRTMessageBuffer::getErrorInfo().
virtual EXTRTMETHOD char* OSRTCtxtHolder::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:
-
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 occurred.
Implements OSRTCtxtHolderIF.
Reimplemented in OSRTInputStream, OSRTMessageBuffer, OSRTOutputStream, and OSRTStream.
virtual EXTRTMETHOD int OSRTCtxtHolder::getStatus | ( | ) | 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.
- Returns:
- Runtime status code:
- 0 (0) = success,
- negative return value is error.
Implements OSRTCtxtHolderIF.
Reimplemented in OSRTInputStream, OSRTMessageBuffer, OSRTOutputStream, and OSRTStream.
Referenced by OSRTMessageBuffer::getStatus().
Member Data Documentation
OSRTCtxtPtr OSRTCtxtHolder::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.
Definition at line 44 of file OSRTCtxtHolder.h.
The documentation for this class was generated from the following file: