YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
FakeDeviceWrapper.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2024-2024 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5
6#ifndef YARP_FAKEDEVICEWRAPPER_H
7#define YARP_FAKEDEVICEWRAPPER_H
8
10#include <yarp/dev/PolyDriver.h>
12
13#include <yarp/os/Port.h>
14
26{
27private:
29 yarp::os::Port m_RpcPort;
30
31public:
32 FakeDeviceWrapper() = default;
37
38 ~FakeDeviceWrapper() override = default;
39
40 // yarp::dev::DeviceDriver
41 bool open(yarp::os::Searchable& config) override;
42 bool close() override;
43
44 // yarp::dev::WrapperSingle
45 bool detach() override;
46 bool attach(yarp::dev::PolyDriver* drv) override;
47
48 //interfaces
49 yarp::dev::ReturnValue testSetValue(int value) override;
50 yarp::dev::ReturnValue testGetValue(int& value) override;
51
52 // From PortReader
53 bool read(yarp::os::ConnectionReader& connection) override;
54};
55
56#endif
FakeDeviceWrapper: A simple device for testing purposes.
bool detach() override
Detach the object (you must have first called attach).
FakeDeviceWrapper(FakeDeviceWrapper &&)=delete
FakeDeviceWrapper & operator=(const FakeDeviceWrapper &)=delete
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
bool close() override
Close the DeviceDriver.
FakeDeviceWrapper(const FakeDeviceWrapper &)=delete
yarp::dev::ReturnValue testGetValue(int &value) override
This method is used to get a single value from a test device.
~FakeDeviceWrapper() override=default
yarp::dev::ReturnValue testSetValue(int value) override
This method is used to set a single value inside the test device.
bool open(yarp::os::Searchable &config) override
Open the DeviceDriver.
bool attach(yarp::dev::PolyDriver *drv) override
Attach to another object.
FakeDeviceWrapper & operator=(FakeDeviceWrapper &&)=delete
FakeDeviceWrapper()=default
Interface implemented by all device drivers.
A container for a device driver.
Definition PolyDriver.h:23
Helper interface for an object that can wrap/or "attach" to a single other device.
A test interface used internally by continuous integration.
An interface for reading from a network connection.
Interface implemented by all objects that can read themselves from the network, such as Bottle object...
Definition PortReader.h:24
A mini-server for network communication.
Definition Port.h:46
A base class for nested structures that can be searched.
Definition Searchable.h:31