DigitalSpaces::DataResourceStreambuf Class Reference
[DataResources]

#include <ContainerImplementations.h>

Inherits std::streambuf.


Detailed Description

Provides a buffer between DIDataResource and the DataResourceIStream.

A std::vector<char> is used for internal buffering. A chunk size is specified that is how much data should be pulled through the DIDataResource at one time.

You should not use this class directly, instead use DataResourceIStream.

Note:
Due to the private constructor, you will not be able to use this directly.

Protected Member Functions

void ChangeDataResource (DIDataResource *pDataResource)
 Function that changes the data source.
void RefreshBuffer ()
 Function that fills m_localBuffer with data from m_pDataResource.
Overridden functions from std::streambuf
int uflow ()
int underflow ()
std::streambuf::pos_type seekoff (std::streambuf::off_type off, std::ios_base::seekdir way, std::ios_base::openmode which)
std::streambuf::pos_type seekpos (std::streambuf::pos_type sp, std::ios_base::openmode which)

Protected Attributes

DIDataResourcem_pDataResource
 The data source.
std::vector< char > m_localBuffer
 Storage buffer for data extracted from m_pDataResource.
const unsigned int m_bufferChunkSize
 Size of m_localBuffer.

Private Member Functions

 DataResourceStreambuf (DIDataResource *pDataResource, unsigned int bufferChunkSize)
 Constructor used by DataResourceIStream.

Friends

class DataResourceIStream

Constructor & Destructor Documentation

DigitalSpaces::DataResourceStreambuf::DataResourceStreambuf ( DIDataResource pDataResource,
unsigned int  bufferChunkSize 
) [private]

Constructor used by DataResourceIStream.


Member Function Documentation

int DigitalSpaces::DataResourceStreambuf::uflow (  )  [protected]

int DigitalSpaces::DataResourceStreambuf::underflow (  )  [protected]

std::streambuf::pos_type DigitalSpaces::DataResourceStreambuf::seekoff ( std::streambuf::off_type  off,
std::ios_base::seekdir  way,
std::ios_base::openmode  which 
) [protected]

std::streambuf::pos_type DigitalSpaces::DataResourceStreambuf::seekpos ( std::streambuf::pos_type  sp,
std::ios_base::openmode  which 
) [protected]

void DigitalSpaces::DataResourceStreambuf::ChangeDataResource ( DIDataResource pDataResource  )  [protected]

Function that changes the data source.

Note:
I see no usage of this in the implementation, not sure how the std::streambuf implementation would accept this. Probably just see the data in the new DIDataResource as a continuation of the old DIDataResource.

void DigitalSpaces::DataResourceStreambuf::RefreshBuffer (  )  [protected]

Function that fills m_localBuffer with data from m_pDataResource.


Friends And Related Function Documentation

friend class DataResourceIStream [friend]


Field Documentation

The data source.

Storage buffer for data extracted from m_pDataResource.

Note:
This may be better as a boost::array, since we never use it as a vector anyway. May be better to malloc some memory, its not ever used in any other manner.

Size of m_localBuffer.


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

Generated on Sun Aug 31 17:46:33 2008 for Digital Spaces by  doxygen 1.5.6