test
Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
FWCore
PluginManager
src
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
//
12
13
// system include files
14
#include <string>
/*needed by the following include*/
15
#include <dlfcn.h>
16
#include <errno.h>
17
18
// user include files
19
#include "
FWCore/PluginManager/interface/SharedLibrary.h
"
20
#include "
FWCore/Utilities/interface/Exception.h
"
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
//
34
SharedLibrary::SharedLibrary
(
const
boost::filesystem::path
& iName) :
35
libraryHandle_(::dlopen(iName.
string
().c_str(), RTLD_LAZY | RTLD_GLOBAL)),
36
path_
(iName)
37
{
38
if
(
libraryHandle_
==
nullptr
) {
39
char
const
* err = dlerror();
40
if
(err ==
nullptr
) {
41
throw
cms::Exception
(
"PluginLibraryLoadError"
) <<
"unable to load "
<< iName.string();
42
}
43
throw
cms::Exception
(
"PluginLibraryLoadError"
) <<
"unable to load "
<< iName.string() <<
" because "
<< err;
44
}
45
}
46
47
// SharedLibrary::SharedLibrary(const SharedLibrary& rhs)
48
// {
49
// // do actual copying here;
50
// }
51
52
SharedLibrary::~SharedLibrary
()
53
{
54
}
55
56
//
57
// assignment operators
58
//
59
// const SharedLibrary& SharedLibrary::operator=(const SharedLibrary& rhs)
60
// {
61
// //An exception safe implementation is
62
// SharedLibrary temp(rhs);
63
// swap(rhs);
64
//
65
// return *this;
66
// }
67
68
//
69
// member functions
70
//
71
72
//
73
// const member functions
74
//
75
bool
76
SharedLibrary::symbol
(
const
std::string
& iSymbolName,
void
*& iSymbol)
const
77
{
78
if
(
libraryHandle_
==
nullptr
) {
79
return
false
;
80
}
81
iSymbol = dlsym(
libraryHandle_
, iSymbolName.c_str());
82
return
(iSymbol !=
nullptr
);
83
}
84
85
//
86
// static member functions
87
//
88
}
edmplugin::SharedLibrary::symbol
bool symbol(const std::string &iSymbolName, void *&iSymbol) const
Definition:
SharedLibrary.cc:76
SharedLibrary.h
Exception
Definition:
hltDiff.cc:291
edmplugin::SharedLibrary::~SharedLibrary
~SharedLibrary()
Definition:
SharedLibrary.cc:52
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:255
edmplugin::SharedLibrary::libraryHandle_
void * libraryHandle_
Definition:
SharedLibrary.h:50
Exception.h
fed_dqm_sourceclient-live_cfg.path
string path
Definition:
fed_dqm_sourceclient-live_cfg.py:33
path_
std::string & path_
Definition:
PluginManager.cc:242
edmplugin::SharedLibrary::SharedLibrary
SharedLibrary(const boost::filesystem::path &iName)
Definition:
SharedLibrary.cc:34
Generated for CMSSW Reference Manual by
1.8.5