Classes | Public Member Functions | Static Public Attributes | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
cet::LibraryManager Class Reference

#include "/cvmfs/nova.opensciencegrid.org/externals/cetlib/v3_06_01/source/cetlib/LibraryManager.h"

Classes

struct  nothrow_t
 

Public Member Functions

 LibraryManager (cet::search_path search_path, std::string lib_type)
 
 LibraryManager (cet::search_path search_path, std::string lib_type, std::string pattern)
 
 LibraryManager (std::string lib_type)
 
 LibraryManager (std::string lib_type, std::string pattern)
 
template<typename T >
T getSymbolByLibspec (std::string const &libspec, std::string const &sym_name) const
 
template<typename T >
void getSymbolByLibspec (std::string const &libspec, std::string const &sym_name, T &sym) const
 
template<typename T >
T getSymbolByPath (std::string const &lib_loc, std::string const &sym_name) const
 
template<typename T >
void getSymbolByPath (std::string const &lib_loc, std::string const &sym_name, T &sym) const
 
template<typename T >
T getSymbolByLibspec (std::string const &libspec, std::string const &sym_name, nothrow_t) const
 
template<typename T >
void getSymbolByLibspec (std::string const &libspec, std::string const &sym_name, T &sym, nothrow_t) const
 
template<typename T >
T getSymbolByPath (std::string const &lib_loc, std::string const &sym_name, nothrow_t) const
 
template<typename T >
void getSymbolByPath (std::string const &lib_loc, std::string const &sym_name, T &sym, nothrow_t) const
 
size_t getLoadableLibraries (std::vector< std::string > &list) const
 
template<class OutIter >
size_t getLoadableLibraries (OutIter dest) const
 
size_t getLoadedLibraries (std::vector< std::string > &list) const
 
template<class OutIter >
size_t getLoadedLibraries (OutIter dest) const
 
size_t getValidLibspecs (std::vector< std::string > &list) const
 
template<class OutIter >
size_t getValidLibspecs (OutIter dest) const
 
std::pair< std::string, std::stringgetSpecsByPath (std::string const &lib_loc) const
 
void loadAllLibraries () const
 
bool libraryIsLoaded (std::string const &path) const
 
bool libraryIsLoadable (std::string const &path) const
 
std::string libType () const
 
std::string patternStem () const
 

Static Public Attributes

static struct cet::LibraryManager::nothrow_t nothrow
 

Private Types

using lib_loc_map_t = std::map< std::string, std::string >
 
using spec_trans_map_t = std::map< std::string, std::set< std::string >>
 
using lib_ptr_map_t = std::map< std::string, void * >
 
using good_spec_trans_map_t = std::map< std::string, std::string >
 

Private Member Functions

void lib_loc_map_inserter (std::string const &path)
 
void spec_trans_map_inserter (lib_loc_map_t::value_type const &entry)
 
void good_spec_trans_map_inserter (spec_trans_map_t::value_type const &entry)
 
voidget_lib_ptr (std::string const &lib_loc) const
 
voidgetSymbolByLibspec_ (std::string const &libspec, std::string const &sym_name, bool should_throw_on_dlsym=true) const
 
voidgetSymbolByPath_ (std::string const &lib_loc, std::string const &sym_name, bool should_throw_on_dlsym=true) const
 

Static Private Member Functions

static std::string dllExtPattern ()
 

Private Attributes

cet::search_path const search_path_
 
std::string const lib_type_
 
std::string const pattern_stem_
 
lib_loc_map_t lib_loc_map_ {}
 
spec_trans_map_t spec_trans_map_ {}
 
good_spec_trans_map_t good_spec_trans_map_ {}
 
lib_ptr_map_t lib_ptr_map_ {}
 

Detailed Description

Definition at line 18 of file LibraryManager.h.

Member Typedef Documentation

Definition at line 141 of file LibraryManager.h.

Definition at line 138 of file LibraryManager.h.

Definition at line 140 of file LibraryManager.h.

using cet::LibraryManager::spec_trans_map_t = std::map<std::string, std::set<std::string>>
private

Definition at line 139 of file LibraryManager.h.

Constructor & Destructor Documentation

cet::LibraryManager::LibraryManager ( cet::search_path  search_path,
std::string  lib_type 
)
explicit
cet::LibraryManager::LibraryManager ( cet::search_path  search_path,
std::string  lib_type,
std::string  pattern 
)
explicit
cet::LibraryManager::LibraryManager ( std::string  lib_type)
explicit
cet::LibraryManager::LibraryManager ( std::string  lib_type,
std::string  pattern 
)
explicit

Member Function Documentation

std::string cet::LibraryManager::dllExtPattern ( )
inlinestaticprivate

Definition at line 171 of file LibraryManager.h.

References cet::shlib_suffix(), string, and T.

