iCub-main
Public Member Functions | Protected Types | Protected Attributes | List of all members
iCub::learningmachine::merge::SourceList Class Reference

The SourceList manages a map of PortSource objects. More...

Public Member Functions

 SourceList (std::string pp="/lm/merge/source")
 Default constructor. More...
 
 ~SourceList ()
 Default destructor. More...
 
 SourceList (const SourceList &other)
 Copy constructor. More...
 
SourceListoperator= (const SourceList &other)
 Assignment operator. More...
 
virtual void update ()
 Updates each registered port with new data. More...
 
virtual bool hasSource (std::string name)
 Returns true iff a PortSource has been registered for the given port name. More...
 
virtual void addSource (std::string name)
 Adds a source port for the given name. More...
 
virtual PortSourcegetSource (std::string name)
 Retrives the port source for a given name. More...
 
virtual void interrupt ()
 Recursively interrupt all sources. More...
 
virtual void close ()
 Recursively interrupt all sources. More...
 
virtual std::string getPortPrefix ()
 Returns the prefix for the source ports. More...
 
virtual void setPortPrefix (std::string pp)
 Sets the prefix for the source ports. More...
 

Protected Types

typedef std::map< std::string, PortSource * > SourceMap
 

Protected Attributes

std::string portPrefix
 Prefix for ports. More...
 
SourceMap sourceMap
 Map that links port names to the PortSource objects that are connected to them. More...
 

Detailed Description

The SourceList manages a map of PortSource objects.

Definition at line 189 of file merge.cpp.

Member Typedef Documentation

◆ SourceMap

typedef std::map<std::string, PortSource*> iCub::learningmachine::merge::SourceList::SourceMap
protected

Definition at line 191 of file merge.cpp.

Constructor & Destructor Documentation

◆ SourceList() [1/2]

iCub::learningmachine::merge::SourceList::SourceList ( std::string  pp = "/lm/merge/source")
inline

Default constructor.

Definition at line 208 of file merge.cpp.

◆ ~SourceList()

iCub::learningmachine::merge::SourceList::~SourceList ( )
inline

Default destructor.

Definition at line 213 of file merge.cpp.

◆ SourceList() [2/2]

iCub::learningmachine::merge::SourceList::SourceList ( const SourceList other)

Copy constructor.

Member Function Documentation

◆ addSource()

virtual void iCub::learningmachine::merge::SourceList::addSource ( std::string  name)
inlinevirtual

Adds a source port for the given name.

It does nothing if a source port with the given name already exists.

Parameters
namethe name

Definition at line 253 of file merge.cpp.

◆ close()

virtual void iCub::learningmachine::merge::SourceList::close ( void  )
inlinevirtual

Recursively interrupt all sources.

Definition at line 285 of file merge.cpp.

◆ getPortPrefix()

virtual std::string iCub::learningmachine::merge::SourceList::getPortPrefix ( )
inlinevirtual

Returns the prefix for the source ports.

Returns
the port prefix

Definition at line 295 of file merge.cpp.

◆ getSource()

virtual PortSource& iCub::learningmachine::merge::SourceList::getSource ( std::string  name)
inlinevirtual

Retrives the port source for a given name.

Parameters
namethe name
Exceptions
aruntime error if the name has not been registered

Definition at line 266 of file merge.cpp.

◆ hasSource()

virtual bool iCub::learningmachine::merge::SourceList::hasSource ( std::string  name)
inlinevirtual

Returns true iff a PortSource has been registered for the given port name.

Definition at line 243 of file merge.cpp.

◆ interrupt()

virtual void iCub::learningmachine::merge::SourceList::interrupt ( )
inlinevirtual

Recursively interrupt all sources.

Definition at line 276 of file merge.cpp.

◆ operator=()

SourceList& iCub::learningmachine::merge::SourceList::operator= ( const SourceList other)

Assignment operator.

◆ setPortPrefix()

virtual void iCub::learningmachine::merge::SourceList::setPortPrefix ( std::string  pp)
inlinevirtual

Sets the prefix for the source ports.

Parameters
ppthe port prefix

Definition at line 303 of file merge.cpp.

◆ update()

virtual void iCub::learningmachine::merge::SourceList::update ( )
inlinevirtual

Updates each registered port with new data.

Definition at line 232 of file merge.cpp.

Member Data Documentation

◆ portPrefix

std::string iCub::learningmachine::merge::SourceList::portPrefix
protected

Prefix for ports.

Definition at line 196 of file merge.cpp.

◆ sourceMap

SourceMap iCub::learningmachine::merge::SourceList::sourceMap
protected

Map that links port names to the PortSource objects that are connected to them.

Definition at line 202 of file merge.cpp.


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