| 255 | } |
| 256 | |
| 257 | void 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) |
| 277 | void BehaviorTreeFactory::registerFromROSPlugins() |