bt_parser.h
Go to the documentation of this file.
1 /* Copyright (C) 2023 Davide Faconti - All Rights Reserved
2 *
3 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"),
4 * to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
5 * and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6 * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
9 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
10 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
11 */
12 
13 #pragma once
14 
15 #include <filesystem>
18 
19 namespace BT
20 {
26 class Parser
27 {
28 public:
29  Parser() = default;
30 
31  virtual ~Parser() = default;
32 
33  Parser(const Parser& other) = delete;
34  Parser& operator=(const Parser& other) = delete;
35 
36  Parser(Parser&& other) = default;
37  Parser& operator=(Parser&& other) = default;
38 
39  virtual void loadFromFile(const std::filesystem::path& filename,
40  bool add_includes = true) = 0;
41 
42  virtual void loadFromText(const std::string& xml_text, bool add_includes = true) = 0;
43 
44  virtual std::vector<std::string> registeredBehaviorTrees() const = 0;
45 
46  virtual Tree instantiateTree(const Blackboard::Ptr& root_blackboard,
47  std::string tree_name = {}) = 0;
48 
49  virtual void clearInternalState(){};
50 };
51 
52 } // namespace BT
BT
Definition: ex01_wrap_legacy.cpp:29
BT::Parser::Parser
Parser()=default
BT::Tree
Struct used to store a tree. If this object goes out of scope, the tree is destroyed.
Definition: bt_factory.h:91
bt_factory.h
BT::Parser::registeredBehaviorTrees
virtual std::vector< std::string > registeredBehaviorTrees() const =0
BT::Parser::~Parser
virtual ~Parser()=default
BT::Blackboard::Ptr
std::shared_ptr< Blackboard > Ptr
Definition: blackboard.h:35
BT::Parser::clearInternalState
virtual void clearInternalState()
Definition: bt_parser.h:49
BT::Parser::loadFromFile
virtual void loadFromFile(const std::filesystem::path &filename, bool add_includes=true)=0
BT::Parser::loadFromText
virtual void loadFromText(const std::string &xml_text, bool add_includes=true)=0
BT::Parser::instantiateTree
virtual Tree instantiateTree(const Blackboard::Ptr &root_blackboard, std::string tree_name={})=0
BT::Parser::operator=
Parser & operator=(const Parser &other)=delete
blackboard.h
xml_text
static const char * xml_text
Definition: ex01_wrap_legacy.cpp:52
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:26


behaviortree_cpp_v4
Author(s): Davide Faconti
autogenerated on Fri Jun 28 2024 02:20:07