shared_library.cpp
Go to the documentation of this file.
3 
4 BT::SharedLibrary::SharedLibrary(const std::string& path, int flags)
5 {
6  load(path, flags);
7 }
8 
9 void* BT::SharedLibrary::getSymbol(const std::string& name)
10 {
11  void* result = findSymbol(name);
12  if (result)
13  return result;
14  else
15  throw RuntimeError( "[SharedLibrary::getSymbol]: can't find symbol ", name );
16 }
17 
18 bool BT::SharedLibrary::hasSymbol(const std::string& name)
19 {
20  return findSymbol(name) != nullptr;
21 }
22 
23 std::string BT::SharedLibrary::getOSName(const std::string& name)
24 {
25  return prefix() + name + suffix();
26 }
static std::string prefix()
bool hasSymbol(const std::string &name)
Returns true iff a library has been loaded.
static std::string getOSName(const std::string &name)
static std::string suffix()
void * getSymbol(const std::string &name)
Simple class for manipulating paths on Linux/Windows/Mac OS.
Definition: path.h:42
void load(const std::string &path, int flags=0)
void * findSymbol(const std::string &name)


behaviotree_cpp_v3
Author(s): Michele Colledanchise, Davide Faconti
autogenerated on Tue May 4 2021 02:56:25