172 {
173  static std::string const dllExtPatt{"\\" + shlib_suffix()};
174  return dllExtPatt;
175 }
std::string shlib_suffix()
enum BeamMode string
void* cet::LibraryManager::get_lib_ptr ( std::string const &  lib_loc) const
private
size_t cet::LibraryManager::getLoadableLibraries ( std::vector< std::string > &  list) const
template<class OutIter >
size_t cet::LibraryManager::getLoadableLibraries ( OutIter  dest) const

Definition at line 213 of file LibraryManager.h.

References confusionMatrixTree::count, lib_loc_map_, and T.

214 {
215  size_t count{};
216  for (auto const& lib_loc : lib_loc_map_) {
217  *dest++ = lib_loc.second;
218  ++count;
219  }
220  return count;
221 }
lib_loc_map_t lib_loc_map_
size_t cet::LibraryManager::getLoadedLibraries ( std::vector< std::string > &  list) const
template<class OutIter >
size_t cet::LibraryManager::getLoadedLibraries ( OutIter  dest) const

Definition at line 264 of file LibraryManager.h.

References confusionMatrixTree::count, and lib_ptr_map_.

265 {
266  size_t count{};
267  for (auto const& lib_ptr : lib_ptr_map_) {
268  *dest++ = lib_ptr.first;
269  ++count;
270  }
271  return count;
272 }
lib_ptr_map_t lib_ptr_map_
std::pair<std::string, std::string> cet::LibraryManager::getSpecsByPath ( std::string const &  lib_loc) const
template<typename T >
T cet::LibraryManager::getSymbolByLibspec ( std::string const &  libspec,
std::string const &  sym_name 
) const
inline

Definition at line 179 of file LibraryManager.h.

References getSymbolByLibspec_(), cet::hard_cast(), and T.

Referenced by cet::PluginFactory::find(), art::detail::getAllowedConfiguration(), art::detail::getFilePath(), and cet::PluginFactory::resolveSymbolOrThrow_().

181 {
182  return hard_cast<T>(getSymbolByLibspec_(libspec, sym_name));
183 }
PTR_T hard_cast(void *src)
Definition: hard_cast.h:19
void * getSymbolByLibspec_(std::string const &libspec, std::string const &sym_name, bool should_throw_on_dlsym=true) const
double T
Definition: Xdiff_gwt.C:5
template<typename T >
void cet::LibraryManager::getSymbolByLibspec ( std::string const &  libspec,
std::string const &  sym_name,
T sym 
) const
inline

Definition at line 187 of file LibraryManager.h.

References getSymbolByLibspec_(), cet::hard_cast(), and T.

190 {
191  hard_cast<T>(getSymbolByLibspec_(libspec, sym_name), sym);
192 }
PTR_T hard_cast(void *src)
Definition: hard_cast.h:19
void * getSymbolByLibspec_(std::string const &libspec, std::string const &sym_name, bool should_throw_on_dlsym=true) const
double T
Definition: Xdiff_gwt.C:5
template<typename T >
T cet::LibraryManager::getSymbolByLibspec ( std::string const &  libspec,
std::string const &  sym_name,
nothrow_t   
) const
inline

Definition at line 226 of file LibraryManager.h.

References getSymbolByLibspec_(), cet::hard_cast(), and T.

229 {
230  return hard_cast<T>(getSymbolByLibspec_(libspec, sym_name, false));
231 }
PTR_T hard_cast(void *src)
Definition: hard_cast.h:19
void * getSymbolByLibspec_(std::string const &libspec, std::string const &sym_name, bool should_throw_on_dlsym=true) const
double T
Definition: Xdiff_gwt.C:5
template<typename T >
void cet::LibraryManager::getSymbolByLibspec ( std::string const &  libspec,
std::string const &  sym_name,
T sym,
nothrow_t   
) const
inline

Definition at line 235 of file LibraryManager.h.

References getSymbolByLibspec_(), cet::hard_cast(), and T.

239 {
240  hard_cast<T>(getSymbolByLibspec_(libspec, sym_name, false), sym);
241 }
PTR_T hard_cast(void *src)
Definition: hard_cast.h:19
void * getSymbolByLibspec_(std::string const &libspec, std::string const &sym_name, bool should_throw_on_dlsym=true) const
double T
Definition: Xdiff_gwt.C:5
void* cet::LibraryManager::getSymbolByLibspec_ ( std::string const &  libspec,
std::string const &  sym_name,
bool  should_throw_on_dlsym = true 
) const
private

Referenced by getSymbolByLibspec().

template<typename T >
T cet::LibraryManager::getSymbolByPath ( std::string const &  lib_loc,
std::string const &  sym_name 
) const
inline

Definition at line 196 of file LibraryManager.h.

References getSymbolByPath_(), cet::hard_cast(), and T.

198 {
199  return hard_cast<T>(getSymbolByPath_(lib_loc, sym_name));
200 }
PTR_T hard_cast(void *src)
Definition: hard_cast.h:19
void * getSymbolByPath_(std::string const &lib_loc, std::string const &sym_name, bool should_throw_on_dlsym=true) const
double T
Definition: Xdiff_gwt.C:5
template<typename T >
void cet::LibraryManager::getSymbolByPath ( std::string const &  lib_loc,
std::string const &  sym_name,
T sym 
) const
inline

