bt_plugin_manifest.cpp
Go to the documentation of this file.
1 #include <stdio.h>
2 #include <iostream>
3 #include <fstream>
4 #include <unordered_map>
6 
7 int main(int argc, char* argv[])
8 {
9  if (argc != 2)
10  {
11  printf("Wrong number of command line arguments\nUsage: %s [filename]\n", argv[0]);
12  return 1;
13  }
14 
16 
17  std::unordered_set<std::string> default_nodes;
18  for (auto& it : factory.manifests())
19  {
20  const auto& manifest = it.second;
21  default_nodes.insert(manifest.registration_ID);
22  }
23 
24  factory.registerFromPlugin(argv[1]);
25 
26  for (auto& it : factory.manifests())
27  {
28  const auto& manifest = it.second;
29  if (default_nodes.count(manifest.registration_ID) > 0)
30  {
31  continue;
32  }
33  auto& params = manifest.ports;
34  std::cout << "---------------\n"
35  << manifest.registration_ID << " [" << manifest.type
36  << "]\n NodeParameters: " << params.size();
37 
38  if (params.size() > 0)
39  {
40  std::cout << ":";
41  }
42 
43  std::cout << std::endl;
44 
45  for (auto& param : params)
46  {
47  std::cout << " - [Key]: \"" << param.first << "\"" << std::endl;
48  }
49  }
50 
51  return 0;
52 }
int main(int argc, char *argv[])
manifest
The BehaviorTreeFactory is used to create instances of a TreeNode at run-time.
Definition: bt_factory.h:207
void registerFromPlugin(const std::string &file_path)
registerFromPlugin load a shared library and execute the function BT_REGISTER_NODES (see macro)...
Definition: bt_factory.cpp:135
const std::unordered_map< std::string, TreeNodeManifest > & manifests() const
Manifests of all the registered TreeNodes.
Definition: bt_factory.cpp:239


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