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_VOCAB64 (2 + 16)
25#define BOTTLE_TAG_FLOAT32 (2 + 8)
26#define BOTTLE_TAG_FLOAT64 (4 + 16)
27#define BOTTLE_TAG_STRING (4)
28#define BOTTLE_TAG_BLOB (4 + 8)
29#define BOTTLE_TAG_LIST 256
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);
226 void addString(
const char* str);
233 void addString(
const std::string& str);
240 void add(
const Value& value);
251 void add(
Value* value);
283 Value& get(size_type index)
const;
290 size_type size()
const;
302 void fromString(
const std::string& text);
310 void fromBinary(
const char* buf,
size_t len);
322 const char* toBinary(
size_t* size =
nullptr);
332 std::string
toString()
const override;
360 bool write(
PortReader& reader,
bool textMode =
false);
371 bool read(
const PortWriter& writer,
bool textMode =
false);
373 void onCommencement()
const override;
375 bool check(
const std::string& key)
const override;
377 Value& find(
const std::string& key)
const override;
379 Bottle& findGroup(
const std::string& key)
const override;
381 bool isNull()
const override;
390 void copy(
const Bottle&
alt, size_type first = 0, size_type len = npos);
397 static Bottle& getNullBottle();
413 bool operator!=(
const Bottle&
alt)
const;
447 int getSpecialization();
456 static std::string describeBottleCode(
int code);
465#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 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.