Static Public Member Functions | Private Member Functions | Static Private Member Functions | Static Private Attributes
stdr_parser::Parser Class Reference

Implements the main functionalities of the high-level parser. More...

#include <stdr_parser.h>

List of all members.

Static Public Member Functions

template<class T >
static T createMessage (std::string file_name)
 Creates a message from a file.
template<class T >
static void saveMessage (T msg, std::string file_name)
 Saves a stdr_msgs::Noise message to a file.

Private Member Functions

 Parser (void)
 Default constructor.

Static Private Member Functions

static bool eliminateFilenames (Node *n)
 Recursive function - Expands the 'filename' nodes and eliminates them.
static bool mergeNodes (Node *n)
 Recursive function - Merges the nodes that do not exist in non_mergable_tags_.
static void mergeNodesValues (Node *n)
 Merges the leaves of the xml tree, which are the value nodes.
static void parse (std::string file_name)
 Parses an xml file.

Static Private Attributes

static Nodebase_node_ = new Node()
 < Base node of the parsed file

Detailed Description

Implements the main functionalities of the high-level parser.

Definition at line 42 of file stdr_parser.h.


Constructor & Destructor Documentation

stdr_parser::Parser::Parser ( void  ) [private]

Default constructor.

Returns:
void

Definition at line 34 of file stdr_parser.cpp.


Member Function Documentation

template<class T >
static T stdr_parser::Parser::createMessage ( std::string  file_name) [inline, static]

Creates a message from a file.

Parameters:
file_name[std::string] The filename
Returns:
T : The message

Definition at line 91 of file stdr_parser.h.

bool stdr_parser::Parser::eliminateFilenames ( Node n) [static, private]

Recursive function - Expands the 'filename' nodes and eliminates them.

Parameters:
n[Node*] The stdr xml tree node to begin
Returns:
bool : True is a 'filename' node was expanded

< Sanity check for filename. Base and file must be the same

Definition at line 94 of file stdr_parser.cpp.

bool stdr_parser::Parser::mergeNodes ( Node n) [static, private]

Recursive function - Merges the nodes that do not exist in non_mergable_tags_.

Parameters:
n[Node*] The stdr xml tree node to begin
Returns:
bool : True is a ndoe was merged

< 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.

void stdr_parser::Parser::mergeNodesValues ( Node n) [static, private]

Merges the leaves of the xml tree, which are the value nodes.

Parameters:
n[Node*] The stdr xml tree node to begin
Returns:
void

< Check if the node does not contain pure values

< Unique value child

Definition at line 145 of file stdr_parser.cpp.

void stdr_parser::Parser::parse ( std::string  file_name) [static, private]

Parses an xml file.

Parameters:
file_name[std::string] The xml filename
Returns:
void

< Uncomment to see the internal tree structure

Definition at line 44 of file stdr_parser.cpp.

template<class T >
static void stdr_parser::Parser::saveMessage ( msg,
std::string  file_name 
) [inline, static]

Saves a stdr_msgs::Noise message to a file.

Parameters:
msg[T] The message
file_name[std::string] The filename
Returns:
void

Definition at line 114 of file stdr_parser.h.


Member Data Documentation

Node * stdr_parser::Parser::base_node_ = new Node() [static, private]

< Base node of the parsed file

< Static initializations

Definition at line 47 of file stdr_parser.h.


The documentation for this class was generated from the following files:


stdr_parser
Author(s): Manos Tsardoulias, Chris Zalidis, Aris Thallas
autogenerated on Thu Jun 6 2019 18:57:14