8#ifndef YARP_OS_BOTTLE_H
9#define YARP_OS_BOTTLE_H
19#define BOTTLE_TAG_INT8 32
20#define BOTTLE_TAG_INT16 64
21#define BOTTLE_TAG_INT32 1
22#define BOTTLE_TAG_INT64 (1 + 16)
23#define BOTTLE_TAG_VOCAB32 (1 + 8)
24#define BOTTLE_TAG_FLOAT32 128
25#define BOTTLE_TAG_FLOAT64 (2 + 8)
26#define BOTTLE_TAG_STRING (4)
27#define BOTTLE_TAG_BLOB (4 + 8)
28#define BOTTLE_TAG_LIST 256
29#define BOTTLE_TAG_DICT 512
35#ifndef DOXYGEN_SHOULD_SKIP_THIS
66#if defined(SWIG) && (SWIG_VERSION < 0x300011)
74 using Searchable::check;
75 using Searchable::findGroup;
92 explicit Bottle(
const std::string& text);
112 Bottle(std::initializer_list<yarp::os::Value> values);
145 void addInt8(std::int8_t x);
152 void addInt16(std::int16_t x);
159 void addInt32(std::int32_t x);
166 void addInt64(std::int64_t x);
219 void addString(
const char* str);
226 void addString(
const std::string& str);
233 void add(
const Value& value);
244 void add(
Value* value);
284 Value& get(size_type index)
const;
291 size_type size()
const;
303 void fromString(
const std::string& text);
311 void fromBinary(
const char* buf,
size_t len);
323 const char* toBinary(
size_t* size =
nullptr);
333 std::string
toString()
const override;
361 bool write(
PortReader& reader,
bool textMode =
false);
372 bool read(
const PortWriter& writer,
bool textMode =
false);
374 void onCommencement()
const override;
376 bool check(
const std::string& key)
const override;
378 Value& find(
const std::string& key)
const override;
380 Bottle& findGroup(
const std::string& key)
const override;
382 bool isNull()
const override;
391 void copy(
const Bottle&
alt, size_type first = 0, size_type len = npos);
398 static Bottle& getNullBottle();
414 bool operator!=(
const Bottle&
alt)
const;
448 int getSpecialization();
457 static std::string describeBottleCode(
int code);
466#ifndef DOXYGEN_SHOULD_SKIP_THIS
bool operator==(const struct v4l2_control &left, const struct v4l2_control &right)
std::string toString(const T &value)
convert an arbitrary type to string.
RandScalar * implementation(void *t)
A simple collection of objects that can be described and transmitted in a portable way.
void addVocab32(const std::string &str)
Places a vocabulary item in the bottle, at the end of the list.
void addVocab32(char a, char b=0, char c=0, char d=0)
Places a vocabulary item in the bottle, at the end of the list.
static const size_type npos
Bottle(std::initializer_list< yarp::os::Value > values)
Initializer list constructor.
A mini-server for performing network communication in the background.
An interface for reading from a network connection.
An interface for writing to a network connection.
Utilities for manipulating the YARP network, excluding initialization and shutdown.
Interface implemented by all objects that can read themselves from the network, such as Bottle object...
Interface implemented by all objects that can write themselves to the network, such as Bottle objects...
This is a base class for objects that can be both read from and be written to the YARP network.
A class for storing options and configuration information.
A base class for nested structures that can be searched.
A single value (typically within a Bottle).
A flexible data format for holding a bunch of numbers and strings.
A single item in a Bottle.
NetInt32 encode(const std::string &str)
Convert a string into a vocabulary identifier.
An interface to the operating system, including Port based communication.
constexpr yarp::conf::vocab32_t createVocab32(char a, char b=0, char c=0, char d=0)
Create a vocab from chars.