// -*- mode: c++ -*- // // $Id: BrCalibrationManager.h,v 1.1 2001/10/08 10:40:32 cholm Exp $ // #ifndef BRAT_BrCalibrationManager #define BRAT_BrCalibrationManager #ifndef ROOT_TObject #include "TObject.h" #endif #ifndef ROOT_TObjArray #include "TObjArray.h" #endif class BrCalibration; #ifndef BRAT_BrCalibration #include "BrCalibration.h" #endif //_______________________________________________________________________ // // This class is used only by the manager class. // The objects are used to maintain what databases objects has been // loaded via this mechanism. // class BrDbElement : public TObject { public: BrDbElement(){}; BrDbElement(const Char_t* classname, const Char_t* detectorname, TObject* obj); ~BrDbElement(); private: Char_t fClassName[80]; // ClassName for database object Char_t fDetectorName[80]; // Identifier of detector/magnet name TObject* fParameterElement; // Pointer to database object. public: friend class BrCalibrationManager; friend ostream& operator << (ostream& os, BrDbElement* dbobj); void Print(Option_t* option="") const; ClassDef(BrDbElement,0) // BRAHMS Database object } ; //_______________________________________________________________________ class BrCalibrationManager : public TObject { private: enum DbStatus_t { INIT, OPEN, DEFAULT_PARAMETER_SET }; public: static BrCalibrationManager* Instance(); // Root is not happy with the protected for the constructor. // i.e. one cannot invoke the TBrowser. The destructor also // has be public otherwise CINT complains. protected: BrCalibrationManager(); public: ~BrCalibrationManager(); BrCalibration* BrCalibrationManager::Register(const Char_t* classname, const Char_t* detector); void Print(Option_t* option="L") const; void Init(); void Update(){}; void Update(Int_t , Int_t); void Commit(Int_t , Int_t); Int_t DebugLevel() const {return fDebugLevel;} void SetDebugLevel(Int_t level) {fDebugLevel=level;} private: BrDbElement* GetDbElement(const Char_t* classname, const Char_t* detector); TObjArray* fObjectlist; // List DbStatus_t fState; // State of file Int_t fDebugLevel; // static BrCalibrationManager* fInstance; ClassDef(BrCalibrationManager, 0) // Parameter Database Manager } ; #endif // $Log: BrCalibrationManager.h,v $ // Revision 1.1 2001/10/08 10:40:32 cholm // * Renamed BrParameterElement[Manager] to BrCalibration[Manager] // * Impacts some modules, and maybe user code too. // * Made the access class BrCalibrationsDb 'polymorphic' // * All database table representations have class version > 0 (persistent) // // Revision 1.2 2001/09/12 15:12:08 cholm // Removed List in favour of Print. Some clean-up. // // Revision 1.1.1.1 2001/06/21 14:55:17 hagel // Initial revision of brat2 // // Revision 1.4 2001/06/05 18:39:36 cholm // Removed BrDbInc.h an all references to it // // Revision 1.3 2000/06/03 18:12:49 videbaek // Many update to the ParamemertElement and related classes for the calibration access. // // Revision 1.2 2000/05/17 10:43:13 cholm // Test for reading Calibrations DB added // // Revision 1.1 2000/05/16 16:16:24 videbaek // Added the database utility classes for dealing with calibrations. // These are ParameterElement and ParamterElementManager. Each of these two // classes has intrinsic utility classes. // //