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

The abstract base class for EventListeners that output to a port. More...

#include <IPortEventListener.h>

+ Inheritance diagram for iCub::learningmachine::IPortEventListener:

Public Member Functions

 IPortEventListener (std::string pp)
 Constructor. More...
 
 IPortEventListener (const IPortEventListener &other)
 Copy Constructor. More...
 
virtual ~IPortEventListener ()
 Destructor. More...
 
virtual IPortEventListeneroperator= (const IPortEventListener &other)
 Assignment operator. More...
 
virtual void start ()
 Starts the IEventListener. More...
 
virtual bool configure (yarp::os::Searchable &config)
 
virtual std::string getInfo ()
 Asks the event listener to return a string containing information on its configuration so far. More...
 
- Public Member Functions inherited from iCub::learningmachine::IEventListener
 IEventListener ()
 Constructor. More...
 
virtual ~IEventListener ()
 Destructor (empty). More...
 
virtual void handle (IEvent &e)
 Default handler for any Event, which means the Event is ignored. More...
 
virtual void handle (TrainEvent &e)
 Handling of a TrainEvent. More...
 
virtual void handle (PredictEvent &e)
 Handling of a PredictEvent. More...
 
virtual IEventListenerclone ()=0
 Asks the event listener to return a new object of its type. More...
 
std::string getName () const
 Retrieve the name of this IEventListener. More...
 
void setName (std::string name)
 Set the name of this IEventListener. More...
 
virtual bool isEnabled ()
 Tells whether dispatching of events is enabled. More...
 
virtual void setEnabled (bool val)
 Enables or disables dispatching of events. More...
 

Protected Member Functions

void resetPort (std::string portName)
 Resets the port and opens it at the specified name. More...
 

Protected Attributes

yarp::os::Port port
 The outgoing port for the events. More...
 
bool verbose
 Verbosity controls whether events are printed to standard output. More...
 
std::string portPrefix
 A prefix path for the ports that will be registered. More...
 
- Protected Attributes inherited from iCub::learningmachine::IEventListener
std::string name
 The name of this type of EventListener. More...
 
bool enabled
 Boolean switch to disable or enable event the listener. More...
 

Detailed Description

The abstract base class for EventListeners that output to a port.

This class is introduced so that base functionality to register ports can be inherited by multiple subclasses.

See also
iCub::learningmachine::PredictEventListener
iCub::learningmachine::TrainEventListener
Author
Arjan Gijsberts

Definition at line 43 of file IPortEventListener.h.

Constructor & Destructor Documentation

◆ IPortEventListener() [1/2]

iCub::learningmachine::IPortEventListener::IPortEventListener ( std::string  pp)
inline

Constructor.

Parameters
ppthe standard prefix for opening the ports

Definition at line 75 of file IPortEventListener.h.

◆ IPortEventListener() [2/2]

iCub::learningmachine::IPortEventListener::IPortEventListener ( const IPortEventListener other)
inline

Copy Constructor.

Definition at line 80 of file IPortEventListener.h.

◆ ~IPortEventListener()

virtual iCub::learningmachine::IPortEventListener::~IPortEventListener ( )
inlinevirtual

Destructor.

Definition at line 86 of file IPortEventListener.h.

Member Function Documentation

◆ configure()

bool iCub::learningmachine::IPortEventListener::configure ( yarp::os::Searchable &  config)
virtual

Reimplemented from iCub::learningmachine::IEventListener.

Definition at line 62 of file IPortEventListener.cpp.

◆ getInfo()

virtual std::string iCub::learningmachine::IPortEventListener::getInfo ( )
inlinevirtual

Asks the event listener to return a string containing information on its configuration so far.

Returns
the information on the IEventListener

Reimplemented from iCub::learningmachine::IEventListener.

Definition at line 114 of file IPortEventListener.h.

◆ operator=()

IPortEventListener & iCub::learningmachine::IPortEventListener::operator= ( const IPortEventListener other)
virtual

Assignment operator.

Definition at line 29 of file IPortEventListener.cpp.

◆ resetPort()

void iCub::learningmachine::IPortEventListener::resetPort ( std::string  portName)
protected

Resets the port and opens it at the specified name.

If passed an empty string the port is opened at the first free port with the predefined prefix.

Parameters
portNamethe name of the port

Definition at line 37 of file IPortEventListener.cpp.

◆ start()

virtual void iCub::learningmachine::IPortEventListener::start ( )
inlinevirtual

Starts the IEventListener.

Reimplemented from iCub::learningmachine::IEventListener.

Definition at line 99 of file IPortEventListener.h.

Member Data Documentation

◆ port

yarp::os::Port iCub::learningmachine::IPortEventListener::port
protected

The outgoing port for the events.

Definition at line 48 of file IPortEventListener.h.

◆ portPrefix

std::string iCub::learningmachine::IPortEventListener::portPrefix
protected

A prefix path for the ports that will be registered.

Definition at line 58 of file IPortEventListener.h.

◆ verbose

bool iCub::learningmachine::IPortEventListener::verbose
protected

Verbosity controls whether events are printed to standard output.

Definition at line 53 of file IPortEventListener.h.


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