#include <childgenerator.hpp>
Public Member Functions | |
ChildGenerator (int numFields, bool toRos) | |
~ChildGenerator () | |
int | getNumFields () |
std::vector< ChildGenerator > | getChildren () |
std::vector< std::string > | getFieldsType () |
std::vector< std::string > | getFieldsMsg () |
std::vector< std::string > | getFieldsMux () |
void | setParentName (std::string parentName) |
void | addChild (ChildGenerator &child) |
void | addFieldType (std::string type) |
void | addFieldMsg (std::string msg) |
void | addFieldMux (std::string mux) |
void | removeFirstChild () |
ChildGenerator & | getFirstChild () |
std::string | getFieldType (int fieldIndex) |
std::string | getFieldMsg (int fieldIndex) |
std::string | getFieldMux (int fieldIndex) |
std::string | generateCode () |
Private Member Functions | |
std::string | handleFieldGeneration (int fieldIndex) |
Private Attributes | |
int | numFields_ |
bool | toRos_ |
int | listIndex_ |
std::string | parentName_ |
std::vector< ChildGenerator > | children_ |
std::vector< std::string > | fieldsType_ |
std::vector< std::string > | fieldsMsg_ |
std::vector< std::string > | fieldsMux_ |
Class that generates the code for building the message and sending it through the network (YARP port/ROS topic) This class represents the any leaf of the message hierarchy (not the root of the tree)
Definition at line 9 of file childgenerator.hpp.
ChildGenerator::ChildGenerator | ( | int | numFields, |
bool | toRos | ||
) |
Constructor
numFields | Number of items (either simple types or messages) of the message |
toRos | Boolean flag to know the type of output (ROS message or YARP Bottle) |
Definition at line 8 of file childgenerator.cpp.
ChildGenerator::~ChildGenerator | ( | ) |
Destructor
Definition at line 13 of file childgenerator.cpp.
|
virtual |
Generates the code that builds the message for the current node in the message hierarchy and all its leaves
Implements YarpCodeGenerator.
Definition at line 77 of file childgenerator.cpp.
|
private |
Generates the code that builds the message for the current node in the hierarchy, considering all its children in the tree
index | at the ChildGenerator std::vector |
Definition at line 87 of file childgenerator.cpp.
|
private |
Vector of ChildGenerator class, that handles built-in (primitive) messages and arrays of built-in messages
Definition at line 63 of file childgenerator.hpp.
|
private |
Vector of std::string that stores "single_value" or "list" if that is the type of the item
Definition at line 65 of file childgenerator.hpp.
|
private |
Vector of std::string that stores "mux" if that is the type of the item
Definition at line 66 of file childgenerator.hpp.
|
private |
Vector of std::string that contains all the message types at the current node in the message hierarchy, read from the configuration file
Definition at line 64 of file childgenerator.hpp.
|
private |
Number of items in the current node
Definition at line 59 of file childgenerator.hpp.
|
private |
Boolean flag to know the type of output
Definition at line 60 of file childgenerator.hpp.