joint_dispatcher
Public Types | Public Member Functions | List of all members
joint_dispatcher::Dispatcher Class Reference

#include <Dispatcher.hpp>

Public Types

typedef size_t ChannelID
 

Public Member Functions

ChannelID addInput (std::string const &name="")
 
ChannelID addOutput (std::string const &name, std::vector< std::string > const &jointNames)
 
ChannelID addOutput (std::string const &name="", size_t size=0)
 
ChannelID getInputByName (std::string const &name) const
 
ChannelID getOutputByName (std::string const &name) const
 
OutputgetOutput (ChannelID id)
 
void addDispatch (ChannelID input, JointSelection const &inputJoints, ChannelID output, JointSelection const &outputJoints)
 
void addDispatch (std::string const &input, JointSelection const &inputJoints, std::string const &output, JointSelection const &outputJoints)
 
void write (ChannelID input, base::samples::Joints const &sample)
 
void write (std::string const &input, base::samples::Joints const &sample)
 
bool read (ChannelID output, base::samples::Joints &sample)
 
bool read (std::string const &name, base::samples::Joints &sample)
 
void reset ()
 

Detailed Description

Implementation of mux/demux logic for base::samples::Joints

This class allows to transfer arbitrary sets of joints on inputs to other sets on outputs. It allows to

Member Typedef Documentation

Member Function Documentation

void Dispatcher::addDispatch ( ChannelID  input,
JointSelection const &  inputJoints,
ChannelID  output,
JointSelection const &  outputJoints 
)

This declares a mapping from some joints on a given input and some joints on a given output

void Dispatcher::addDispatch ( std::string const &  input,
JointSelection const &  inputJoints,
std::string const &  output,
JointSelection const &  outputJoints 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Dispatcher::ChannelID Dispatcher::addInput ( std::string const &  name = "")

This declares an input to the dispatcher

Parameters
namethe input name. This is mostly used for debugging / status purposes
Returns
the ID of the created input
Dispatcher::ChannelID Dispatcher::addOutput ( std::string const &  name,
std::vector< std::string > const &  jointNames 
)

This declares an output to the dispatcher, as well as the joint names for this output

Parameters
namethe output name. This can be left empty.
Dispatcher::ChannelID Dispatcher::addOutput ( std::string const &  name = "",
size_t  size = 0 
)

This declares an output to the dispatcher, as well as the expected number of joints.

If non-zero, the number of joints is used for (1) consistency checking and (2) pre-allocating the needed arrays.

Dispatcher::ChannelID Dispatcher::getInputByName ( std::string const &  name) const

Returns the ID of an input from its name

Output & Dispatcher::getOutput ( ChannelID  id)

Returns the Output object associated with the given ID

Dispatcher::ChannelID Dispatcher::getOutputByName ( std::string const &  name) const

Returns the ID of an output from its name

bool Dispatcher::read ( ChannelID  output,
base::samples::Joints &  sample 
)

Reads a given output channel

Returns
true if this channel had been updated since the last read, and false otherwise. The sample is not modified if the channel was not updated
bool Dispatcher::read ( std::string const &  name,
base::samples::Joints &  sample 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

void Dispatcher::reset ( )

Resets the internal tracking state without changing the configuration state

void Dispatcher::write ( ChannelID  input,
base::samples::Joints const &  sample 
)

Pushes a sample on a given input

The outputs for which there is a dispatch are going to be updated

void Dispatcher::write ( std::string const &  input,
base::samples::Joints const &  sample 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.


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