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

#include <dataconvertergenerator.hpp>

Inheritance diagram for DataConverterGenerator:
YarpCodeGenerator

Public Member Functions

 DataConverterGenerator ()
 
std::vector< std::string > getFunction ()
 
std::vector< bool > getVerbose ()
 
void addConverterFunction (std::string function)
 
void addConverterVerbose (bool verbose)
 
std::string getConverterFunction (int converterIndex)
 
bool getConverterVerbose (int converterIndex)
 
std::string generateCode ()
 

Private Member Functions

std::string functionToString (int converterIndex)
 

Private Attributes

std::vector< std::string > function_
 
std::vector< bool > verbose_
 

Detailed Description

Header of the class that generates the code of the converter function for the elements of a hub

Definition at line 8 of file dataconvertergenerator.hpp.

Constructor & Destructor Documentation

DataConverterGenerator::DataConverterGenerator ( )

Constructor

Implementation of the class that generates the code of the converter function for the elements of a hub

Definition at line 12 of file dataconvertergenerator.cpp.

Member Function Documentation

std::string DataConverterGenerator::functionToString ( int  converterIndex)
private

Returns the string containing the code of the converter function. One can add new functions to this method in order to expand the functionality of the converter, but try to document what kind of objects should the mux result have. Example: the function deg_to_rad expects a mutex containing doubles.

Parameters
converterIndexidentifier in the array of functions of this particular hub
Returns
std::string line(s) of code that performs the data conversion

Definition at line 65 of file dataconvertergenerator.cpp.

std::string DataConverterGenerator::generateCode ( )
virtual

Method that implements the code generation

Returns
String that contains the code

Implements YarpCodeGenerator.

Definition at line 44 of file dataconvertergenerator.cpp.

Member Data Documentation

std::vector<std::string> DataConverterGenerator::function_
private

converter function name

Definition at line 31 of file dataconvertergenerator.hpp.

std::vector<bool> DataConverterGenerator::verbose_
private

Verbose flag

Definition at line 32 of file dataconvertergenerator.hpp.


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