iCub-main
Loading...
Searching...
No Matches
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.
 
virtual ~IEventListener ()
 Destructor (empty).
 
virtual void handle (IEvent &e)
 Default handler for any Event, which means the Event is ignored.
 
virtual void handle (TrainEvent &e)
 Handling of a TrainEvent.
 
virtual void handle (PredictEvent &e)
 Handling of a PredictEvent.
 
virtual IEventListenerclone ()=0
 Asks the event listener to return a new object of its type.
 
std::string getName () const
 Retrieve the name of this IEventListener.
 
void setName (std::string name)
 Set the name of this IEventListener.
 
virtual void start ()
 Starts the IEventListener, such that it can do perform initialization (e.g.
 
virtual bool isEnabled ()
 Tells whether dispatching of events is enabled.
 
virtual void setEnabled (bool val)
 Enables or disables dispatching of events.
 
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.
 

Protected Attributes

std::string name
 The name of this type of EventListener.
 
bool enabled
 Boolean switch to disable or enable event the listener.
 

Detailed Description

Definition at line 43 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 64 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::PredictEventListener, and iCub::learningmachine::TrainEventListener.

◆ 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 144 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 96 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 70 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 82 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 76 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 120 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 129 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 105 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 113 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 53 of file IEventListener.h.

◆ name

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

The name of this type of EventListener.

Definition at line 48 of file IEventListener.h.


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