CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SharedLibrary.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: PluginManager
4 // Class : SharedLibrary
5 //
6 // Implementation:
7 // <Notes on implementation>
8 //
9 // Original Author: Chris Jones
10 // Created: Thu Apr 5 15:30:15 EDT 2007
11 // $Id: SharedLibrary.cc,v 1.4 2011/08/24 12:28:53 eulisse Exp $
12 //
13 
14 // system include files
15 #include <string> /*needed by the following include*/
16 #include "Reflex/SharedLibrary.h"
17 
18 // user include files
21 
22 namespace edmplugin {
23 //
24 // constants, enums and typedefs
25 //
26 
27 //
28 // static data member definitions
29 //
30 
31 //
32 // constructors and destructor
33 //
35  library_(0),
36  path_(iName)
37 {
38  std::auto_ptr<Reflex::SharedLibrary> lib(new Reflex::SharedLibrary(iName.string()));
39  if( !lib->Load() ) {
40  throw cms::Exception("PluginLibraryLoadError")<<"unable to load "<<iName.string()<<" because "<<lib->Error();
41  }
42  library_ = lib.release();
43 }
44 
45 // SharedLibrary::SharedLibrary(const SharedLibrary& rhs)
46 // {
47 // // do actual copying here;
48 // }
49 
51 {
52  delete library_;
53 }
54 
55 //
56 // assignment operators
57 //
58 // const SharedLibrary& SharedLibrary::operator=(const SharedLibrary& rhs)
59 // {
60 // //An exception safe implementation is
61 // SharedLibrary temp(rhs);
62 // swap(rhs);
63 //
64 // return *this;
65 // }
66 
67 //
68 // member functions
69 //
70 
71 //
72 // const member functions
73 //
74 bool
75 SharedLibrary::symbol(const std::string& iSymbolName, void* & iSymbol) const
76 {
77  return library_->Symbol(iSymbolName,iSymbol);
78 }
79 
80 //
81 // static member functions
82 //
83 }
bool symbol(const std::string &iSymbolName, void *&iSymbol) const
std::string & path_
SharedLibrary(const boost::filesystem::path &iName)
Reflex::SharedLibrary * library_
Definition: SharedLibrary.h:54