#include <LocalArchiveChannel.h>
Inheritance diagram for Arxx::LocalArchiveChannel:
Public Member Functions | |
LocalArchiveChannel (const Arxx::URI &URI) | |
The standard constructor for LocalArchiveChannel. | |
virtual | ~LocalArchiveChannel (void) |
The standard deonstructor for LocalArchiveChannel. | |
std::istream & | GetStream (void) |
Returns the associated stream object. | |
void | vMarkDataOffset (void) |
Calling this function will set the data offset to the current file position. | |
virtual bool | bFetchData (const Arxx::URI &URI, Arxx::Buffer &Buffer, Arxx::FetchStatus &FetchStatus) |
This abstract function is responsible for retrieving the data and writing it into a Arxx::Item. | |
Protected Member Functions | |
void | vOnUnreferenced (void) |
Function that is called every time the reference counter goes to zero. | |
Private Attributes | |
std::ifstream | m_IStream |
The associated file stream. | |
Arxx::u4byte | m_u4DataOffset |
The file offset of the data block. |
Arxx::LocalArchiveChannel::LocalArchiveChannel | ( | const Arxx::URI & | URI | ) |
The standard constructor for LocalArchiveChannel.
This creates a LocalArchiveChannel object with zero references.
The constructor opens the file.
Arxx::LocalArchiveChannel::~LocalArchiveChannel | ( | void | ) | [virtual] |
The standard deonstructor for LocalArchiveChannel.
Only here to help debugging dangeling library sources.
bool Arxx::LocalArchiveChannel::bFetchData | ( | const Arxx::URI & | URI, | |
Arxx::Buffer & | Buffer, | |||
Arxx::FetchStatus & | FetchStatus | |||
) | [virtual] |
This abstract function is responsible for retrieving the data and writing it into a Arxx::Item.
URI | The URI of the data chunk in the local library to be retrieved by the data channel. | |
Buffer | The Arxx::Item which will be used as the target for the retrieved data. | |
FetchStatus | The fetcher object will update this variable according to the current status of the fetching process. |
Implements Arxx::DataChannel.
std::istream & Arxx::LocalArchiveChannel::GetStream | ( | void | ) |
Returns the associated stream object.
This function is called by the Archive after the stream has been opened to retrieve the library and item headers.
void Arxx::LocalArchiveChannel::vMarkDataOffset | ( | void | ) |
Calling this function will set the data offset to the current file position.
The current stream position will be written in the member variable m_u4DataOffset. Every fetch will seek to this offset plus the value of the "Offset" attribute in the sURI passed to vFetchData().
void Arxx::LocalArchiveChannel::vOnUnreferenced | ( | void | ) | [protected, virtual] |
Function that is called every time the reference counter goes to zero.
The function closes the stream object.
Reimplemented from Arxx::DataChannel.
std::ifstream Arxx::LocalArchiveChannel::m_IStream [private] |
The associated file stream.
This stream is opened with the constructor and closed in vOnUnreferenced().
The file offset of the data block.
Using this Offset the fetcher seeks to the correct position in the file to read data on vFetchData() calls.