Arxx::LocalArchiveChannel Class Reference

#include <LocalArchiveChannel.h>

Inheritance diagram for Arxx::LocalArchiveChannel:

Inheritance graph
[legend]
Collaboration diagram for Arxx::LocalArchiveChannel:

Collaboration graph
[legend]
List of all members.

Detailed Description

An class to fetch data from a local ARX archive file.


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.


Constructor & Destructor Documentation

Arxx::LocalArchiveChannel::LocalArchiveChannel ( const Arxx::URI URI  ) 

The standard constructor for LocalArchiveChannel.

Parameters:
URI The URI of the local ARX archive file.
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.


Member Function Documentation

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.

Parameters:
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.
Returns:
A boolean value indicating whether the fetch was successful.

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().

See also:
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.


Member Data Documentation

std::ifstream Arxx::LocalArchiveChannel::m_IStream [private]

The associated file stream.

This stream is opened with the constructor and closed in vOnUnreferenced().

Arxx::u4byte Arxx::LocalArchiveChannel::m_u4DataOffset [private]

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.


The documentation for this class was generated from the following files:
Generated on Tue Oct 10 11:34:38 2006 for libarxx by  doxygen 1.4.7