#include <bottlecreatorgenerator.hpp>
Public Member Functions | |
BottleCreatorGenerator (int numFields, const double &rate_, bool toRos) | |
~BottleCreatorGenerator () | |
int | getNumFields () |
std::vector< ChildGenerator > | getChildren () |
std::vector< std::string > | getFieldsType () |
std::vector< std::string > | getFieldsMsg () |
std::vector< std::string > | getFieldsMux () |
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_ |
int | listIndex_ |
bool | toRos_ |
std::vector< ChildGenerator > | children_ |
std::vector< std::string > | fieldsType_ |
std::vector< std::string > | fieldsMsg_ |
std::vector< std::string > | fieldsMux_ |
double | rate |
double | period |
Class that generates the code for building the message and sending it through the network (YARP port/ROS topic) This class represents the top level of the message hierarchy (root of the tree)
Definition at line 10 of file bottlecreatorgenerator.hpp.
BottleCreatorGenerator::BottleCreatorGenerator | ( | int | numFields, |
const double & | rate_, | ||
bool | toRos | ||
) |
Constructor
numFields | Number of items (either simple types or messages) of the message |
rate_ | Rate at which the message will be sent (hz) |
toRos | Boolean flag to know the type of output (ROS message or YARP Bottle) |
Definition at line 7 of file bottlecreatorgenerator.cpp.
BottleCreatorGenerator::~BottleCreatorGenerator | ( | ) |
Destructor
Definition at line 16 of file bottlecreatorgenerator.cpp.
|
virtual |
Generates the code that builds the message for all the items in the configuration file
Implements YarpCodeGenerator.
Definition at line 76 of file bottlecreatorgenerator.cpp.
|
private |
Generates the code that builds the message for an item of the top of the hierarchy, considering all its children in the message tree
index | at the ChildGenerator std::vector |
Definition at line 99 of file bottlecreatorgenerator.cpp.
|
private |
Vector of ChildGenerator class, that handles built-in (primitive) messages and arrays of built-in messages
Definition at line 62 of file bottlecreatorgenerator.hpp.
|
private |
Vector of std::string that stores "single_value" or "list" if that is the type of the item
Definition at line 64 of file bottlecreatorgenerator.hpp.
|
private |
Vector of std::string that stores "mux" if that is the type of the item
Definition at line 65 of file bottlecreatorgenerator.hpp.
|
private |
Vector of std::string that contains all the message types at the top of the message hierarchy, read from the configuration file
Definition at line 63 of file bottlecreatorgenerator.hpp.
|
private |
Number of items in the message
Definition at line 59 of file bottlecreatorgenerator.hpp.
|
private |
Boolean flag to know the type of output
Definition at line 61 of file bottlecreatorgenerator.hpp.