Arxx::DataRepository Class Reference

#include <DataRepository.h>

List of all members.


Detailed Description

This class is a global player helping Arxx::Item and Arxx::Archive objectst to fetch their data.


Public Member Functions

 DataRepository (void)
 DataRepository default constructor.
bool bRegisterDataChannel (Arxx::DataChannel *pDataChannel)
 Register a data channel to be used by the fetching algorithm.
bool bUnregisterDataChannel (Arxx::DataChannel *pDataChannel)
 Unregister a data channel from the repository.
bool bFetchData (const Arxx::URI &URI, Arxx::Buffer &Buffer, Arxx::FetchStatus &FetchStatus)
 Fetches data from a URI using the most specific DataChannel object.
void vReferenceDataChannel (const Arxx::URI &URI)
 References the data channel matching the URI.
void vDereferenceDataChannel (const Arxx::URI &URI)
 Dereferences the data channel matching the URI.
bool bHasDataChannel (const Arxx::URI &URI)
 Returns whether a channel for this URI is registered in the repository.
const Arxx::DataChannelpGetDataChannel (const Arxx::URI &URI)
 Returns the DataChannel object matching the given URI.

Private Member Functions

std::map< Arxx::URI, Arxx::DataChannel
* >::iterator 
iGetDataChannel (const Arxx::URI &URI)
 Helper function to retrieve the channel object nearest an applicable to the URI.

Private Attributes

std::map< Arxx::URI, Arxx::DataChannel * > m_DataChannels
 The registered DataChannel objects, mapped by URI.


Constructor & Destructor Documentation

Arxx::DataRepository::DataRepository ( void   ) 

DataRepository default constructor.


Member Function Documentation

bool Arxx::DataRepository::bFetchData ( const Arxx::URI URI,
Arxx::Buffer Buffer,
Arxx::FetchStatus FetchStatus 
)

Fetches data from a URI using the most specific DataChannel object.

Parameters:
URI The URI used to identify the DataChannel for fetching.
Buffer The Buffer to which the data is written upon fetching.
FetchStatus This variable will be updated with the status of the fetching process.
Returns:
A boolean value indicating whether the fetch was successful.

bool Arxx::DataRepository::bHasDataChannel ( const Arxx::URI URI  ) 

Returns whether a channel for this URI is registered in the repository.

Parameters:
URI THe URI for which the data channel is searched.
This function uses the same matching algorithm as vReferenceDataChannel(), vDereferenceDataChannel() and vFetchData(). It does not check for an exact match.

bool Arxx::DataRepository::bRegisterDataChannel ( Arxx::DataChannel pDataChannel  ) 

Register a data channel to be used by the fetching algorithm.

bool Arxx::DataRepository::bUnregisterDataChannel ( Arxx::DataChannel pDataChannel  ) 

Unregister a data channel from the repository.

std::map< Arxx::URI, Arxx::DataChannel * >::iterator Arxx::DataRepository::iGetDataChannel ( const Arxx::URI URI  )  [private]

Helper function to retrieve the channel object nearest an applicable to the URI.

Parameters:
URI The URI for which the lookup and matching is performed.

Todo:
This DEFINITELY has to be done a better way. Why use a map when we have to walk it all.

const Arxx::DataChannel * Arxx::DataRepository::pGetDataChannel ( const Arxx::URI URI  ) 

Returns the DataChannel object matching the given URI.

Since the DataChannel object is const this function is only for testing puposes.

void Arxx::DataRepository::vDereferenceDataChannel ( const Arxx::URI URI  ) 

Dereferences the data channel matching the URI.

void Arxx::DataRepository::vReferenceDataChannel ( const Arxx::URI URI  ) 

References the data channel matching the URI.


Member Data Documentation

std::map< Arxx::URI, Arxx::DataChannel * > Arxx::DataRepository::m_DataChannels [private]

The registered DataChannel objects, mapped by URI.


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