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

#include <IEventListener.h>

+ Inheritance diagram for iCub::learningmachine::IEventListener:

Public Member Functions

 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 void start ()
 Starts the IEventListener, such that it can do perform initialization (e.g. More...
 
virtual bool isEnabled ()
 Tells whether dispatching of events is enabled. More...
 
virtual void setEnabled (bool val)
 Enables or disables dispatching of events. 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...
 

Protected Attributes

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

Definition at line 45 of file IEventListener.h.

Constructor & Destructor Documentation

◆ IEventListener()

iCub::learningmachine::IEventListener::IEventListener ( )

Constructor.

Definition at line 27 of file IEventListener.cpp.

◆ ~IEventListener()

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

Destructor (empty).

Definition at line 66 of file IEventListener.h.

Member Function Documentation

◆ clone()

virtual IEventListener* iCub::learningmachine::IEventListener::clone ( )
pure virtual

Asks the event listener to return a new object of its type.

Returns
a fresh instance of the current class

Implemented in iCub::learningmachine::TrainEventListener, and iCub::learningmachine::PredictEventListener.

◆ configure()

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

Reimplemented in iCub::learningmachine::IPortEventListener.

Definition at line 32 of file IEventListener.cpp.

◆ getInfo()

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

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

Returns
the information on the IEventListener

Reimplemented in iCub::learningmachine::IPortEventListener.

Definition at line 146 of file IEventListener.h.

◆ getName()

std::string iCub::learningmachine::IEventListener::getName ( ) const
inline

Retrieve the name of this IEventListener.

Returns
the name of this IEventListener

Definition at line 98 of file IEventListener.h.

◆ handle() [1/3]

virtual void iCub::learningmachine::IEventListener::handle ( IEvent e)
inlinevirtual

Default handler for any Event, which means the Event is ignored.

Parameters
ethe base event

Definition at line 72 of file IEventListener.h.

◆ handle() [2/3]

virtual void iCub::learningmachine::IEventListener::handle ( PredictEvent e)
inlinevirtual

Handling of a PredictEvent.

Parameters
ethe PredictEvent

Reimplemented in iCub::learningmachine::PredictEventListener.

Definition at line 84 of file IEventListener.h.

◆ handle() [3/3]

virtual void iCub::learningmachine::IEventListener::handle ( TrainEvent e)
inlinevirtual

Handling of a TrainEvent.

Parameters
ethe TrainEvent

Reimplemented in iCub::learningmachine::TrainEventListener.

Definition at line 78 of file IEventListener.h.

◆ isEnabled()

virtual bool iCub::learningmachine::IEventListener::isEnabled ( )
inlinevirtual

Tells whether dispatching of events is enabled.

Returns
true if dispatching is enabled

Definition at line 122 of file IEventListener.h.

◆ setEnabled()

virtual void iCub::learningmachine::IEventListener::setEnabled ( bool  val)
inlinevirtual

Enables or disables dispatching of events.

Parameters
valthe desired state

Definition at line 131 of file IEventListener.h.

◆ setName()

void iCub::learningmachine::IEventListener::setName ( std::string  name)
inline

Set the name of this IEventListener.

Parameters
namethe new name

Definition at line 107 of file IEventListener.h.

◆ start()

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

Starts the IEventListener, such that it can do perform initialization (e.g.

opening ports).

Reimplemented in iCub::learningmachine::IPortEventListener.

Definition at line 115 of file IEventListener.h.

Member Data Documentation

◆ enabled

bool iCub::learningmachine::IEventListener::enabled
protected

Boolean switch to disable or enable event the listener.

Definition at line 55 of file IEventListener.h.

◆ name

std::string iCub::learningmachine::IEventListener::name
protected

The name of this type of EventListener.

Definition at line 50 of file IEventListener.h.


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