YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
Searchable.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-FileCopyrightText: 2006-2010 RobotCub Consortium
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#ifndef YARP_OS_SEARCHABLE_H
8#define YARP_OS_SEARCHABLE_H
9
10#include <yarp/os/api.h>
11
12#include <cstddef>
13#include <string>
14
15namespace yarp::os {
16class Value;
17class Bottle;
18} // namespace yarp::os
19
20namespace yarp::os {
21
31{
32public:
36 explicit Searchable();
37
41 Searchable(const Searchable& rhs) = default;
42
46 Searchable(Searchable&& rhs) noexcept = default;
47
51 virtual ~Searchable();
52
56 Searchable& operator=(const Searchable& rhs) = default;
57
61 Searchable& operator=(Searchable&& rhs) noexcept = default;
62
69 virtual bool check(const std::string& key) const = 0;
70
71
79 virtual bool check(const std::string& key,
80 const std::string& comment) const;
81
90 virtual Value& find(const std::string& key) const = 0;
91
102 virtual Bottle& findGroup(const std::string& key) const = 0;
103
115 Bottle& findGroup(const std::string& key, const std::string& comment) const;
116
142 virtual bool check(const std::string& key,
143 Value*& result,
144 const std::string& comment = "") const;
145
146
156 virtual Value check(const std::string& key,
157 const Value& fallback,
158 const std::string& comment = "") const;
159
164 virtual bool isNull() const;
165
173 virtual std::string toString() const = 0;
174};
175
176} // namespace yarp::os
177
178#endif // YARP_OS_SEARCHABLE_H
A simple collection of objects that can be described and transmitted in a portable way.
Definition Bottle.h:64
A mini-server for performing network communication in the background.
A base class for nested structures that can be searched.
Definition Searchable.h:31
Searchable(const Searchable &rhs)=default
Copy constructor.
Searchable(Searchable &&rhs) noexcept=default
Move constructor.
Searchable & operator=(Searchable &&rhs) noexcept=default
Move assignment operator.
virtual ~Searchable()
Destructor.
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.
Searchable & operator=(const Searchable &rhs)=default
Copy assignment operator.
virtual Bottle & findGroup(const std::string &key) const =0
Gets a list corresponding to a given keyword.
A single value (typically within a Bottle).
Definition Value.h:43
An interface to the operating system, including Port based communication.
#define YARP_os_API
Definition api.h:18