OSRTStream Class Reference
#include <OSRTStream.h>
Inheritance diagram for OSRTStream:

Detailed Description
The default base class for using I/O streams. This class may be subclassed, as in the case of OSRTInputStream and OSRTOutputStream or other custom implementations.
Public Member Functions | |
| virtual | ~OSRTStream () |
| virtual int | close () |
| virtual int | flush () |
| virtual OSRTCtxtPtr | getContext () |
| virtual OSCTXT * | getCtxtPtr () |
| virtual char * | getErrorInfo () |
| virtual char * | getErrorInfo (char *pBuf, size_t &bufSize) |
| int | getStatus () const |
| OSBOOL | isInitialized () |
| virtual OSBOOL | isOpened () |
| void | printErrorInfo () |
| void | resetErrorInfo () |
Protected Member Functions | |
| OSRTStream (OSRTContext *pContext, OSBOOL attachStream=FALSE) | |
| OSRTStream (OSRTStream &original) | |
| OSRTStream () | |
| char * | getErrorInfo (size_t *pBufSize) |
Protected Attributes | |
| OSBOOL | mbAttached |
| int | mStatus |
| int | mInitStatus |
Constructor & Destructor Documentation
| OSRTStream::OSRTStream | ( | ) | [protected] |
The default constructor. It initializes a buffered stream. A buffered stream maintains data in memory before reading or writing to the device. This generally provides better performance than an unbuffered stream.
| virtual OSRTStream::~OSRTStream | ( | ) | [virtual] |
Virtual destructor. Closes the stream if it was opened.
Member Function Documentation
| virtual int OSRTStream::close | ( | ) | [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
Reimplemented in OSRTInputStream, and OSRTOutputStream.
| virtual int OSRTStream::flush | ( | ) | [virtual] |
Flushes the buffered data to the stream.
- Returns:
- Completion status of operation:
- 0 = success,
- negative return value is error.
- See also:
- rtxStreamFlush
Reimplemented in OSRTInputStream, and OSRTOutputStream.
| virtual OSRTCtxtPtr OSRTStream::getContext | ( | ) | [inline, virtual] |
This method returns a pointer to the underlying OSRTContext object.
- Returns:
- A reference-counted pointer to an OSRTContext object. The OSRTContext object will not be released until all referenced-counted pointer variables go out of scope. This allows safe sharing of the context between different run-time classes.
Reimplemented in OSRTInputStream, and OSRTOutputStream.
| virtual OSCTXT* OSRTStream::getCtxtPtr | ( | ) | [inline, virtual] |
This method returns a pointer to the underlying OSCTXT object. This is the structure used in calls to low-level C encode/decode functions.
- Returns:
- Pointer to a context (OSCTXT) structure.
Reimplemented in OSRTInputStream, and OSRTOutputStream.
| virtual char* OSRTStream::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.
Reimplemented in OSRTInputStream, and OSRTOutputStream.
| virtual char* OSRTStream::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.
Reimplemented in OSRTInputStream, and OSRTOutputStream.
| int OSRTStream::getStatus | ( | ) | const [inline] |
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.
- Returns:
- Runtime status code:
- 0 = success,
- negative return value is error.
Reimplemented in OSRTInputStream, and OSRTOutputStream.
| virtual OSBOOL OSRTStream::isOpened | ( | ) | [virtual] |
Checks, is the stream opened or not.
- Returns:
- TRUE, if the stream is opened, FALSE otherwise.
- See also:
- rtxStreamIsOpened
Reimplemented in OSRTInputStream, and OSRTOutputStream.
| void OSRTStream::printErrorInfo | ( | ) | [inline] |
The printErrorInfo method prints information on errors contained within the context.
Reimplemented in OSRTInputStream, and OSRTOutputStream.
| void OSRTStream::resetErrorInfo | ( | ) | [inline] |
The resetErrorInfo method resets information on errors contained within the context.
Reimplemented in OSRTInputStream, and OSRTOutputStream.
Member Data Documentation
OSBOOL OSRTStream::mbAttached [protected] |
Flag, TRUE for "attached" streams.
int OSRTStream::mStatus [protected] |
Last stream operation status.
int OSRTStream::mInitStatus [protected] |
Initialization status. 0 if initialized successfully.
The documentation for this class was generated from the following file:
