src
shared_library.cpp
Go to the documentation of this file.
1
#include "
behaviortree_cpp/utils/shared_library.h
"
2
#include "
behaviortree_cpp/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
lexyd::flags
constexpr auto flags(_sym< Table, Token, Tag > flag_rule)
Definition:
flags.hpp:83
shared_library.h
behaviortree_cpp_v4
Author(s): Davide Faconti
autogenerated on Fri Dec 13 2024 03:19:17