A base class for nested structures that can be searched. More...
#include <yarp/os/Searchable.h>
Public Member Functions | |
Searchable () | |
Default constructor. | |
Searchable (const Searchable &rhs)=default | |
Copy constructor. | |
Searchable (Searchable &&rhs) noexcept=default | |
Move constructor. | |
virtual | ~Searchable () |
Destructor. | |
Searchable & | operator= (const Searchable &rhs)=default |
Copy assignment operator. | |
Searchable & | operator= (Searchable &&rhs) noexcept=default |
Move assignment operator. | |
virtual bool | check (const std::string &key) const =0 |
Check if there exists a property of the given name. | |
virtual bool | check (const std::string &key, const std::string &comment) const |
Check if there exists a property of the given name. | |
virtual Value & | find (const std::string &key) const =0 |
Gets a value corresponding to a given keyword. | |
virtual Bottle & | findGroup (const std::string &key) const =0 |
Gets a list corresponding to a given keyword. | |
Bottle & | findGroup (const std::string &key, const std::string &comment) const |
Gets a list corresponding to a given keyword. | |
virtual bool | check (const std::string &key, Value *&result, const std::string &comment="") const |
Gets a value corresponding to a given keyword. | |
virtual Value | check (const std::string &key, const Value &fallback, const std::string &comment="") const |
Gets a value corresponding to a given keyword. | |
virtual bool | isNull () const |
Checks if the object is invalid. | |
virtual std::string | toString () const =0 |
Return a standard text representation of the content of the object. | |
A base class for nested structures that can be searched.
A Searchable object promises that you can look inside it with the find() and findGroup() methods to get values and lists corresponding to keywords.
Definition at line 55 of file Searchable.h.
|
explicit |
Default constructor.
Definition at line 29 of file Searchable.cpp.
|
default |
Copy constructor.
|
defaultnoexcept |
Move constructor.
|
virtualdefault |
Destructor.
Check if there exists a property of the given name.
key | the name to check for |
Implemented in yarp::os::Bottle, yarp::os::impl::Storable, yarp::os::Property, yarp::os::ResourceFinder, yarp::os::Value, yarp::os::Bottle, yarp::os::Property, yarp::os::ResourceFinder, and yarp::os::Value.
|
virtual |
Check if there exists a property of the given name.
key | the name to check for |
comment | Human-readable explanation |
Reimplemented in yarp::os::Bottle, yarp::os::Property, yarp::os::ResourceFinder, and yarp::os::Value.
Definition at line 81 of file Searchable.cpp.
|
virtual |
Gets a value corresponding to a given keyword.
key | The keyword to look for |
fallback | A default value to return if nothing found |
comment | Optional human-readable explanation |
Reimplemented in yarp::os::Bottle, yarp::os::Property, yarp::os::ResourceFinder, and yarp::os::Value.
Definition at line 55 of file Searchable.cpp.
|
virtual |
Gets a value corresponding to a given keyword.
If a property does not exist, this returns false and does not modify the result pointer. If a property exists but does not have a value, this again returns false and does not modify the result pointer.
key | The keyword to look for |
result | A pointer to store the address of the result in |
comment | Optional human-readable explanation |
Reimplemented in yarp::os::Bottle, yarp::os::Property, yarp::os::ResourceFinder, and yarp::os::Value.
Definition at line 36 of file Searchable.cpp.
Gets a value corresponding to a given keyword.
key | The keyword to look for |
Implemented in yarp::os::Bottle, yarp::os::impl::Storable, yarp::os::impl::StoreList, yarp::os::impl::StoreDict, yarp::os::Property, yarp::os::ResourceFinder, and yarp::os::Value.
Gets a list corresponding to a given keyword.
key | The keyword to look for |
Implemented in yarp::os::Bottle, yarp::os::impl::Storable, yarp::os::impl::StoreList, yarp::os::impl::StoreDict, yarp::os::Property, yarp::os::ResourceFinder, yarp::os::Value, yarp::os::Bottle, yarp::os::Property, yarp::os::ResourceFinder, and yarp::os::Value.
yarp::os::Bottle & yarp::os::Searchable::findGroup | ( | const std::string & | key, |
const std::string & | comment | ||
) | const |
Gets a list corresponding to a given keyword.
key | The keyword to look for |
comment | Human-readable explanation |
Definition at line 94 of file Searchable.cpp.
|
virtual |
Checks if the object is invalid.
Reimplemented in NullBottle, yarp::os::Bottle, yarp::os::impl::Storable, yarp::os::impl::StoreNull, yarp::os::ResourceFinder, and yarp::os::Value.
Definition at line 107 of file Searchable.cpp.
|
default |
Copy assignment operator.
|
defaultnoexcept |
Move assignment operator.
|
pure virtual |
Return a standard text representation of the content of the object.
The representation is readable by the Bottle and Property classes.
Implemented in yarp::os::Bottle, yarp::os::impl::StoreNull, yarp::os::impl::StoreInt8, yarp::os::impl::StoreInt16, yarp::os::impl::StoreInt32, yarp::os::impl::StoreInt64, yarp::os::impl::StoreFloat32, yarp::os::impl::StoreFloat64, yarp::os::impl::StoreVocab32, yarp::os::impl::StoreString, yarp::os::impl::StoreBlob, yarp::os::impl::StoreList, yarp::os::impl::StoreDict, yarp::os::Property, yarp::os::ResourceFinder, yarp::os::Value, and yarp::os::impl::Storable.