iCub-main
|
The IndexSelector selects the components at specified indices from the source. More...
Public Member Functions | |
IndexSelector (std::string format) | |
Default constructor. More... | |
std::string | toString (int indent=0) |
Returns a string specification of the data selector. More... | |
virtual void | declareSources (SourceList &sl) |
Declares the required sources for this data selector to the source list. More... | |
virtual void | select (Bottle &bot, SourceList &sl) |
Selectively adds data from the source list to an output bottle. More... | |
virtual void | loadFormat (std::string format) |
Loads the format of the IndexSelector from a string. More... | |
virtual void | loadIndices (std::string format) |
Loads index specifiers from a string format. More... | |
Static Public Member Functions | |
static std::vector< std::string > | split (std::string input, std::string delimiter) |
Splits a string into parts at the given delimiter. More... | |
static int | stringToInt (std::string str) |
Converts a string to an integer in a proper C++ way. More... | |
Protected Member Functions | |
virtual void | selectRecursive (Bottle &out, Bottle &in, std::list< std::list< int > >::iterator it) |
Select data from source recursively using the index specifiers. More... | |
virtual void | addBottle (Bottle &out, const Bottle &in) |
Adds all the elements in one bottle to an output bottle. More... | |
Protected Attributes | |
std::string | name |
The name of the source port. More... | |
std::list< std::list< int > > | indices |
A list of a list of indices. More... | |
The IndexSelector selects the components at specified indices from the source.
It supports an arbitrary number of dimensions and indices can be specified using a range. If not indices are specified, it returns all of the source data.
|
inline |
|
inlineprotectedvirtual |
|
inlinevirtual |
Declares the required sources for this data selector to the source list.
sl | the source list |
Implements iCub::learningmachine::merge::DataSelector.
|
inlinevirtual |
Loads the format of the IndexSelector from a string.
format | the format string |
a | runtime error if parsing fails |
|
inlinevirtual |
|
inlinevirtual |
Selectively adds data from the source list to an output bottle.
bot | a reference to the output Bottle |
sl | the source list |
Implements iCub::learningmachine::merge::DataSelector.
|
inlineprotectedvirtual |
|
inlinestatic |
|
inlinestatic |
|
inlinevirtual |
Returns a string specification of the data selector.
indent | a number of spaces of indentation |
Implements iCub::learningmachine::merge::DataSelector.
|
protected |
|
protected |