MCPcopy Create free account
hub / github.com/BehaviorTree/BehaviorTree.CPP / registerFromPlugin

Method registerFromPlugin

src/bt_factory.cpp:257–274  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

255}
256
257void BehaviorTreeFactory::registerFromPlugin(const std::string& file_path)
258{
259 BT::SharedLibrary loader;
260 loader.load(file_path);
261 using Func = void (*)(BehaviorTreeFactory&);
262
263 if(loader.hasSymbol(PLUGIN_SYMBOL))
264 {
265 // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast)
266 auto* func = reinterpret_cast<Func>(loader.getSymbol(PLUGIN_SYMBOL));
267 func(*this);
268 }
269 else
270 {
271 std::cout << "ERROR loading library [" << file_path << "]: can't find symbol ["
272 << PLUGIN_SYMBOL << "]" << std::endl;
273 }
274}
275
276// NOLINTNEXTLINE(readability-convert-member-functions-to-static)
277void BehaviorTreeFactory::registerFromROSPlugins()

Callers 5

mainFunction · 0.80
mainFunction · 0.80
TEST_FFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80

Calls 3

hasSymbolMethod · 0.80
getSymbolMethod · 0.80
loadMethod · 0.45

Tested by 1

TEST_FFunction · 0.64