OSRTMessageBuffer Class Reference

class OSRTMessageBuffer : public OSRTCtxtHolder

Abstract message buffer base class. This class is used to manage an encode or decode message buffer. For encoding, this is the buffer into which the message is being built. For decoding, it describes a message that was read into memory to be decoded. Further classes are derived from this to handle encoding and decoding of messages for different encoding rules types.

Inherits from

Constructor & Destructor Documentation

OSRTMessageBuffer(Type, OSRTContext *)

EXTRTMETHOD OSRTMessageBuffer ( Type bufferType,
OSRTContext * pContext = 0
) [protected]

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

Parameters

Type bufferType Type of message buffer that is being created (for example, XMLEncode).
OSRTContext * pContext = 0 Pointer to a context to use. If NULL, new context will be allocated.

~OSRTMessageBuffer()

~OSRTMessageBuffer ( ) [inline, virtual]

The virtual destructor does nothing. It is overridden by derived versions of this class.

Member Functions Documentation

getAppInfo()

void * getAppInfo ( ) [inline, virtual]

Returns a pointer to application-specific information block

getByteIndex()

size_t getByteIndex ( ) [inline, virtual]

The getByteIndex method is used to fetch the current byte offset within the current working buffer. For encoding, this is the next location that will be written to. For decoding, this is the next byte the parser will read.

getContext()

OSRTCtxtPtr getContext ( ) [inline, virtual]

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

getCtxtPtr()

OSCTXT * getCtxtPtr ( ) [inline, virtual]

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

getErrorInfo()

char * getErrorInfo ( ) [inline, virtual]

Returns error text in a dynamic memory buffer. The buffer is allocated using 'operator new []'. The calling routine is responsible to free the memory by using 'operator delete []'.

getErrorInfo(char *, size_t &)

char * getErrorInfo ( char * pBuf,
size_t & bufSize
) [inline, 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 * 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.

getMsgCopy()

OSOCTET * getMsgCopy ( ) [inline, virtual]

The getMsgCopy method will return a copy of the encoded message managed by the object.

getMsgPtr()

const OSOCTET * getMsgPtr ( ) [inline, virtual]

The getMsgPtr method will return a const pointer to the encoded message managed by the object.

getStatus()

int getStatus ( ) const [inline, 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.

init()

int init ( ) [inline, virtual]

Initializes message buffer.

initBuffer(OSOCTET *, size_t)

EXTRTMETHOD int initBuffer ( OSOCTET * pMsgBuf,
size_t msgBufLen
) [virtual]

This version of the overloaded initBuffer method initializes the message buffer to point at the given null-terminated character string.

Parameters

OSOCTET * pMsgBuf Pointer to message buffer.
size_t msgBufLen Length of message buffer in bytes.

printErrorInfo()

void printErrorInfo ( ) [inline, virtual]

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

resetErrorInfo()

void resetErrorInfo ( ) [inline, virtual]

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

setAppInfo(void *)

void setAppInfo ( void * ) [inline, virtual]

Sets the application-specific information block.

Parameters

void *

setDiag(OSBOOL)

EXTRTMETHOD void setDiag ( OSBOOL value = TRUE ) [virtual]

The setDiag method will turn diagnostic tracing on or off.

Parameters

OSBOOL value = TRUE - Boolean value (default = TRUE = on)

Member Data Documentation

Type mBufferType

Type mBufferType [protected]

The mBufferType member variable holds information on the derived message buffer class type (for example, XMLEncode).