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
Id:
AutoLibraryLoader.h,v 1.2 2008/06/12 22:17:22 dsr Exp

Definition at line 15 of file AutoLibraryLoader.h.

Constructor & Destructor Documentation

AutoLibraryLoader::AutoLibraryLoader ( )
private

Definition at line 41 of file AutoLibraryLoader.cc.

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

Member Function Documentation

void AutoLibraryLoader::enable ( )
static

enable automatic library loading

Definition at line 51 of file AutoLibraryLoader.cc.

References benchmark_cfg::cerr, edmplugin::standard::config(), edmplugin::PluginManager::configure(), dir, edm::RootAutoLibraryLoader::enable(), enabled_, end, edm::setCacheStreamers(), and fwlite::setRefStreamer().

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

52 {
53  if (enabled_) { return; }
54  enabled_ = true;
55 
57  static BareRootProductGetter s_getter;
60  //this function must be called after enabling the autoloader
61  // so that the Reflex dictionaries will be converted to ROOT
62  // dictionaries and the TClass we need will be available
63  fwlite::setRefStreamer(&s_getter);
64 
65  //Make it easy to load our headers
66  TInterpreter* intrp= gROOT->GetInterpreter();
67  const char* env = getenv("CMSSW_FWLITE_INCLUDE_PATH");
68  if( 0 != env) {
69  //this is a comma separated list
70  const char* start = env;
71  const char* end = env;
72  do{
73  //find end
74  for(end=start; *end!=0 and *end != ':';++end);
75  std::string dir(start, end);
76  intrp->AddIncludePath(dir.c_str());
77  start = end+1;
78  }while(*end != 0);
79  }
80 
81  bool foundCMSIncludes = false;
82  env = getenv("CMSSW_BASE");
83  if( 0 != env) {
84  foundCMSIncludes = true;
85  std::string dir(env);
86  dir += "/src";
87  intrp->AddIncludePath(dir.c_str());
88  }
89 
90  env = getenv("CMSSW_RELEASE_BASE");
91  if( 0 != env) {
92  foundCMSIncludes = true;
93  std::string dir(env);
94  dir += "/src";
95  intrp->AddIncludePath(dir.c_str());
96  }
97  if( not foundCMSIncludes) {
98  std::cerr <<"Could not find the environment variables \n"
99  <<" CMSSW_BASE or\n"
100  <<" CMSSW_RELEASE_BASE\n"
101  <<" therefore attempting to '#include' any CMS headers will not work"<<std::endl;
102  }
103  if (0 != gApplication) {
104  gApplication->InitializeGraphics();
105  }
106 }
static PluginManager & configure(const Config &)
PluginManager::Config config()
Definition: standard.cc:22
edm::EDProductGetter const * setRefStreamer(edm::EDProductGetter const *ep)
Definition: RefStreamer.cc:11
#define end
Definition: vmac.h:38
void setCacheStreamers()
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 109 of file AutoLibraryLoader.cc.

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

110 {
111  // std::cout <<"LoadAllDictionaries"<<std::endl;
112  enable();
114 }
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 16 of file AutoLibraryLoader.h.

Member Data Documentation

bool AutoLibraryLoader::enabled_
staticprivate

Definition at line 25 of file AutoLibraryLoader.h.

Referenced by enable().