YARP
Yet Another Robot Platform
DeviceGroup.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_DEVICEGROUP_H
11 #define YARP_DEV_DEVICEGROUP_H
12 
13 #include <yarp/dev/PolyDriver.h>
15 
21 class DeviceGroup :
23  public yarp::dev::IService
24 {
25 public:
26  DeviceGroup() = default;
27  DeviceGroup(const DeviceGroup&) = delete;
28  DeviceGroup(DeviceGroup&&) = delete;
29  DeviceGroup& operator=(const DeviceGroup&) = delete;
31  ~DeviceGroup() override;
32 
33  bool open(yarp::os::Searchable& config) override;
34 
35  bool close() override
36  {
37  return closeMain();
38  }
39 
40  bool startService() override;
41 
42  bool stopService() override
43  {
44  return close();
45  }
46 
47  bool updateService() override;
48 
49 private:
50  void* implementation{nullptr};
51 
52  bool closeMain();
53 
54  yarp::dev::PolyDriver source;
56 
57  bool open(const char *key,
59  yarp::os::Searchable& config,
60  const char *comment);
61 };
62 
63 
64 #endif // YARP_DEV_DEVICEGROUP_H
DeviceGroup::DeviceGroup
DeviceGroup(const DeviceGroup &)=delete
ServiceInterfaces.h
yarp::os::Searchable
A base class for nested structures that can be searched.
Definition: Searchable.h:69
DeviceGroup::operator=
DeviceGroup & operator=(const DeviceGroup &)=delete
DeviceGroup::updateService
bool updateService() override
Give the service the chance to run for a while.
Definition: DeviceGroup.cpp:200
yarp::dev::DeviceDriver
Interface implemented by all device drivers.
Definition: DeviceDriver.h:38
DeviceGroup::open
bool open(yarp::os::Searchable &config) override
Open the DeviceDriver.
Definition: DeviceGroup.cpp:124
DeviceGroup::DeviceGroup
DeviceGroup(DeviceGroup &&)=delete
DeviceGroup::startService
bool startService() override
Initiate the service, whatever it is.
Definition: DeviceGroup.cpp:194
DeviceGroup::~DeviceGroup
~DeviceGroup() override
Definition: DeviceGroup.cpp:207
DeviceGroup::operator=
DeviceGroup & operator=(DeviceGroup &&)=delete
PolyDriver.h
yarp::dev::PolyDriver
A container for a device driver.
Definition: PolyDriver.h:27
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
DeviceGroup::DeviceGroup
DeviceGroup()=default
DeviceGroup
group: Lets you make a bunch of devices as a group.
Definition: DeviceGroup.h:24
DeviceGroup::stopService
bool stopService() override
Shut down the service, whatever it is.
Definition: DeviceGroup.h:42
DeviceGroup::close
bool close() override
Close the DeviceDriver.
Definition: DeviceGroup.h:35