Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

SmartDataObjectPtr Class Reference

A small class used to access easily (and efficiently) data items residing in data stores. More...

#include <SmartDataObjectPtr.h>

Inheritance diagram for SmartDataObjectPtr:

SmartDataStorePtr SmartDataLocator SmartDataPtr List of all members.

Public Types

typedef DataObject* (*  AccessFunction )(SmartDataObjectPtr* ptr)

Public Methods

 SmartDataObjectPtr (AccessFunction access, IDataProviderSvc* pService, IDataDirectory* pDir, const std::string& path)
 Standard constructor: Construct an SmartDataObjectPtr instance. More...

 SmartDataObjectPtr (const SmartDataObjectPtr& copy)
 Copy constructor: Construct an copy of a SmartDataStorePtr instance. More...

virtual ~SmartDataObjectPtr ()
 Standard Destructor. More...

virtual SmartDataObjectPtr& operator= (SmartDataObjectPtr& copy)
 Equivalence operator. More...

 operator IDataDirectory * ()
 Automatic conversion to data directory. More...

const std::string& path () const
 Path name. More...

IDataDirectorydirectory ()
 Access to data directory. More...

void setService ( IDataProviderSvc* svc )
 Assign data service. More...

IDataProviderSvcservice ()
 Retrieve data service. More...

 operator int ()
 operator int for statements like: if ( SmartDataObjectPtr<XXX>(...) ) {}. More...

bool operator! ()
 operator ! for statements like: if ( !SmartDataObjectPtr<XXX>(...) ) {}. More...

 operator void * ()
 operator int for statements like: if ( SmartDataObjectPtr<XXX>(...) ) {}. More...

 operator DataObject *& ()
 operator DataObject*&. More...

 operator DataObject ** ()
 operator DataObject**. More...

StatusCode getLastError () const
 Access to potential errors during data accesses. More...

DataObjectaccessData ()
 Static Object retrieval method: must call specific function. More...

DataObjectretrieveObject ()
 Object retrieve method. More...

DataObjectfindObject ()
 Object find method. More...

DataObjectupdateObject ()
 Object update method. More...


Static Public Methods

DataObjectretrieve (SmartDataObjectPtr* ptr)
 Static Object retrieval method. More...

DataObjectfind (SmartDataObjectPtr* ptr)
 Static Object find method. More...

DataObjectupdate (SmartDataObjectPtr* ptr)
 Static Object update method. More...


Protected Methods

StatusCode find (IDataDirectory* pDirectory, const std::string& path, DataObject*& refpObject)
 Find the specified object from the data store. More...

StatusCode find (const std::string& fullPath, DataObject*& refpObject)
 Find the specified object from the data store. More...

StatusCode retrieve (IDataDirectory* pDirectory, const std::string& path, DataObject*& refpObject)
 Retrieve the specified object from the data store. More...

StatusCode retrieve (const std::string& fullPath, DataObject*& refpObject)
 Retrieve the specified object from the data store. More...

StatusCode update (IDataDirectory* pDirectory)
 Update the specified object from the data store. More...

StatusCode update (const std::string& fullPath)
 Update the specified object from the data store. More...


Protected Attributes

IDataProviderSvcm_dataProvider
 Pointer to contained object. More...

IDataDirectorym_pDirectory
 Pointer to the data directory containing the object. More...

DataObjectm_pObject
 Pointer to contained object. More...

std::string m_path
 Path to object. More...

StatusCode m_status
 Keep track of the last error. More...

AccessFunction m_accessFunc
 Data access function. More...


Detailed Description

A small class used to access easily (and efficiently) data items residing in data stores.

The class is meant as configurable base class for real Smart pointer instances. Here mainly the access of the data store is handled. It is important to keep as less functions as possible NON-VIRTUAL in particular those, which handle the data access - they might be called very often and hence the comiler must be able to inline them.

Dependencies:

History :

    +---------+----------------------------------------------+--------+
    |    Date |                 Comment                      | Who    |
    +---------+----------------------------------------------+--------+
    | 21/04/99| Initial version.                             | MF     |
    | 04/07/99| added operator!()                           | MF     |
    +---------+----------------------------------------------+--------+
    
Author: M.Frank Version: 1.0

Definition at line 56 of file SmartDataObjectPtr.h.


Member Typedef Documentation

