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