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

Function main

examples/ex02_runtime_ports.cpp:51–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49};
50
51int main()
52{
53 BehaviorTreeFactory factory;
54
55 //-------- register ports that might be defined at runtime --------
56 // more verbose way
57 PortsList think_ports = { BT::OutputPort<std::string>("text") };
58 factory.registerBuilder(
59 CreateManifest<ThinkRuntimePort>("ThinkRuntimePort", think_ports),
60 CreateBuilder<ThinkRuntimePort>());
61 // less verbose way
62 PortsList say_ports = { BT::InputPort<std::string>("message") };
63 factory.registerNodeType<SayRuntimePort>("SayRuntimePort", say_ports);
64
65 factory.registerBehaviorTreeFromText(xml_text);
66 auto tree = factory.createTree("MainTree");
67 tree.tickWhileRunning();
68
69 return 0;
70}

Callers

nothing calls this directly

Calls 4

createTreeMethod · 0.80
tickWhileRunningMethod · 0.80
registerBuilderMethod · 0.45

Tested by

no test coverage detected