ASN1XERDecodeStream Class Reference
[C++ classes for streaming XER decoding.]

#include <ASN1XERDecodeStream.h>

Inheritance diagram for ASN1XERDecodeStream:
ASN1XERDecodeBuffer ASN1XERMessageBuffer

List of all members.

Public Member Functions

 ASN1XERDecodeStream (OSRTInputStreamIF &is, OSBOOL openType=FALSE)
 ASN1XERDecodeStream (OSRTInputStreamIF *pis, OSBOOL bOwnStream=TRUE, OSBOOL openType=FALSE)
virtual void * getAppInfo ()
virtual OSRTCtxtPtr getContext ()
virtual OSCTXT * getCtxtPtr ()
virtual char * getErrorInfo ()
virtual char * getErrorInfo (char *pBuf, size_t &bufSize)
virtual int getStatus () const
virtual void printErrorInfo ()
virtual void resetErrorInfo ()
virtual void setAppInfo (void *pAppInfo)
virtual void setDiag (OSBOOL value=TRUE)
virtual int close ()
virtual int flush ()
virtual OSBOOL isOpened ()
virtual size_t currentPos ()
virtual OSBOOL markSupported ()
int mark (size_t readAheadLimit)
virtual long read (OSOCTET *pDestBuf, size_t maxToRead)
virtual long readBlocking (OSOCTET *pDestBuf, size_t toReadBytes)
int reset ()
virtual int skip (size_t n)
ASN1XERDecodeStreamoperator>> (ASN1CType &val)
int decodeObj (ASN1CType &val)
OSBOOL isA (Type bufferType)

Protected Attributes

OSRTInputStreamIF * mpStream
OSBOOL mbOwnStream

Detailed Description

This class is a base class for other ASN.1 XER input stream's classes. It is derived from the ASN1Stream base class. It contains variables and methods specific to streaming decoding of XER messages. It is used to manage the input stream containing the ASN.1 message to be decoded.


Constructor & Destructor Documentation

ASN1XERDecodeStream::ASN1XERDecodeStream ( OSRTInputStreamIF &  is,
OSBOOL  openType = FALSE 
)

A default constructor. Use getStatus() method to determine has error occured during the initialization or not.


Member Function Documentation

virtual int ASN1XERDecodeStream::close (  )  [inline, virtual]

Closes the input or output stream and releases any system resources associated with the stream. For output streams this function also flushes all internal buffers to the stream.

Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.
See also:
rtxStreamClose
virtual size_t ASN1XERDecodeStream::currentPos (  )  [inline, virtual]

This method returns the current position in the stream (in octets).

Returns:
The number of octets already read from the stream.
int ASN1XERDecodeStream::decodeObj ( ASN1CType &  val  ) 

This method decodes an ASN.1 constructed object from the stream.

Parameters:
val A reference to an object to be decoded.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.
virtual int ASN1XERDecodeStream::flush (  )  [inline, virtual]

Flushes the buffered data to the stream.

Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.
See also:
rtxStreamFlush
virtual void* ASN1XERDecodeStream::getAppInfo (  )  [inline, virtual]

Returns a pointer to application-specific information block

virtual OSRTCtxtPtr ASN1XERDecodeStream::getContext (  )  [inline, virtual]

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

