YarpBottleGenerator
 All Classes Files Functions Variables Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
ChildGenerator Class Reference

#include <childgenerator.hpp>

Inheritance diagram for ChildGenerator:
YarpCodeGenerator

Public Member Functions

 ChildGenerator (int numFields, bool toRos)
 
 ~ChildGenerator ()
 
int getNumFields ()
 
std::vector< ChildGeneratorgetChildren ()
 
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 ()
 
ChildGeneratorgetFirstChild ()
 
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< ChildGeneratorchildren_
 
std::vector< std::string > fieldsType_
 
std::vector< std::string > fieldsMsg_
 
std::vector< std::string > fieldsMux_
 

Detailed Description

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.

Constructor & Destructor Documentation

ChildGenerator::ChildGenerator ( int  numFields,
bool  toRos 
)

Constructor

Parameters
numFieldsNumber of items (either simple types or messages) of the message
toRosBoolean 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.

Member Function Documentation

std::string ChildGenerator::generateCode ( )
virtual

Generates the code that builds the message for the current node in the message hierarchy and all its leaves

Returns
String that contains the code for message building and sending

Implements YarpCodeGenerator.

Definition at line 77 of file childgenerator.cpp.

std::string ChildGenerator::handleFieldGeneration ( int  fieldIndex)
private

Generates the code that builds the message for the current node in the hierarchy, considering all its children in the tree

Parameters
indexat the ChildGenerator std::vector
Returns
String that contains the code for message building

Definition at line 87 of file childgenerator.cpp.

Member Data Documentation

std::vector<ChildGenerator> ChildGenerator::children_
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.

std::vector<std::string> ChildGenerator::fieldsMsg_
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.

std::vector<std::string> ChildGenerator::fieldsMux_
private

Vector of std::string that stores "mux" if that is the type of the item

Definition at line 66 of file childgenerator.hpp.

std::vector<std::string> ChildGenerator::fieldsType_
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.

int ChildGenerator::numFields_
private

Number of items in the current node

Definition at line 59 of file childgenerator.hpp.

bool ChildGenerator::toRos_
private

Boolean flag to know the type of output

Definition at line 60 of file childgenerator.hpp.


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