107 int ct =
m_Priv->removeRef();
112 if (m_dd !=
nullptr) {
113 result = m_dd->
close();
128 return m_dd !=
nullptr;
133 if (!
alt.isValid()) {
141 int ct =
m_Priv->removeRef();
159 std::string device_name = prop.
toString();
161 if (prop.
check(
"device",part)) {
180 p.unput(
"wrapping_enabled");
188 p.put(
"attached_device", device_name);
189 p.put(
"wrapper_device", wrapper_name);
190 p.put(
"device",
"deviceBundler");
218 if (manager!=
nullptr)
228 bool ok = driver->
open(*config);
232 yCIError(
POLYDRIVER,
id(),
"Driver <%s> was found but could not open", config->
find(
"device").toString().c_str());
245 if(config->
check(
"allow-deprecated-devices")) {
246 yCIWarning(
POLYDRIVER,
id(), R
"(Device "%s" is deprecated. Opening since the "allow-deprecated-devices" option was passed in the configuration.)", device_name.c_str());
249 yCIError(
POLYDRIVER,
id(), R
"(Device "%s" is deprecated. Pass the "allow-deprecated-devices" option in the configuration if you want to open it anyway.)", device_name.c_str());
259 yCIInfo(
POLYDRIVER,
id(),
"Created %s <%s>. See C++ class %s for documentation.",
260 ((name==
wrapper)?
"wrapper":
"device"),
std::string toString(const T &value)
convert an arbitrary type to string.
Interface implemented by deprecated device drivers.
Interface implemented by all device drivers.
virtual void setId(const std::string &id)
Set the id for this device.
virtual DeviceDriver * getImplementation()
Some drivers are bureaucrats, pointing at others.
virtual bool close()
Close the DeviceDriver.
virtual bool open(yarp::os::Searchable &config)
Open the DeviceDriver.
bool view(T *&x)
Get an interface to the device driver.
A base class for factories that create driver objects.
static Drivers & factory()
Get the global factory for devices.
A container for a device driver.
DeviceDriver * take()
Gets the device this object manages.
bool close() override
Close the DeviceDriver.
bool give(DeviceDriver *dd, bool own)
Take on management of a device.
bool link(PolyDriver &alt)
Make this device be a link to an existing one.
virtual ~PolyDriver()
Destructor.
bool isValid() const
Check if device is valid.
DeviceDriver * getImplementation() override
Some drivers are bureaucrats, pointing at others.
bool open(const std::string &txt)
Construct and configure a device by its common name.
A mini-server for performing network communication in the background.
std::string getName() const override
Get name of port.
A class for storing options and configuration information.
A base class for nested structures that can be searched.
virtual bool check(const std::string &key) const =0
Check if there exists a property of the given name.
virtual std::string toString() const =0
Return a standard text representation of the content of the object.
virtual Value & find(const std::string &key) const =0
Gets a value corresponding to a given keyword.
A single value (typically within a Bottle).
std::string toString() const override
Return a standard text representation of the content of the object.
#define yCAssert(component, x)
#define yCIError(component, id,...)
#define YARP_LOG_COMPONENT(name,...)
#define yCIInfo(component, id,...)
#define yCIDebug(component, id,...)
#define yCIWarning(component, id,...)
For streams capable of holding different kinds of content, check what they actually have.
An interface to the operating system, including Port based communication.