Implements the main functionalities of the high-level parser. More...
#include <stdr_parser.h>
Static Public Member Functions | |
template<class T > | |
static T | createMessage (std::string file_name) |
Creates a message from a file. More... | |
template<class T > | |
static void | saveMessage (T msg, std::string file_name) |
Saves a stdr_msgs::Noise message to a file. More... | |
Private Member Functions | |
Parser (void) | |
Default constructor. More... | |
Static Private Member Functions | |
static bool | eliminateFilenames (Node *n) |
Recursive function - Expands the 'filename' nodes and eliminates them. More... | |
static bool | mergeNodes (Node *n) |
Recursive function - Merges the nodes that do not exist in non_mergable_tags_. More... | |
static void | mergeNodesValues (Node *n) |
Merges the leaves of the xml tree, which are the value nodes. More... | |
static void | parse (std::string file_name) |
Parses an xml file. More... | |
Static Private Attributes | |
static Node * | base_node_ = new Node() |
< Base node of the parsed file More... | |
Implements the main functionalities of the high-level parser.
Definition at line 42 of file stdr_parser.h.
|
private |
|
inlinestatic |
Creates a message from a file.
file_name | [std::string] The filename |
Definition at line 91 of file stdr_parser.h.
|
staticprivate |
Recursive function - Expands the 'filename' nodes and eliminates them.
n | [Node*] The stdr xml tree node to begin |
< Sanity check for filename. Base and file must be the same
Definition at line 94 of file stdr_parser.cpp.
|
staticprivate |
Recursive function - Merges the nodes that do not exist in non_mergable_tags_.
n | [Node*] The stdr xml tree node to begin |
< Node is value
< Node's child is value
< Child is a mergable tag
< Multiple mergable tags
< Merging multiple tag's children into the first occurence
Definition at line 195 of file stdr_parser.cpp.
|
staticprivate |
Merges the leaves of the xml tree, which are the value nodes.
n | [Node*] The stdr xml tree node to begin |
< Check if the node does not contain pure values
< Unique value child
Definition at line 145 of file stdr_parser.cpp.
|
staticprivate |
Parses an xml file.
file_name | [std::string] The xml filename |
< Uncomment to see the internal tree structure
Definition at line 44 of file stdr_parser.cpp.
|
inlinestatic |
Saves a stdr_msgs::Noise message to a file.
msg | [T] The message |
file_name | [std::string] The filename |
Definition at line 114 of file stdr_parser.h.
< Base node of the parsed file
< Static initializations
Definition at line 47 of file stdr_parser.h.