//----------------------------------------------------------------------------- // // File and Version Information: // $Id: BdbConfigCache.hh,v 1.1 1998/01/15 08:32:50 yury Exp $ // // Description: // Class BdbConfigCache: caches a configuration database // object for repeated access. This is a pure virtual class. // // Environment: // Software developed for the BaBar Detector at the SLAC B-Factory. // // Author List: // David R. Quarrie Original Author (BdbCache) // Dave Brown, LBL Move database,class,key to constructor, // clean up the fetch interface // Yury Kolomensky, Caltech clone // Copyright Information: // Copyright (C) 1994, 1995 Lawrence Berkeley Laboratory // //----------------------------------------------------------------------------- #ifndef BDBCONFIGCACHE_HH #define BDBCONFIGCACHE_HH //----------------------- // Base Class Headers -- //----------------------- //------------------------------- // Collaborating Class Headers -- //------------------------------- #include "BdbConfig/BdbConfigObject.hh" #include "BdbUtil/BdbIfdHandle.hh" #include "rw/cstring.h" //------------------------------------ // Collaborating Class Declarations -- //------------------------------------ class BdbConfigKey; // --------------------- // -- Class Interface -- // --------------------- class BdbConfigCache { public: // Constructor BdbConfigCache(const char* theClassName); // Destructor virtual ~BdbConfigCache( ); // method to test the cache virtual bool isCacheValid(const BdbConfigKey& theKey )=0; // this method is type-safe BdbIfdHandle& ifdFetch( const BdbConfigKey& theKey ); // Access the relevant strings const RWCString& className() const { return _className; } protected: // Fetch the object, given the ConfigKey. virtual BdbHandle(BdbConfigObject) fetch( const BdbConfigKey& theKey )=0; // Data members RWCString _className; // class name BdbIfdHandle _object; // pointer to handle to object }; #endif