Returns:
Context smart pointer object.
virtual OSCTXT* ASN1XERDecodeStream::getCtxtPtr (  )  [inline, 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.
virtual char* ASN1XERDecodeStream::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:
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.
virtual char* ASN1XERDecodeStream::getErrorInfo (  )  [inline, 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.
virtual int ASN1XERDecodeStream::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. 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.
OSBOOL ASN1XERDecodeStream::isA ( Type  bufferType  )  [virtual]

This method matches an enumerated identifier defined in the base class. One identifier is declared for each of the derived classes.

Parameters:
bufferType Enumerated identifier specifying a derived class. This type is defined as a public access type in the ASN1MessageBufferIF base interface. Possible values are: BEREncode, BERDecode, PEREncode, PERDecode, XEREncode, XERDecode, XMLEncode, XMLDecode, Stream.
Returns:
Boolean result of the match operation. True if this is the class corresponding to the identifier argument.

Reimplemented from ASN1XERDecodeBuffer.

virtual OSBOOL ASN1XERDecodeStream::isOpened (  )  [inline, virtual]

Checks, is the stream opened or not.

Returns:
TRUE, if the stream is opened, FALSE otherwise.
See also:
rtxStreamIsOpened
int ASN1XERDecodeStream::mark ( size_t  readAheadLimit  )  [inline]

This method marks the current position in this input stream. A subsequent call to the ASN1XERDecodeStream::reset function repositions this stream at the last marked position so that subsequent reads re-read the same bytes. The readAheadLimit argument tells this input stream to allow that many bytes to be read before the mark position gets invalidated.

Parameters:
readAheadLimit the maximum limit of bytes that can be read before the mark position becomes invalid.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.
See also:
rtxStreamBufMark, rtxStreamBufReset
virtual OSBOOL ASN1XERDecodeStream::markSupported (  )  [inline, virtual]

Tests if this input stream supports the mark and reset methods. Whether or not mark and reset are supported is an invariant property of a particular input stream instance. By default, it returns FALSE.

Returns:
TRUE if this stream instance supports the mark and reset methods; FALSE otherwise.
See also:
rtxStreamIsMarkSupported
ASN1XERDecodeStream& ASN1XERDecodeStream::operator>> ( ASN1CType &  val  ) 

Decodes an ASN.1 constructed object from the stream. Use getStatus() method to determine has error occured during the operation or not.

Parameters:
val A reference to an object to be decoded.
Returns:
reference to this class to perform sequential decoding.
virtual void ASN1XERDecodeStream::printErrorInfo (  )  [inline, virtual]

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

virtual long ASN1XERDecodeStream::read ( OSOCTET *  pDestBuf,
size_t  maxToRead 
) [inline, virtual]

Read data from the stream. This method reads up to maxToRead bytes from the stream. It may return a value less then this if the mamimum number of bytes is not available.

Parameters:
pDestBuf Pointer to a buffer to receive a data.
maxToRead Size of the buffer.
Returns:
The total number of octets read into the buffer, or negative value with error code if any error is occurred.
See also:
rtxStreamRead
virtual long ASN1XERDecodeStream::readBlocking ( OSOCTET *  pDestBuf,
size_t  toReadBytes 
) [inline, virtual]

Read data from the stream. This method reads up to maxToRead bytes from the stream. It may return a value less then this if the mamimum number of bytes is not available.

Parameters:
pDestBuf Pointer to a buffer to receive a data.
toReadBytes Number of bytes to be read.
Returns:
The total number of octets read into the buffer, or negative value with error code if any error is occurred.
See also:
rtxStreamRead
int ASN1XERDecodeStream::reset (  )  [inline]

Repositions this stream to the position at the time the mark method was last called on this input stream.

Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.
See also:
rtxStreamBufMark, rtxStreamBufReset
virtual void ASN1XERDecodeStream::resetErrorInfo (  )  [inline, virtual]

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

virtual void ASN1XERDecodeStream::setAppInfo ( void *  pAppInfo  )  [inline, virtual]

Sets the application-specific information block.

virtual void ASN1XERDecodeStream::setDiag ( OSBOOL  value = TRUE  )  [inline, virtual]

The setDiag method will turn diagnostic tracing on or off.

Parameters:
value - Boolean value (default = TRUE = on)
virtual int ASN1XERDecodeStream::skip ( size_t  n  )  [inline, virtual]

Skips over and discards the specified amount of data octets from this input stream.

Parameters:
n The number of octets to be skipped.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.
See also:
rtxStreamSkip

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