CMS 3D CMS Logo

Static Public Member Functions | Private Member Functions | Static Private Attributes | Friends

AutoLibraryLoader Class Reference

#include <AutoLibraryLoader.h>

List of all members.

Static Public Member Functions

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

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.3 2009/12/16 22:18:41 chrjones Exp

Definition at line 15 of file AutoLibraryLoader.h.


Constructor & Destructor Documentation

AutoLibraryLoader::AutoLibraryLoader ( ) [private]

Definition at line 40 of file AutoLibraryLoader.cc.

{
}
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, enabled_, end, fwlite::setRefStreamer(), and dqm_diff::start.

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

{
   if (enabled_) { return; }
   enabled_ = true;

   edmplugin::PluginManager::configure(edmplugin::standard::config());
   static BareRootProductGetter s_getter;
   edm::RootAutoLibraryLoader::enable();
   //this function must be called after enabling the autoloader
   // so that the Reflex dictionaries will be converted to ROOT 
   // dictionaries and the TClass we need will be available
   fwlite::setRefStreamer(&s_getter);
   
   //Make it easy to load our headers
   TInterpreter* intrp= gROOT->GetInterpreter();
   const char* env = getenv("CMSSW_FWLITE_INCLUDE_PATH");
   if( 0 != env) {
     //this is a comma separated list
     const char* start = env;
     const char* end = env;
     do{
       //find end
       for(end=start; *end!=0 and *end != ':';++end);
       std::string dir(start, end);
       intrp->AddIncludePath(dir.c_str());
       start = end+1;
     }while(*end != 0);
   }
   
   bool foundCMSIncludes = false;
   env = getenv("CMSSW_BASE");
   if( 0 != env) {
     foundCMSIncludes = true;
     std::string dir(env);
     dir += "/src";
     intrp->AddIncludePath(dir.c_str());
   }

   env = getenv("CMSSW_RELEASE_BASE");
   if( 0 != env) {
     foundCMSIncludes = true;
     std::string dir(env);
     dir += "/src";
     intrp->AddIncludePath(dir.c_str());
   }
   if( not foundCMSIncludes) {
     std::cerr <<"Could not find the environment variables \n"
     <<"  CMSSW_BASE or\n"
     <<"  CMSSW_RELEASE_BASE\n"
     <<" therefore attempting to '#include' any CMS headers will not work"<<std::endl;
   }
   if (0 != gApplication) {
     gApplication->InitializeGraphics();
   }
}
void AutoLibraryLoader::loadAll ( ) [static]

load all known libraries holding dictionaries

Definition at line 107 of file AutoLibraryLoader.cc.

References enable().

{
  // std::cout <<"LoadAllDictionaries"<<std::endl;
  enable();
  edm::RootAutoLibraryLoader::loadAll();
}
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_ [static, private]

Definition at line 25 of file AutoLibraryLoader.h.

Referenced by enable().