#include <portmuxgenerator.hpp>
Public Member Functions | |
PortMuxGenerator (int numMuxes, std::string outputName, bool toRos, std::string &output_port_name_, std::string &ros_message_name, bool fromRos) | |
~PortMuxGenerator () | |
int | getNumMuxes () |
std::string | getOutputName () |
std::string | getRosMessageName () |
bool | getToRos () |
bool | getFromRos () |
std::vector< int > | getNumPorts () |
std::vector< std::string > | getPorts () |
void | addMuxNumPorts (int numPorts) |
void | addMuxPorts (std::string ports) |
int | getMuxNumPorts (int muxIndex) |
std::string | getMuxPorts (int muxIndex) |
std::string | generateCode () |
Private Member Functions | |
std::string | extractPortFromString (int muxIndex, int portIndex) |
Private Attributes | |
int | numMuxes_ |
std::string | outputName_ |
std::string | rosMessageName_ |
bool | toRos_ |
bool | fromRos_ |
std::vector< int > | numPorts_ |
std::vector< std::string > | ports_ |
std::string | output_port_name |
Class that generates the code for connecting and reading the values from the input YARP ports/ROS topics
Definition at line 8 of file portmuxgenerator.hpp.
PortMuxGenerator::PortMuxGenerator | ( | int | numMuxes, |
std::string | outputName, | ||
bool | toRos, | ||
std::string & | output_port_name_, | ||
std::string & | ros_message_name, | ||
bool | fromRos | ||
) |
Constructor
numMuxes | Number of hubs |
outputName | YARP port/ROS topic where the output will be send |
toRos | Boolean flag to know the type of output (ROS message or YARP Bottle) |
output_port_name_ | Folder name where the code will be copied |
ros_message_name | When writing to a ROS topic, this is the ROS message name |
fromRos | Boolean flag to know the type of inputs (ROS message or YARP Bottle) |
Definition at line 9 of file portmuxgenerator.cpp.
PortMuxGenerator::~PortMuxGenerator | ( | ) |
Destructor
Definition at line 19 of file portmuxgenerator.cpp.
void PortMuxGenerator::addMuxPorts | ( | std::string | ports | ) |
Adds the ports/topics string of a hub
ports | String with comma separated ports/topics |
Definition at line 52 of file portmuxgenerator.cpp.
|
private |
Retrieve port/topic name from wrap of ports names. Requires names separated by commas and no spaces between them.
muxIndex | Hub's index in the vector of Hubs |
portIndex | Port's index in the ports string |
Definition at line 182 of file portmuxgenerator.cpp.
|
virtual |
Generates the code that connects to all the YARP ports/ROS topics
Implements YarpCodeGenerator.
Definition at line 64 of file portmuxgenerator.cpp.
int PortMuxGenerator::getMuxNumPorts | ( | int | muxIndex | ) |
Returns the number of ports read by the hub at muxIndex in the hub vector
muxIndex | Hub index in the Hub vector |
Definition at line 56 of file portmuxgenerator.cpp.
std::string PortMuxGenerator::getMuxPorts | ( | int | muxIndex | ) |
Returns the string that contains all the YARP ports/ROS topics for the hub muxIndex
muxIndex | Hub index in the Hub vector |
Definition at line 60 of file portmuxgenerator.cpp.
|
private |
Boolean flag to know the type of inputs (ROS message or YARP Bottle)
Definition at line 71 of file portmuxgenerator.hpp.
|
private |
Number of hubs
Definition at line 67 of file portmuxgenerator.hpp.
|
private |
Vector that contains the number of ports for all the hubs
Definition at line 72 of file portmuxgenerator.hpp.
|
private |
Folder name where the code will be copied
Definition at line 74 of file portmuxgenerator.hpp.
|
private |
YARP port/ROS topic where the output will be send
Definition at line 68 of file portmuxgenerator.hpp.
|
private |
Vector that contains the inputs (ports/topics) for all the hubs
Definition at line 73 of file portmuxgenerator.hpp.
|
private |
When writing to a ROS topic, this is the ROS message name
Definition at line 69 of file portmuxgenerator.hpp.
|
private |
Boolean flag to know the type of output (ROS message or YARP Bottle)
Definition at line 70 of file portmuxgenerator.hpp.