FDO API Reference Feature Data Objects
Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

FdoIoObjectStreamReader< T > Class Template Reference

#include <ObjectStreamReader.h>

Inherits FdoIStreamReaderTmpl< T >< T >.

Inheritance diagram for FdoIoObjectStreamReader< T >:

[legend]
List of all members.

Detailed Description

template<typename T>
class FdoIoObjectStreamReader< T >

FdoIoObjectStreamReader is the template for all readers on FdoIoStream. Readers for various sized objects or primitive types can be based on this class.

Definition at line 29 of file ObjectStreamReader.h.


Public Member Functions

virtual FDO_API_COMMON FdoInt64 GetIndex ()
 Gets the current stream position. Position is measured by number of items from the stream start.
virtual FDO_API_COMMON FdoInt64 GetLength ()
 Gets the stream length.
virtual FDO_API_COMMON FdoInt32 ReadNext (FdoArray< T > *&buffer, const FdoInt32 offset=0, const FdoInt32 count=-1)
 Reads in the next block of items. Use ReadNext( buffer) to read in the entire stream. The caller is responsible to create/dispose the FdoArray.
virtual FDO_API_COMMON FdoInt32 ReadNext (T *buffer, const FdoInt32 offset=0, const FdoInt32 count=-1)
 Reads in the next block of items. Use ReadNext( buffer) to read in the entire stream. The caller is responsible to allocate a buffer large enough to store data.
virtual FDO_API_COMMON void Reset ()
 Reset the current index to the stream start. Allows re-reading.
virtual FDO_API_COMMON void Skip (const FdoInt32 offset)
 Skips a number of items.

Protected Member Functions

 FdoIoObjectStreamReader (FdoIoStream *stream)
 FdoIoObjectStreamReader ()
 DOXYGEN-IGNORE
 ~FdoIoObjectStreamReader ()

Constructor & Destructor Documentation

template<typename T>
FdoIoObjectStreamReader< T >::FdoIoObjectStreamReader  )  [inline, protected]
 

DOXYGEN-IGNORE

Definition at line 249 of file ObjectStreamReader.h.

template<typename T>
FdoIoObjectStreamReader< T >::FdoIoObjectStreamReader FdoIoStream stream  )  [inline, protected]
 

Definition at line 251 of file ObjectStreamReader.h.

template<typename T>
FdoIoObjectStreamReader< T >::~FdoIoObjectStreamReader  )  [inline, protected]
 

Definition at line 257 of file ObjectStreamReader.h.


Member Function Documentation

template<typename T>
virtual FDO_API_COMMON FdoInt64 FdoIoObjectStreamReader< T >::GetIndex  )  [inline, virtual]
 

Gets the current stream position. Position is measured by number of items from the stream start.

Returns:
Returns the current index in the stream

Implements FdoIStreamReaderTmpl< T >.

Definition at line 66 of file ObjectStreamReader.h.

Referenced by FdoIoObjectStreamReader< FdoByte >::ReadNext().

template<typename T>
virtual FDO_API_COMMON FdoInt64 FdoIoObjectStreamReader< T >::GetLength  )  [inline, virtual]
 

Gets the stream length.

Returns:
Returns the size of the data source in number of items

Return the number of objects (floor if #bytes/object size) Partial objects at end of stream are ignored.

Implements FdoIStreamReaderTmpl< T >.

Definition at line 38 of file ObjectStreamReader.h.

Referenced by FdoIoObjectStreamReader< FdoByte >::ReadNext().

template<typename T>
virtual FDO_API_COMMON FdoInt32 FdoIoObjectStreamReader< T >::ReadNext FdoArray< T > *&  buffer,
const FdoInt32  offset = 0,
const FdoInt32  count = -1
[inline, virtual]
 

Reads in the next block of items. Use ReadNext( buffer) to read in the entire stream. The caller is responsible to create/dispose the FdoArray.

Parameters:
buffer Input array holding data read in.
offset Input index in the array indicating the beginning of the output buffer. If zero, then the buffer is reused. If the end of the buffer, then read in appending mode. Throws "out-of-bounds" exception if not in this range.
count Input number of items to be read in. If -1 read the entire stream. Throws "out-of-bounds" exception if not a positive value or -1.
Returns:
Returns the number of items actually read in. When 0 (zero) then the end-of-stream was reached.

Implements FdoIStreamReaderTmpl< T >.

Definition at line 200 of file ObjectStreamReader.h.

template<typename T>
virtual FDO_API_COMMON FdoInt32 FdoIoObjectStreamReader< T >::ReadNext T *  buffer,
const FdoInt32  offset = 0,
const FdoInt32  count = -1
[inline, virtual]
 

Reads in the next block of items. Use ReadNext( buffer) to read in the entire stream. The caller is responsible to allocate a buffer large enough to store data.

Parameters:
buffer Output array holding data read in.
offset Input index in the array indicating the beginning of the output buffer. If zero, then the buffer is reused. If the end of the buffer, then read in appending mode. Throws "out-of-bounds" exception if not in this range.
count Input number of items to be read in. If -1 read the entire stream. Throws "out-of-bounds" exception if not a positive value or -1.
Returns:
Returns the number of items actually read in. When 0 (zero) then the end-of-stream was reached.

If the stream provides context information then calculate how many items are left to read.

Items that will be read is lessor of items to read and items remaining. This ensures that we don't read any partial item at the end of the stream.

Implements FdoIStreamReaderTmpl< T >.

Definition at line 112 of file ObjectStreamReader.h.

Referenced by FdoIoObjectStreamReader< FdoByte >::ReadNext().

template<typename T>
virtual FDO_API_COMMON void FdoIoObjectStreamReader< T >::Reset  )  [inline, virtual]
 

Reset the current index to the stream start. Allows re-reading.

Implements FdoIStreamReaderTmpl< T >.

Definition at line 88 of file ObjectStreamReader.h.

template<typename T>
virtual FDO_API_COMMON void FdoIoObjectStreamReader< T >::Skip const FdoInt32  offset  )  [inline, virtual]
 

Skips a number of items.

Parameters:
offset Input number of items to skip

Implements FdoIStreamReaderTmpl< T >.

Definition at line 54 of file ObjectStreamReader.h.


The documentation for this class was generated from the following file:
Comments or suggestions? Send us feedback.