CMS 3D CMS Logo

AutoLibraryLoader Class Reference

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

#include <FWCore/FWLite/interface/AutoLibraryLoader.h>

List of all members.

Public Member Functions

 ClassDef (AutoLibraryLoader, 2)
 interface for TClass generators

Static Public Member Functions

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

Private Member Functions

 AutoLibraryLoader (const AutoLibraryLoader &)
 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 16 of file AutoLibraryLoader.h.


Constructor & Destructor Documentation

AutoLibraryLoader::AutoLibraryLoader (  )  [private]

Definition at line 42 of file AutoLibraryLoader.cc.

00043 {
00044 }

AutoLibraryLoader::AutoLibraryLoader ( const AutoLibraryLoader  )  [private]


Member Function Documentation

AutoLibraryLoader::ClassDef ( AutoLibraryLoader  ,
 
)

interface for TClass generators

void AutoLibraryLoader::enable (  )  [static]

enable automatic library loading

Definition at line 52 of file AutoLibraryLoader.cc.

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

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

00053 {
00054    if (enabled_) { return; }
00055    enabled_ = true;
00056 
00057    edmplugin::PluginManager::configure(edmplugin::standard::config());
00058    static BareRootProductGetter s_getter;
00059    static edm::EDProductGetter::Operate s_op(&s_getter);
00060    edm::RootAutoLibraryLoader::enable();
00061    edm::setCacheStreamers();
00062    //this function must be called after enabling the autoloader
00063    // so that the Reflex dictionaries will be converted to ROOT 
00064    // dictionaries and the TClass we need will be available
00065    fwlite::setRefStreamer(&s_getter);
00066    
00067    //Make it easy to load our headers
00068    TInterpreter* intrp= gROOT->GetInterpreter();
00069    const char* env = getenv("CMSSW_FWLITE_INCLUDE_PATH");
00070    if( 0 != env) {
00071      //this is a comma separated list
00072      const char* start = env;
00073      const char* end = env;
00074      do{
00075        //find end
00076        for(end=start; *end!=0 and *end != ':';++end);
00077        std::string dir(start, end);
00078        intrp->AddIncludePath(dir.c_str());
00079        start = end+1;
00080      }while(*end != 0);
00081    }
00082    
00083    bool foundCMSIncludes = false;
00084    env = getenv("CMSSW_BASE");
00085    if( 0 != env) {
00086      foundCMSIncludes = true;
00087      std::string dir(env);
00088      dir += "/src";
00089      intrp->AddIncludePath(dir.c_str());
00090    }
00091 
00092    env = getenv("CMSSW_RELEASE_BASE");
00093    if( 0 != env) {
00094      foundCMSIncludes = true;
00095      std::string dir(env);
00096      dir += "/src";
00097      intrp->AddIncludePath(dir.c_str());
00098    }
00099    if( not foundCMSIncludes) {
00100      std::cerr <<"Could not find the environment variables \n"
00101      <<"  CMSSW_BASE or\n"
00102      <<"  CMSSW_RELEASE_BASE\n"
00103      <<" therefore attempting to '#include' any CMS headers will not work"<<std::endl;
00104    }
00105    if (0 != gApplication) {
00106      gApplication->InitializeGraphics();
00107    }
00108 }

void AutoLibraryLoader::loadAll (  )  [static]

load all known libraries holding dictionaries

Definition at line 111 of file AutoLibraryLoader.cc.

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

00112 {
00113   // std::cout <<"LoadAllDictionaries"<<std::endl;
00114   enable();
00115   edm::RootAutoLibraryLoader::loadAll();
00116 }

const AutoLibraryLoader& AutoLibraryLoader::operator= ( const AutoLibraryLoader  )  [private]


Friends And Related Function Documentation

friend class DummyClassToStopCompilerWarning [friend]

Definition at line 17 of file AutoLibraryLoader.h.


Member Data Documentation

bool AutoLibraryLoader::enabled_ [static, private]

Definition at line 28 of file AutoLibraryLoader.h.

Referenced by enable().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:14:50 2009 for CMSSW by  doxygen 1.5.4