YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
WrapperMultiple.cpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5
7
9
10namespace {
11YARP_LOG_COMPONENT(WRAPPERSINGLE, "yarp.dev.WrapperMultiple")
12} // namespace
13
14
16
17
19{
20 if (!driver || !driver->isValid()) {
21 yCError(WRAPPERSINGLE, "Could not attach an invalid device");
22 return false;
23 }
24
26 drivers.push(driver, "...");
27
28 return attachAll(drivers);
29}
30
31
33{
34 return detachAll();
35}
virtual bool attachAll(const PolyDriverList &drivers)=0
Attach to a list of objects.
void push(PolyDriver *p, const char *k)
A container for a device driver.
Definition PolyDriver.h:23
bool isValid() const
Check if device is valid.
bool attach(PolyDriver *driver) final
Attach to another object.
bool detach() final
Detach the object (you must have first called attach).
~WrapperMultiple() override
Destructor.
#define yCError(component,...)
#define YARP_LOG_COMPONENT(name,...)