iCub-main
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
iCub::learningmachine::merge::PortSource Class Reference

The PortSource collects data from a source port and caches the most recent Bottle of data. More...

Public Member Functions

 PortSource (std::string name, std::string pp)
 Default constructor.
 
 ~PortSource ()
 Default destructor.
 
virtual void initPort (std::string prefix)
 Opens the first free incoming port with the given prefix.
 
virtual void connect (std::string dst)
 Connects the incoming port to the specified port.
 
virtual void update ()
 Reads new data from the port and caches it locally.
 
virtual Bottle & getData ()
 Returns the locally cached data.
 
virtual void interrupt ()
 Interrupts the port.
 
virtual void close ()
 Closes the port.
 

Protected Member Functions

std::string getInputName (std::string prefix)
 Returns the first free port given a prefix appended by an integer.
 
 PortSource (const PortSource &other)
 Copy constructor (private and unimplemented on purpose).
 
PortSourceoperator= (const PortSource &other)
 Assignment operator (private and unimplemented on purpose).
 

Protected Attributes

Bottle data
 Cached data.
 
Port port
 The port for incoming data.
 

Detailed Description

The PortSource collects data from a source port and caches the most recent Bottle of data.

Definition at line 81 of file merge.cpp.

Constructor & Destructor Documentation

◆ PortSource() [1/2]

iCub::learningmachine::merge::PortSource::PortSource ( const PortSource other)
protected

Copy constructor (private and unimplemented on purpose).

◆ PortSource() [2/2]

iCub::learningmachine::merge::PortSource::PortSource ( std::string  name,
std::string  pp 
)
inline

Default constructor.

Definition at line 124 of file merge.cpp.

◆ ~PortSource()

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

Default destructor.

Definition at line 131 of file merge.cpp.

Member Function Documentation

◆ close()

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

Closes the port.

Definition at line 181 of file merge.cpp.

◆ connect()

virtual void iCub::learningmachine::merge::PortSource::connect ( std::string  dst)
inlinevirtual

Connects the incoming port to the specified port.

Parameters
dstthe destination port

Definition at line 148 of file merge.cpp.

◆ getData()

virtual Bottle & iCub::learningmachine::merge::PortSource::getData ( )
inlinevirtual

Returns the locally cached data.

Returns
a reference to the locally stored bottle

Definition at line 167 of file merge.cpp.

◆ getInputName()

std::string iCub::learningmachine::merge::PortSource::getInputName ( std::string  prefix)
inlineprotected

Returns the first free port given a prefix appended by an integer.

Parameters
prefixthe prefix for the port.
Returns
the string for the first available portname given the prefix

Definition at line 99 of file merge.cpp.

◆ initPort()

virtual void iCub::learningmachine::merge::PortSource::initPort ( std::string  prefix)
inlinevirtual

Opens the first free incoming port with the given prefix.

Parameters
prefixthe prefix for the name

Definition at line 140 of file merge.cpp.

◆ interrupt()

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

Interrupts the port.

Definition at line 174 of file merge.cpp.

◆ operator=()

PortSource & iCub::learningmachine::merge::PortSource::operator= ( const PortSource other)
protected

Assignment operator (private and unimplemented on purpose).

◆ update()

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

Reads new data from the port and caches it locally.

Definition at line 159 of file merge.cpp.

Member Data Documentation

◆ data

Bottle iCub::learningmachine::merge::PortSource::data
protected

Cached data.

Definition at line 86 of file merge.cpp.

◆ port

Port iCub::learningmachine::merge::PortSource::port
protected

The port for incoming data.

Definition at line 91 of file merge.cpp.


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