typedef DataObject* (* SmartDataObjectPtr::AccessFunction)(SmartDataObjectPtr* ptr)
 


Constructor & Destructor Documentation

SmartDataObjectPtr::SmartDataObjectPtr ( AccessFunction access,
IDataProviderSvc * pService,
IDataDirectory * pDir,
const std::string & path ) [inline]
 

Standard constructor: Construct an SmartDataObjectPtr instance.

Parameters:
svc   Pointer to the data service interface used to interact with the store.
pDir   Pointer to data directory
path   path to object relative to data directory

Definition at line 131 of file SmartDataObjectPtr.h.

SmartDataObjectPtr::SmartDataObjectPtr ( const SmartDataObjectPtr & copy ) [inline]
 

Copy constructor: Construct an copy of a SmartDataStorePtr instance.

Parameters:
copy   Copy of Smart Pointer to object.

Definition at line 143 of file SmartDataObjectPtr.h.

SmartDataObjectPtr::~SmartDataObjectPtr ( ) [inline, virtual]
 

Standard Destructor.

Definition at line 153 of file SmartDataObjectPtr.h.


Member Function Documentation

DataObject * SmartDataObjectPtr::accessData ( ) [inline]
 

Static Object retrieval method: must call specific function.

Definition at line 215 of file SmartDataObjectPtr.h.

Referenced by operator &&(), SmartDataStorePtr::operator *(), SmartDataStorePtr::operator TYPE *(), SmartDataStorePtr::operator->(), operator||(), SmartDataStorePtr::ptr(), and updateObject().

IDataDirectory * SmartDataObjectPtr::directory ( ) [inline]
 

Access to data directory.

Definition at line 169 of file SmartDataObjectPtr.h.

DataObject * SmartDataObjectPtr::find ( SmartDataObjectPtr * ptr ) [inline, static]
 

Static Object find method.

Definition at line 225 of file SmartDataObjectPtr.h.

StatusCode SmartDataObjectPtr::find ( const std::string & fullPath,
DataObject *& refpObject ) [protected]
 

Find the specified object from the data store.

Parameters:
fullPath   String containing the full path necessary to locate the object.
refpObject   Reference to the pointer finally holding the object
Returns:
StatusCode indicating success or failure.

Definition at line 64 of file SmartDataObjectPtr.cpp.

StatusCode SmartDataObjectPtr::find ( IDataDirectory * pDirectory,
const std::string & path,
DataObject *& refpObject ) [protected]
 

Find the specified object from the data store.

Parameters:
pDirectory   Pointer to the directory entry holding the object.
refpObject   Reference to the pointer finally holding the object
Returns:
StatusCode indicating success or failure.

Definition at line 55 of file SmartDataObjectPtr.cpp.

Referenced by findObject().

DataObject * SmartDataObjectPtr::findObject ( )
 

Object find method.

If the object is not known to the local object, it is requested from the data service either using the full path if there is no directory information present.

Definition at line 121 of file SmartDataObjectPtr.cpp.

Referenced by find().

StatusCode SmartDataObjectPtr::getLastError ( ) const [inline]
 

Access to potential errors during data accesses.

Definition at line 210 of file SmartDataObjectPtr.h.

SmartDataObjectPtr::operator DataObject *& ( ) [inline]
 

operator DataObject*&.

Definition at line 200 of file SmartDataObjectPtr.h.

SmartDataObjectPtr::operator DataObject ** ( ) [inline]
 

operator DataObject**.

Definition at line 205 of file SmartDataObjectPtr.h.

SmartDataObjectPtr::operator IDataDirectory * ( ) [inline]
 

Automatic conversion to data directory.

Definition at line 159 of file SmartDataObjectPtr.h.

SmartDataObjectPtr::operator int ( ) [inline]
 

operator int for statements like: if ( SmartDataObjectPtr<XXX>(...) ) {}.

Definition at line 184 of file SmartDataObjectPtr.h.

SmartDataObjectPtr::operator void * ( ) [inline]
 

operator int for statements like: if ( SmartDataObjectPtr<XXX>(...) ) {}.

Definition at line 194 of file SmartDataObjectPtr.h.

bool SmartDataObjectPtr::operator! ( ) [inline]
 

operator ! for statements like: if ( !SmartDataObjectPtr<XXX>(...) ) {}.

Definition at line 189 of file SmartDataObjectPtr.h.

