YARP
Yet Another Robot Platform
DevicePipe.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3  * SPDX-FileCopyrightText: 2006-2010 RobotCub Consortium
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #ifndef YARP_DEV_DEVICEPIPE_H
8 #define YARP_DEV_DEVICEPIPE_H
9 
10 #include <yarp/dev/PolyDriver.h>
12 
13 
19 class DevicePipe :
21  public yarp::dev::IService
22 {
23 public:
24  DevicePipe() = default;
25  DevicePipe(const DevicePipe&) = delete;
26  DevicePipe(DevicePipe&&) = delete;
27  DevicePipe& operator=(const DevicePipe&) = delete;
29  ~DevicePipe() override = default;
30 
31  bool open(yarp::os::Searchable& config) override;
32 
33  bool close() override;
34 
35  bool startService() override
36  {
37  // please call updateService
38  return false;
39  }
40 
41  bool stopService() override
42  {
43  return close();
44  }
45 
46  bool updateService() override;
47 
48 protected:
51 
52  static bool open(const char* key,
54  yarp::os::Searchable& config,
55  const char* comment);
56 };
57 
58 
59 #endif // YARP_DEV_DEVICEPIPE_H
pipe: Tries to connect the output of one device to the input of another.
Definition: DevicePipe.h:22
bool startService() override
Initiate the service, whatever it is.
Definition: DevicePipe.h:35
yarp::dev::PolyDriver sink
Definition: DevicePipe.h:50
DevicePipe & operator=(DevicePipe &&)=delete
bool open(yarp::os::Searchable &config) override
Open the DeviceDriver.
Definition: DevicePipe.cpp:26
bool updateService() override
Give the service the chance to run for a while.
Definition: DevicePipe.cpp:90
DevicePipe()=default
~DevicePipe() override=default
bool stopService() override
Shut down the service, whatever it is.
Definition: DevicePipe.h:41
DevicePipe & operator=(const DevicePipe &)=delete
DevicePipe(const DevicePipe &)=delete
DevicePipe(DevicePipe &&)=delete
bool close() override
Close the DeviceDriver.
Definition: DevicePipe.cpp:81
yarp::dev::PolyDriver source
Definition: DevicePipe.h:49
Interface implemented by all device drivers.
Definition: DeviceDriver.h:35
Common interface for devices that act like services (by which we mean they do something for remote us...
A container for a device driver.
Definition: PolyDriver.h:24
A base class for nested structures that can be searched.
Definition: Searchable.h:66