Sarafun Behavior Trees package
1
Behavior trees for the SARAFun project
Main Page
Data Structures
All
Data Structures
Namespaces
Functions
Variables
Enumerations
Enumerator
sarafun_tree
include
sarafun_tree
parse_tree.h
1
#ifndef __PARSE_TREE__
2
#define __PARSE_TREE__
3
4
#include <fstream>
5
#include <json/json.hpp>
6
#include <behavior_tree_core/BehaviorTree.h>
7
#include <ros/package.h>
8
9
using
json = nlohmann::json;
10
11
namespace
bt_parser {
12
17
class
Parser
{
18
public
:
22
Parser
(std::string filepath);
23
~Parser
();
24
25
/*
26
Parses the JSON tree description.
27
28
@return A pointer to the tree root.
29
@throw logic_error
30
*/
31
BT::TreeNode *
parseTree
();
32
33
private
:
34
std::ifstream
file_
;
35
json
tree_j_
;
36
std::string
current_id_
;
37
38
/*
39
Parses a subtree of the JSON description.
40
41
@param node A json node object with a subtree to be parsed.
42
@return A pointer to the subtree root.
43
@throw logic_error
44
*/
45
BT::TreeNode *
parseTree
(json node);
46
53
void
verifyNode
(json node);
54
};
55
}
56
#endif
bt_parser::Parser::verifyNode
void verifyNode(json node)
Definition:
parse_tree.cpp:8
bt_parser::Parser::parseTree
BT::TreeNode * parseTree()
Definition:
parse_tree.cpp:29
bt_parser::Parser::current_id_
std::string current_id_
Definition:
parse_tree.h:36
bt_parser::Parser::~Parser
~Parser()
Definition:
parse_tree.cpp:6
bt_parser::Parser::file_
std::ifstream file_
Definition:
parse_tree.h:34
bt_parser::Parser::tree_j_
json tree_j_
Definition:
parse_tree.h:35
bt_parser::Parser
Definition:
parse_tree.h:17
bt_parser::Parser::Parser
Parser(std::string filepath)
Definition:
parse_tree.cpp:5
Generated on Fri Feb 17 2017 11:14:54 for Sarafun Behavior Trees package by
1.8.6