YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
Module.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-License-Identifier: LGPL-2.1-or-later
4 */
5
6#ifndef YARP_YARPROBOTINTERFACE_MODULE_H
7#define YARP_YARPROBOTINTERFACE_MODULE_H
8
9#include <yarp/os/RFModule.h>
11
13{
14
17{
18public:
19 explicit Module();
20 virtual ~Module();
21
22 // yarp::os::RFModule
23 double getPeriod() override;
24 bool updateModule() override;
25 bool close() override;
26 bool interruptModule() override;
27 bool configure(yarp::os::ResourceFinder &rf) override;
28
30 bool attach(yarp::os::RpcServer &source) override;
31
32 // yarprobotinterfaceRpc
33 std::string get_phase() override;
34 int32_t get_level() override;
35 bool is_ready() override;
36 std::string get_robot() override;
37
38 std::string quit() override;
39 inline std::string bye() override { return quit(); }
40 inline std::string exit() override { return quit(); }
41
42private:
43 class Private;
44 Private * const mPriv;
45}; // class Module
46
47} // namespace yarprobotinterface
48
49#endif // YARP_YARPROBOTINTERFACE_MODULE_H
A base-class for standard YARP modules that supports ResourceFinder.
Definition RFModule.h:20
virtual bool attach(yarp::os::Port &source)
Make any input from a Port object go to the respond() method.
Definition RFModule.cpp:456
Helper class for finding config files and other external resources.
A port that is specialized as an RPC server.
Definition RpcServer.h:23
std::string get_robot() override
Returns robot name.
Definition Module.cpp:297
std::string exit() override
Closes yarprobotinterface.
Definition Module.h:40
bool updateModule() override
Override this to do whatever your module needs to do.
Definition Module.cpp:191
std::string get_phase() override
Returns current phase.
Definition Module.cpp:282
double getPeriod() override
You can override this to control the approximate periodicity at which updateModule() is called by run...
Definition Module.cpp:186
std::string bye() override
Closes yarprobotinterface.
Definition Module.h:39
bool close() override
Close function.
Definition Module.cpp:242
bool attach(yarp::os::RpcServer &source) override
Make any input from an RpcServer object go to the respond() method.
Definition Module.cpp:276
bool configure(yarp::os::ResourceFinder &rf) override
Configure the module, pass a ResourceFinder object to the module.
Definition Module.cpp:110
int32_t get_level() override
Returns current level.
Definition Module.cpp:287
bool is_ready() override
Returns true if yarprobotinterface is ready (all startup actions performed and no interrupt called).
Definition Module.cpp:292
std::string quit() override
Closes yarprobotinterface.
Definition Module.cpp:302
bool interruptModule() override
Try to halt any ongoing operations by threads managed by the module.
Definition Module.cpp:204