src
shared_library.cpp
Go to the documentation of this file.
1
#include "
behaviortree_cpp_v3/utils/shared_library.h
"
2
#include "
behaviortree_cpp_v3/exceptions.h
"
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
}
BT::SharedLibrary::load
void load(const std::string &path, int flags=0)
Definition:
shared_library_UNIX.cpp:14
exceptions.h
BT::SharedLibrary::SharedLibrary
SharedLibrary()
Creates a SharedLibrary object.
Definition:
shared_library_UNIX.cpp:9
BT::SharedLibrary::getSymbol
void * getSymbol(const std::string &name)
Definition:
shared_library.cpp:9
BT::RuntimeError
Definition:
exceptions.h:58
BT::SharedLibrary::getOSName
static std::string getOSName(const std::string &name)
Definition:
shared_library.cpp:23
BT::SharedLibrary::hasSymbol
bool hasSymbol(const std::string &name)
Definition:
shared_library.cpp:18
path
Simple class for manipulating paths on Linux/Windows/Mac OS.
Definition:
path.h:42
shared_library.h
behaviortree_cpp_v3
Author(s): Michele Colledanchise, Davide Faconti
autogenerated on Wed Jun 26 2024 02:51:19