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
30#define BOTTLE_TAG_DICT 512
36#ifndef DOXYGEN_SHOULD_SKIP_THIS
67#if defined(SWIG) && (SWIG_VERSION < 0x300011)
75 using Searchable::check;
76 using Searchable::findGroup;
93 explicit Bottle(
const std::string& text);
146 void addInt8(std::int8_t x);
153 void addInt16(std::int16_t x);
160 void addInt32(std::int32_t x);
167 void addInt64(std::int64_t x);
227 void addString(
const char* str);
234 void addString(
const std::string& str);
241 void add(
const Value& value);
252 void add(
Value* value);
292 Value& get(size_type index)
const;
299 size_type size()
const;
311 void fromString(
const std::string& text);
319 void fromBinary(
const char* buf,
size_t len);
331 const char* toBinary(
size_t* size =
nullptr);
341 std::string
toString()
const override;
369 bool write(
PortReader& reader,
bool textMode =
false);
380 bool read(
const PortWriter& writer,
bool textMode =
false);
382 void onCommencement()
const override;
384 bool check(
const std::string& key)
const override;
386 Value& find(
const std::string& key)
const override;
388 Bottle& findGroup(
const std::string& key)
const override;
390 bool isNull()
const override;
399 void copy(
const Bottle&
alt, size_type first = 0, size_type len = npos);
406 static Bottle& getNullBottle();
422 bool operator!=(
const Bottle&
alt)
const;
456 int getSpecialization();
465 static std::string describeBottleCode(
int code);
474#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.