Definition at line 204 of file LibraryManager.h.

References getSymbolByPath_(), cet::hard_cast(), and T.

207 {
208  hard_cast<T>(getSymbolByPath_(lib_loc, sym_name), sym);
209 }
PTR_T hard_cast(void *src)
Definition: hard_cast.h:19
void * getSymbolByPath_(std::string const &lib_loc, std::string const &sym_name, bool should_throw_on_dlsym=true) const
double T
Definition: Xdiff_gwt.C:5
template<typename T >
T cet::LibraryManager::getSymbolByPath ( std::string const &  lib_loc,
std::string const &  sym_name,
nothrow_t   
) const
inline

Definition at line 245 of file LibraryManager.h.

References getSymbolByPath_(), cet::hard_cast(), and T.

248 {
249  return hard_cast<T>(getSymbolByPath_(lib_loc, sym_name, false));
250 }
PTR_T hard_cast(void *src)
Definition: hard_cast.h:19
void * getSymbolByPath_(std::string const &lib_loc, std::string const &sym_name, bool should_throw_on_dlsym=true) const
double T
Definition: Xdiff_gwt.C:5
template<typename T >
void cet::LibraryManager::getSymbolByPath ( std::string const &  lib_loc,
std::string const &  sym_name,
T sym,
nothrow_t   
) const
inline

Definition at line 254 of file LibraryManager.h.

References getSymbolByPath_(), cet::hard_cast(), and T.

258 {
259  hard_cast<T>(getSymbolByPath_(lib_loc, sym_name, false), sym);
260 }
PTR_T hard_cast(void *src)
Definition: hard_cast.h:19
void * getSymbolByPath_(std::string const &lib_loc, std::string const &sym_name, bool should_throw_on_dlsym=true) const
double T
Definition: Xdiff_gwt.C:5
void* cet::LibraryManager::getSymbolByPath_ ( std::string const &  lib_loc,
std::string const &  sym_name,
bool  should_throw_on_dlsym = true 
) const
private

Referenced by getSymbolByPath().

size_t cet::LibraryManager::getValidLibspecs ( std::vector< std::string > &  list) const
template<class OutIter >
size_t cet::LibraryManager::getValidLibspecs ( OutIter  dest) const

Definition at line 276 of file LibraryManager.h.

References confusionMatrixTree::count, and spec_trans_map_.

277 {
278  size_t count{};
279  for (auto const& spec_trans : spec_trans_map_) {
280  *dest++ = spec_trans.first;
281  ++count;
282  }
283  return count;
284 }
spec_trans_map_t spec_trans_map_
void cet::LibraryManager::good_spec_trans_map_inserter ( spec_trans_map_t::value_type const &  entry)
private
void cet::LibraryManager::lib_loc_map_inserter ( std::string const &  path)
private
bool cet::LibraryManager::libraryIsLoadable ( std::string const &  path) const
bool cet::LibraryManager::libraryIsLoaded ( std::string const &  path) const
std::string cet::LibraryManager::libType ( ) const
inline

Definition at line 124 of file LibraryManager.h.

References lib_type_, and string.

125  {
126  return lib_type_;
127  }
std::string const lib_type_
void cet::LibraryManager::loadAllLibraries ( ) const
std::string cet::LibraryManager::patternStem ( ) const
inline

Definition at line 131 of file LibraryManager.h.

References pattern_stem_.

132  {
133  return pattern_stem_;
134  }
std::string const pattern_stem_
void cet::LibraryManager::spec_trans_map_inserter ( lib_loc_map_t::value_type const &  entry)
private

Member Data Documentation

good_spec_trans_map_t cet::LibraryManager::good_spec_trans_map_ {}
private

Definition at line 165 of file LibraryManager.h.

lib_loc_map_t cet::LibraryManager::lib_loc_map_ {}
private

Definition at line 161 of file LibraryManager.h.

Referenced by getLoadableLibraries().

lib_ptr_map_t cet::LibraryManager::lib_ptr_map_ {}
mutableprivate

Definition at line 167 of file LibraryManager.h.

Referenced by getLoadedLibraries().

std::string const cet::LibraryManager::lib_type_
private

Definition at line 158 of file LibraryManager.h.

Referenced by libType().

struct cet::LibraryManager::nothrow_t cet::LibraryManager::nothrow
static
std::string const cet::LibraryManager::pattern_stem_
private

Definition at line 159 of file LibraryManager.h.

Referenced by patternStem().

cet::search_path const cet::LibraryManager::search_path_
private

Definition at line 157 of file LibraryManager.h.

spec_trans_map_t cet::LibraryManager::spec_trans_map_ {}
private

Definition at line 163 of file LibraryManager.h.

Referenced by getValidLibspecs().


The documentation for this class was generated from the following file: