xml_parsing.h
Go to the documentation of this file.
1 #ifndef XML_PARSING_BT_H
2 #define XML_PARSING_BT_H
3 
5 
6 #include <unordered_map>
7 
8 namespace BT
9 {
15 class XMLParser : public Parser
16 {
17 public:
18  XMLParser(const BehaviorTreeFactory& factory);
19 
20  ~XMLParser() override;
21 
22  XMLParser(const XMLParser& other) = delete;
23  XMLParser& operator=(const XMLParser& other) = delete;
24 
25  void loadFromFile(const std::string& filename, bool add_includes = true) override;
26 
27  void loadFromText(const std::string& xml_text, bool add_includes = true) override;
28 
29  std::vector<std::string> registeredBehaviorTrees() const override;
30 
31  Tree instantiateTree(const Blackboard::Ptr& root_blackboard,
32  std::string main_tree_to_execute = {}) override;
33 
34  void clearInternalState() override;
35 
36 private:
37  struct Pimpl;
38  Pimpl* _p;
39 };
40 
41 void VerifyXML(const std::string& xml_text,
42  const std::unordered_map<std::string, NodeType>& registered_nodes);
43 
44 std::string writeTreeNodesModelXML(const BehaviorTreeFactory& factory,
45  bool include_builtin = false);
46 
47 } // namespace BT
48 
49 #endif // XML_PARSING_BT_H
BT
Definition: ex01_wrap_legacy.cpp:29
BT::XMLParser::clearInternalState
void clearInternalState() override
Definition: xml_parsing.cpp:480
BT::XMLParser::loadFromText
void loadFromText(const std::string &xml_text, bool add_includes=true) override
Definition: xml_parsing.cpp:111
BT::XMLParser::loadFromFile
void loadFromFile(const std::string &filename, bool add_includes=true) override
Definition: xml_parsing.cpp:98
BT::XMLParser::registeredBehaviorTrees
std::vector< std::string > registeredBehaviorTrees() const override
Definition: xml_parsing.cpp:121
BT::Tree
Struct used to store a tree. If this object goes out of scope, the tree is destroyed.
Definition: bt_factory.h:125
BT::XMLParser::operator=
XMLParser & operator=(const XMLParser &other)=delete
BT::XMLParser::instantiateTree
Tree instantiateTree(const Blackboard::Ptr &root_blackboard, std::string main_tree_to_execute={}) override
Definition: xml_parsing.cpp:439
BT::XMLParser::XMLParser
XMLParser(const BehaviorTreeFactory &factory)
Definition: xml_parsing.cpp:90
BT::XMLParser::_p
Pimpl * _p
Definition: xml_parsing.h:37
bt_parser.h
BT::BehaviorTreeFactory
The BehaviorTreeFactory is used to create instances of a TreeNode at run-time.
Definition: bt_factory.h:251
BT::XMLParser::Pimpl
Definition: xml_parsing.cpp:49
BT::VerifyXML
void VerifyXML(const std::string &xml_text, const std::unordered_map< std::string, NodeType > &registered_nodes)
BT::XMLParser
The XMLParser is a class used to read the model of a BehaviorTree from file or text and instantiate t...
Definition: xml_parsing.h:15
BT::Blackboard::Ptr
std::shared_ptr< Blackboard > Ptr
Definition: blackboard.h:25
xml_text
static const char * xml_text
Definition: ex01_wrap_legacy.cpp:52
BT::XMLParser::~XMLParser
~XMLParser() override
Definition: xml_parsing.cpp:93
BT::writeTreeNodesModelXML
std::string writeTreeNodesModelXML(const BehaviorTreeFactory &factory, bool include_builtin=false)
Definition: xml_parsing.cpp:797
BT::Parser
The BehaviorTreeParser is a class used to read the model of a BehaviorTree from file or text and inst...
Definition: bt_parser.h:25


behaviortree_cpp_v3
Author(s): Michele Colledanchise, Davide Faconti
autogenerated on Wed Jun 26 2024 02:51:19