19#ifndef LM_IMACHINELEARNERMODULE__
20#define LM_IMACHINELEARNERMODULE__
22#include <yarp/os/RFModule.h>
23#include <yarp/os/ResourceFinder.h>
24#include <yarp/os/Bottle.h>
25#include <yarp/os/BufferedPort.h>
26#include <yarp/os/Time.h>
32namespace learningmachine {
79 yarp::os::ResourceFinder*
rf;
98 void registerPort(yarp::os::Contactable& port, std::string name);
121 virtual void loadCommandFile(std::string fname, yarp::os::Bottle*
out = (yarp::os::Bottle*) 0);
130 if(this->rf == (yarp::os::ResourceFinder*) 0) {
131 throw std::runtime_error(
"Attempt to retrieve inexistent resource finder.");
145 std::string
findFile(std::string fname);
175 virtual bool close();
181 yarp::os::Time::delay(1.);
The DispatcherManager provides a YARP-based configuration interface for the EventDispatcher.
An abstract base module for the machine learning YARP interface.
virtual bool updateModule()
Default empty update loop with 1 second delay.
IMachineLearnerModule(std::string pp)
Constructor.
DispatcherManager dmanager
An instance of the DispatchManager to configure event listeners.
IMachineLearnerModule & operator=(const IMachineLearnerModule &other)
Assignment operator (private and unimplemented on purpose).
virtual yarp::os::ResourceFinder & getResourceFinder()
Returns a reference to the cached ResourceFinder.
virtual void registerAllPorts()=0
Registers all ports used by this module.
std::string portPrefix
A prefix path for the ports that will be registered.
virtual void setResourceFinder(yarp::os::ResourceFinder *rf)
Mutator for the locally stored ResourceFinder.
virtual bool close()
Close the module.
virtual void unregisterAllPorts()=0
Unregisters all ports used by this module.
IMachineLearnerModule(const IMachineLearnerModule &other)
Copy Constructor (private and unimplemented on purpose).
std::string findFile(std::string fname)
Finds the full path to a specified filename using the ResourceFinder.
void registerPort(yarp::os::Contactable &port, std::string name)
Register a port with a given name.
virtual ~IMachineLearnerModule()
Destructor (empty).
yarp::os::ResourceFinder * rf
A pointer to the ResourceFinder.
yarp::os::Port cmd_in
An input port for commands.
virtual void printOptions(std::string error="")=0
Prints the accepted command line options with an optional error message.
virtual void loadCommandFile(std::string fname, yarp::os::Bottle *out=(yarp::os::Bottle *) 0)
Reads bottles from a file and sends these one by one to the respond method.
This file contains the definition of unique IDs for the body parts and the skin parts of the robot.
Copyright (C) 2008 RobotCub Consortium.