iCub-main
IEventListener.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2007-2010 RobotCub Consortium, European Commission FP6 Project IST-004370
3  * author: Arjan Gijsberts
4  * email: arjan.gijsberts@iit.it
5  * website: www.robotcub.org
6  * Permission is granted to copy, distribute, and/or modify this program
7  * under the terms of the GNU General Public License, version 2 or any
8  * later version published by the Free Software Foundation.
9  *
10  * A copy of the license can be found at
11  * http://www.robotcub.org/icub/license/gpl.txt
12  *
13  * This program is distributed in the hope that it will be useful, but
14  * WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
16  * Public License for more details
17  */
18 
19 #include <yarp/os/Bottle.h>
20 
23 
24 namespace iCub {
25 namespace learningmachine {
26 
28  this->setName("");
29  this->setEnabled(true);
30 }
31 
32 bool IEventListener::configure(yarp::os::Searchable& config) {
33  bool success = false;
34 
35  // enable
36  if(!config.findGroup("enable").isNull()) {
37  this->setEnabled(true);
38  success = true;
39  }
40 
41  // disable
42  if(!config.findGroup("disable").isNull()) {
43  this->setEnabled(false);
44  success = true;
45  }
46 
47  return success;
48 }
49 
50 } // learningmachine
51 } // iCub
52 
virtual bool configure(yarp::os::Searchable &config)
void setName(std::string name)
Set the name of this IEventListener.
virtual void setEnabled(bool val)
Enables or disables dispatching of events.
This file contains the definition of unique IDs for the body parts and the skin parts of the robot.