CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Static Public Member Functions | Private Member Functions | Static Private Attributes | Friends
AutoLibraryLoader Class Reference

#include <AutoLibraryLoader.h>

Static Public Member Functions

static void enable ()
 enable automatic library loading More...
 
static void loadAll ()
 load all known libraries holding dictionaries More...
 

Private Member Functions

 AutoLibraryLoader ()
 
 AutoLibraryLoader (const AutoLibraryLoader &)
 
const AutoLibraryLoaderoperator= (const AutoLibraryLoader &)
 

Static Private Attributes

static bool enabled_
 

Friends

class DummyClassToStopCompilerWarning
 

Detailed Description

ROOT helper class which can automatically load the proper shared library when ROOT needs a new class dictionary

Author
Chris Jones, Cornell

Definition at line 14 of file AutoLibraryLoader.h.

Constructor & Destructor Documentation

AutoLibraryLoader::AutoLibraryLoader ( )
private

Definition at line 40 of file AutoLibraryLoader.cc.

41 {
42 }
AutoLibraryLoader::AutoLibraryLoader ( const AutoLibraryLoader )
private

Member Function Documentation

void AutoLibraryLoader::enable ( )
static

enable automatic library loading

Definition at line 50 of file AutoLibraryLoader.cc.

References dtNoiseDBValidation_cfg::cerr, edmplugin::standard::config(), edmplugin::PluginManager::configure(), dir, edm::RootAutoLibraryLoader::enable(), enabled_, end, web.browse_db::env, fwlite::setRefStreamer(), dqm_diff::start, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by CmsShowMain::CmsShowMain(), fwlite::EventContainer::EventContainer(), loadAll(), and main().

51 {
52  if (enabled_) { return; }
53  enabled_ = true;
54 
56  static BareRootProductGetter s_getter;
58  //this function must be called after enabling the autoloader
59  // so that the TClass we need will be available
60  fwlite::setRefStreamer(&s_getter);
61 
62  //Make it easy to load our headers
63  TInterpreter* intrp= gROOT->GetInterpreter();
64  const char* env = getenv("CMSSW_FWLITE_INCLUDE_PATH");
65  if( 0 != env) {
66  //this is a comma separated list
67  const char* start = env;
68  const char* end;
69  do{
70  //find end
71  for(end=start; *end!=0 and *end != ':';++end);
72  std::string dir(start, end);
73  intrp->AddIncludePath(dir.c_str());
74  start = end+1;
75  }while(*end != 0);
76  }
77 
78  bool foundCMSIncludes = false;
79  env = getenv("CMSSW_BASE");
80  if( 0 != env) {
81  foundCMSIncludes = true;
82  std::string dir(env);
83  dir += "/src";
84  intrp->AddIncludePath(dir.c_str());
85  }
86 
87  env = getenv("CMSSW_RELEASE_BASE");
88  if( 0 != env) {
89  foundCMSIncludes = true;
90  std::string dir(env);
91  dir += "/src";
92  intrp->AddIncludePath(dir.c_str());
93  }
94  if( not foundCMSIncludes) {
95  std::cerr <<"Could not find the environment variables \n"
96  <<" CMSSW_BASE or\n"
97  <<" CMSSW_RELEASE_BASE\n"
98  <<" therefore attempting to '#include' any CMS headers will not work"<<std::endl;
99  }
100  if (0 != gApplication) {
101  gApplication->InitializeGraphics();
102  }
103 }
tuple start
Check for commandline option errors.
Definition: dqm_diff.py:58
static PluginManager & configure(const Config &)
PluginManager::Config config()
Definition: standard.cc:21
edm::EDProductGetter const * setRefStreamer(edm::EDProductGetter const *ep)
Definition: RefStreamer.cc:10
#define end
Definition: vmac.h:37
dbl *** dir
Definition: mlp_gen.cc:35
static void enable()
interface for TClass generators
void AutoLibraryLoader::loadAll ( )
static

load all known libraries holding dictionaries

Definition at line 106 of file AutoLibraryLoader.cc.

References enable(), and edm::RootAutoLibraryLoader::loadAll().

107 {
108  // std::cout <<"LoadAllDictionaries"<<std::endl;
109  enable();
111 }
static void loadAll()
load all known libraries holding dictionaries
static void enable()
enable automatic library loading
const AutoLibraryLoader& AutoLibraryLoader::operator= ( const AutoLibraryLoader )
private

Friends And Related Function Documentation

friend class DummyClassToStopCompilerWarning
friend

Definition at line 15 of file AutoLibraryLoader.h.

Member Data Documentation

bool AutoLibraryLoader::enabled_
staticprivate

Definition at line 24 of file AutoLibraryLoader.h.

Referenced by enable().