![]() |
|
|
Bdb packages | Design docs | Source docs | Guidelines | Recent releases |
|
Main Page Modules Namespace List Class Hierarchy Alphabetical List Compound List File List Compound Members File Members /BdbCondRemote/BdbCondRInfoCache.hh
Go to the documentation of this file.00001 //----------------------------------------------------------------------------- 00002 // 00003 // File and Version Information: 00004 // $Id: BdbCondRInfoCache.hh,v 1.2 2000/07/17 21:44:33 gapon Exp $ 00005 // 00006 // Description: 00007 // This class represents a top cache object of the hierarchical 00008 // heterogeneous cache for the Info server. 00009 // 00010 // Environment: 00011 // Software developed for the BaBar Detector at the SLAC B-Factory. 00012 // 00013 // Author List: 00014 // Igor A. Gaponenko Original Author 00015 // 00016 // Copyright Information: 00017 // Copyright (C) 2000 Lawrence Berkeley Laboratory 00018 // 00019 //----------------------------------------------------------------------------- 00020 00021 #ifndef BDBCONDRINFOCACHE_HH 00022 #define BDBCONDRINFOCACHE_HH 00023 00024 // ------------------- 00025 // -- BaBar Headers -- 00026 // ------------------- 00027 00028 #include "BaBar/BaBar.hh" 00029 00030 //------------------------------- 00031 // Collaborating Class Headers -- 00032 //------------------------------- 00033 00034 #include "BdbCondRemote/BdbCondRCacheNode.hh" 00035 #include "BdbCondRemote/BdbCondReadWriteLock.hh" 00036 00037 class BdbCondRInfoFederation; 00038 class BdbCondRInfoSnapshot; 00039 class BdbCondRInfoDetector; 00040 class BdbCondRInfoOrigin; 00041 class BdbCondRInfoContainer; 00042 00043 // --------------------- 00044 // -- Class Interface -- 00045 // --------------------- 00046 00047 class BdbCondRInfoCache : public BdbCondRCacheNode<BdbCondRInfoFederation> { 00048 00049 public: 00050 00051 // Constructor(s). 00052 00053 BdbCondRInfoCache( ); 00054 00055 // Destructor 00056 00057 virtual ~BdbCondRInfoCache( ); 00058 00059 // Accessors 00060 00061 inline bool isValid( ) const; 00062 00063 inline BdbCondReadWriteLock& getLock( ); 00064 00065 // Operations 00066 00067 inline void setValid( bool isValidFlag ); 00068 00069 /** The following "find" methods will make their search down the hierarchical 00070 ** cache tree and return a pointer to the corresponding object or just null 00071 ** if none was found. 00072 **/ 00073 BdbCondRInfoFederation* findFederation( const char* theFederationName ); 00074 00075 BdbCondRInfoSnapshot* findSnapshot( const char* theFederationName, 00076 const char* theSnapshotName ); 00077 00078 BdbCondRInfoDetector* findDetector( const char* theFederationName, 00079 const char* theSnapshotName, 00080 const char* theDetectorName ); 00081 00082 BdbCondRInfoOrigin* findOrigin( const char* theFederationName, 00083 const char* theSnapshotName, 00084 const char* theDetectorName, 00085 const char* theOriginName ); 00086 00087 BdbCondRInfoContainer* findContainer( const char* theFederationName, 00088 const char* theSnapshotName, 00089 const char* theDetectorName, 00090 const char* theOriginName, 00091 const char* theContainerName ); 00092 00093 /** Invalidate the cache and release the allocated data structures. 00094 ** 00095 ** NOTE: This method _extends_ the one defined in the base class in order 00096 ** to reset the locally defined data structures in addition to what 00097 ** is done in the base class. 00098 **/ 00099 virtual void clear( ); 00100 00101 private: 00102 00103 // The copy constructor and assignment operator are not available 00104 // to end users because the semantics of these operations 00105 // is not defined yet. 00106 00107 BdbCondRInfoCache( const BdbCondRInfoCache& theCache ); 00108 00109 // Operators 00110 00111 BdbCondRInfoCache& operator=( const BdbCondRInfoCache& theCache ); 00112 00113 private: 00114 00115 // The current state of this cache. 00116 00117 bool _isValid; 00118 00119 // The synchronizer controlling access to this cache. 00120 00121 BdbCondReadWriteLock _myLock; 00122 }; 00123 00124 // ---------------------------- 00125 // -- Inline implementations -- 00126 // ---------------------------- 00127 00128 inline bool 00129 BdbCondRInfoCache::isValid( ) const 00130 { 00131 return _isValid; 00132 } 00133 00134 inline BdbCondReadWriteLock& 00135 BdbCondRInfoCache::getLock( ) 00136 { 00137 return _myLock; 00138 } 00139 00140 inline void 00141 BdbCondRInfoCache::setValid( bool isValidFlag ) 00142 { 00143 _isValid = isValidFlag; 00144 } 00145 00146 #endif /* BDBCONDRINFOCACHE_HH */
BaBar Public Site | SLAC | News | Links | Who's Who | Contact Us
Page Owner: Jacek Becla
Last Update: October 04, 2002