SmartDataObjectPtr & SmartDataObjectPtr::operator= ( SmartDataObjectPtr & copy ) [virtual]
 

Equivalence operator.

Definition at line 28 of file SmartDataObjectPtr.cpp.

const std::string & SmartDataObjectPtr::path ( ) const [inline]
 

Path name.

Definition at line 164 of file SmartDataObjectPtr.h.

DataObject * SmartDataObjectPtr::retrieve ( SmartDataObjectPtr * ptr ) [inline, static]
 

Static Object retrieval method.

Definition at line 220 of file SmartDataObjectPtr.h.

StatusCode SmartDataObjectPtr::retrieve ( const std::string & fullPath,
DataObject *& refpObject ) [protected]
 

Retrieve the specified object from the data store.

Parameters:
fullPath   String containing the full path necessary to locate the object.
refpObject   Reference to the pointer finally holding the object
Returns:
StatusCode indicating success or failure.

Definition at line 46 of file SmartDataObjectPtr.cpp.

StatusCode SmartDataObjectPtr::retrieve ( IDataDirectory * pDirectory,
const std::string & path,
DataObject *& refpObject ) [protected]
 

Retrieve the specified object from the data store.

Parameters:
pDirectory   Pointer to the directory entry holding the object.
refpObject   Reference to the pointer finally holding the object
Returns:
StatusCode indicating success or failure.

Definition at line 37 of file SmartDataObjectPtr.cpp.

Referenced by retrieveObject().

DataObject * SmartDataObjectPtr::retrieveObject ( )
 

Object retrieve method.

If the object is not known to the local object, it is requested from the data service either using the full path if there is no directory information present.

Definition at line 96 of file SmartDataObjectPtr.cpp.

Referenced by retrieve().

IDataProviderSvc * SmartDataObjectPtr::service ( ) [inline]
 

Retrieve data service.

Definition at line 179 of file SmartDataObjectPtr.h.

void SmartDataObjectPtr::setService ( IDataProviderSvc * svc ) [inline]
 

Assign data service.

Definition at line 174 of file SmartDataObjectPtr.h.

DataObject * SmartDataObjectPtr::update ( SmartDataObjectPtr * ptr ) [inline, static]
 

Static Object update method.

Definition at line 230 of file SmartDataObjectPtr.h.

StatusCode SmartDataObjectPtr::update ( const std::string & fullPath ) [protected]
 

Update the specified object from the data store.

Parameters:
fullPath   String containing the full path necessary to locate the object.
Returns:
StatusCode indicating success or failure.

Definition at line 83 of file SmartDataObjectPtr.cpp.

StatusCode SmartDataObjectPtr::update ( IDataDirectory * pDirectory ) [protected]
 

Update the specified object from the data store.

Parameters:
pDirectory   Pointer to the directory entry holding the object.
Returns:
StatusCode indicating success or failure.

Definition at line 74 of file SmartDataObjectPtr.cpp.

Referenced by updateObject().

DataObject * SmartDataObjectPtr::updateObject ( )
 

Object update method.

If the object is not known to the local object, it is requested from the data service either using the full path if there is no directory information present. Needs to be virtual to to implicit object access.

Definition at line 146 of file SmartDataObjectPtr.cpp.

Referenced by update().


Member Data Documentation

AccessFunction SmartDataObjectPtr::m_accessFunc [protected]
 

Data access function.

Definition at line 84 of file SmartDataObjectPtr.h.

IDataProviderSvc * SmartDataObjectPtr::m_dataProvider [mutable, protected]
 

Pointer to contained object.

Definition at line 74 of file SmartDataObjectPtr.h.

IDataDirectory * SmartDataObjectPtr::m_pDirectory [mutable, protected]
 

Pointer to the data directory containing the object.

Definition at line 76 of file SmartDataObjectPtr.h.

DataObject * SmartDataObjectPtr::m_pObject [mutable, protected]
 

Pointer to contained object.

Definition at line 78 of file SmartDataObjectPtr.h.

std::string SmartDataObjectPtr::m_path [protected]
 

Path to object.

Definition at line 80 of file SmartDataObjectPtr.h.

StatusCode SmartDataObjectPtr::m_status [protected]
 

Keep track of the last error.

Definition at line 82 of file SmartDataObjectPtr.h.


The documentation for this class was generated from the following files:
Generated at Wed Nov 21 12:22:15 2001 by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000