CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_0/src/FWCore/PluginManager/src/SharedLibrary.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 //
00003 // Package:     PluginManager
00004 // Class  :     SharedLibrary
00005 // 
00006 // Implementation:
00007 //     <Notes on implementation>
00008 //
00009 // Original Author:  Chris Jones
00010 //         Created:  Thu Apr  5 15:30:15 EDT 2007
00011 // $Id: SharedLibrary.cc,v 1.4 2011/08/24 12:28:53 eulisse Exp $
00012 //
00013 
00014 // system include files
00015 #include <string> /*needed by the following include*/
00016 #include "Reflex/SharedLibrary.h"
00017 
00018 // user include files
00019 #include "FWCore/PluginManager/interface/SharedLibrary.h"
00020 #include "FWCore/Utilities/interface/Exception.h"
00021 
00022 namespace edmplugin {
00023 //
00024 // constants, enums and typedefs
00025 //
00026 
00027 //
00028 // static data member definitions
00029 //
00030 
00031 //
00032 // constructors and destructor
00033 //
00034   SharedLibrary::SharedLibrary(const boost::filesystem::path& iName) :
00035   library_(0),
00036   path_(iName)
00037 {
00038     std::auto_ptr<Reflex::SharedLibrary> lib(new Reflex::SharedLibrary(iName.string()));
00039     if( !lib->Load() ) {
00040       throw cms::Exception("PluginLibraryLoadError")<<"unable to load "<<iName.string()<<" because "<<lib->Error();
00041     }
00042     library_ = lib.release();
00043 }
00044 
00045 // SharedLibrary::SharedLibrary(const SharedLibrary& rhs)
00046 // {
00047 //    // do actual copying here;
00048 // }
00049 
00050 SharedLibrary::~SharedLibrary()
00051 {
00052   delete library_;
00053 }
00054 
00055 //
00056 // assignment operators
00057 //
00058 // const SharedLibrary& SharedLibrary::operator=(const SharedLibrary& rhs)
00059 // {
00060 //   //An exception safe implementation is
00061 //   SharedLibrary temp(rhs);
00062 //   swap(rhs);
00063 //
00064 //   return *this;
00065 // }
00066 
00067 //
00068 // member functions
00069 //
00070 
00071 //
00072 // const member functions
00073 //
00074 bool 
00075 SharedLibrary::symbol(const std::string& iSymbolName, void* & iSymbol) const
00076 {
00077   return library_->Symbol(iSymbolName,iSymbol);
00078 }
00079 
00080 //
00081 // static member functions
00082 //
00083 }