The IndexSelector selects the components at specified indices from the source.
More...
|
| IndexSelector (std::string format) |
| Default constructor.
|
|
std::string | toString (int indent=0) |
| Returns a string specification of the data selector.
|
|
virtual void | declareSources (SourceList &sl) |
| Declares the required sources for this data selector to the source list.
|
|
virtual void | select (Bottle &bot, SourceList &sl) |
| Selectively adds data from the source list to an output bottle.
|
|
virtual void | loadFormat (std::string format) |
| Loads the format of the IndexSelector from a string.
|
|
virtual void | loadIndices (std::string format) |
| Loads index specifiers from a string format.
|
|
|
static std::vector< std::string > | split (std::string input, std::string delimiter) |
| Splits a string into parts at the given delimiter.
|
|
static int | stringToInt (std::string str) |
| Converts a string to an integer in a proper C++ way.
|
|
|
virtual void | selectRecursive (Bottle &out, Bottle &in, std::list< std::list< int > >::iterator it) |
| Select data from source recursively using the index specifiers.
|
|
virtual void | addBottle (Bottle &out, const Bottle &in) |
| Adds all the elements in one bottle to an output bottle.
|
|
|
std::string | name |
| The name of the source port.
|
|
std::list< std::list< int > > | indices |
| A list of a list of indices.
|
|
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.
Definition at line 346 of file merge.cpp.
◆ IndexSelector()
iCub::learningmachine::merge::IndexSelector::IndexSelector |
( |
std::string |
format | ) |
|
|
inline |
Default constructor.
- Parameters
-
format | a string specifying the format |
Definition at line 410 of file merge.cpp.
◆ addBottle()
virtual void iCub::learningmachine::merge::IndexSelector::addBottle |
( |
Bottle & |
out, |
|
|
const Bottle & |
in |
|
) |
| |
|
inlineprotectedvirtual |
Adds all the elements in one bottle to an output bottle.
- Parameters
-
out | a reference to the output bottle |
in | a reference to the input bottle |
Definition at line 398 of file merge.cpp.
◆ declareSources()
virtual void iCub::learningmachine::merge::IndexSelector::declareSources |
( |
SourceList & |
sl | ) |
|
|
inlinevirtual |
◆ loadFormat()
virtual void iCub::learningmachine::merge::IndexSelector::loadFormat |
( |
std::string |
format | ) |
|
|
inlinevirtual |
Loads the format of the IndexSelector from a string.
- Parameters
-
- Exceptions
-
a | runtime error if parsing fails |
Definition at line 464 of file merge.cpp.
◆ loadIndices()
virtual void iCub::learningmachine::merge::IndexSelector::loadIndices |
( |
std::string |
format | ) |
|
|
inlinevirtual |
Loads index specifiers from a string format.
- Parameters
-
- Exceptions
-
a | runtime error if parsing the index specifiers fails |
Definition at line 490 of file merge.cpp.
◆ select()
virtual void iCub::learningmachine::merge::IndexSelector::select |
( |
Bottle & |
bot, |
|
|
SourceList & |
sl |
|
) |
| |
|
inlinevirtual |
◆ selectRecursive()
virtual void iCub::learningmachine::merge::IndexSelector::selectRecursive |
( |
Bottle & |
out, |
|
|
Bottle & |
in, |
|
|
std::list< std::list< int > >::iterator |
it |
|
) |
| |
|
inlineprotectedvirtual |
Select data from source recursively using the index specifiers.
- Parameters
-
out | a reference to the output Bottle |
in | a reference to the input bottle |
it | the iterator |
- Exceptions
-
a | runtime error if trying to index a non-list type |
Definition at line 367 of file merge.cpp.
◆ split()
static std::vector< std::string > iCub::learningmachine::merge::IndexSelector::split |
( |
std::string |
input, |
|
|
std::string |
delimiter |
|
) |
| |
|
inlinestatic |
Splits a string into parts at the given delimiter.
- Parameters
-
input | the input string |
delimiter | the delimiter |
- Returns
- a vector with the string parts
Definition at line 530 of file merge.cpp.
◆ stringToInt()
static int iCub::learningmachine::merge::IndexSelector::stringToInt |
( |
std::string |
str | ) |
|
|
inlinestatic |
Converts a string to an integer in a proper C++ way.
- Parameters
-
- Returns
- an integer
- Exceptions
-
a | runtime error if the string cannot be parsed as an integer |
Definition at line 548 of file merge.cpp.
◆ toString()
std::string iCub::learningmachine::merge::IndexSelector::toString |
( |
int |
indent = 0 | ) |
|
|
inlinevirtual |
◆ indices
std::list<std::list<int> > iCub::learningmachine::merge::IndexSelector::indices |
|
protected |
A list of a list of indices.
For each dimension, there is a list of indices.
Definition at line 357 of file merge.cpp.
◆ name
std::string iCub::learningmachine::merge::IndexSelector::name |
|
protected |
The name of the source port.
Definition at line 351 of file merge.cpp.
The documentation for this class was generated from the following file:
- icub-main/src/modules/learningMachine/src/bin/merge.cpp