|
//____________________________________________________________________ // // Serve BRAT path names to clients that may need to know those. // The class makes sure that consistent path names are used through // out the code. // // Example of use: // // BrPathManager* pathMan = BrPathManager::Instance(); // const Char_t* paramsFile = // Form("%s/DetectorParameters.txt", // pathMan->GetParameterDir()); // // The manager allows the user to override the compile-time path // settings via the environment. // // Environment Method Return // variable Value // ------------------------------------------------ // BRATSYS GetDataDir BRATSYS // // //____________________________________________________________________ // // $Id: BrPathManager.cxx,v 1.3 2001/06/28 16:38:06 cholm Exp $ // $Author: cholm $ // $Date: 2001/06/28 16:38:06 $ // $Copyright: (C) 2001 BRAHMS Collaboration <brahmlib@rhic.bnl.gov> // #ifndef BRAT_BrPathManager #include "BrPathManager.h" #endif #ifndef ROOT_TSystem #include "TSystem.h" #endif #ifndef BRAT_paths #include "paths.h" #endif #ifndef BRAT_DATA_DIR #error "BRAT_DATA_DIR must be defined at compile time!!!" #endif //____________________________________________________________________ ClassImp(BrPathManager); //____________________________________________________________________ BrPathManager* BrPathManager::fgInstance = 0; //____________________________________________________________________ BrPathManager::BrPathManager() { // Default constructor. Does nothing. } //____________________________________________________________________ BrPathManager* BrPathManager::Instance() { if (!fgInstance) fgInstance = new BrPathManager; return fgInstance; } //____________________________________________________________________ const Char_t* BrPathManager::GetDataDir() const { // Return the data directory. // If environment variable BRATSYS is set then that takes precedence // over the compile time path. return BRAT_DATA_DIR; } //____________________________________________________________________ const Char_t* BrPathManager::GetScriptDir() const { // Return the script directory. // If environment variable BRATSYS is set then that takes precedence // over the compile time path. return BRAT_SCRIPT_DIR; } //____________________________________________________________________ const Char_t* BrPathManager::GetParameterDir() const { // Return the temporary parameter directory. // If environment variable BRATSYS is set then that takes precedence // over the compile time path. return BRAT_PARAMS_DIR; } //____________________________________________________________________ const Char_t* BrPathManager::GetLibraryDir() const { // Return the library directory. // If environment variable BRATSYS is set then that takes precedence // over the compile time path. return BRAT_LIB_DIR; } //____________________________________________________________________ const Char_t* BrPathManager::GetHeaderDir() const { // Return the header directory. // If environment variable BRATSYS is set then that takes precedence // over the compile time path. return BRAT_INCLUDE_DIR; } //____________________________________________________________________ const Char_t* BrPathManager::GetProgramDir() const { // Return the program directory. // If environment variable BRATSYS is set then that takes precedence // over the compile time path. return BRAT_BIN_DIR; } //____________________________________________________________________ const Char_t* BrPathManager::GetSourceDir() const { // Return the program directory. // If environment variable BRATSYS is set then that takes precedence // over the compile time path. return BRAT_TOPSRC_DIR; } //____________________________________________________________________ // // $Log: BrPathManager.cxx,v $ // Revision 1.3 2001/06/28 16:38:06 cholm // Added methods to retrive various installation directories, like // library, header, script, parameter, etc. directories. // // Revision 1.2 2001/06/21 19:42:56 hagel // Made BrPathManager not mess up for brat2 // // Revision 1.1.1.1 2001/06/21 14:55:15 hagel // Initial revision of brat2 // // Revision 1.2 2001/06/06 18:44:20 cholm // Fixed a bug when TSystem::Getenv returning empty environment // // Revision 1.1 2001/06/04 13:34:21 cholm // Warm-up for BRAT2. // Added file tag class. Added version class. Added path manager. // // |
||||||
This page automatically generated by script docBrat by Christian Holm |
Copyright ; 2002 BRAHMS Collaboration
<brahmlib@rcf.rhic.bnl.gov>
|