11 #ifndef YARP_OS_BOTTLE_H
12 #define YARP_OS_BOTTLE_H
21 #define BOTTLE_TAG_INT8 32
22 #define BOTTLE_TAG_INT16 64
23 #define BOTTLE_TAG_INT32 1
24 #define BOTTLE_TAG_INT64 (1 + 16)
25 #define BOTTLE_TAG_VOCAB (1 + 8)
26 #define BOTTLE_TAG_FLOAT32 128
27 #define BOTTLE_TAG_FLOAT64 (2 + 8)
28 #define BOTTLE_TAG_STRING (4)
29 #define BOTTLE_TAG_BLOB (4 + 8)
30 #define BOTTLE_TAG_LIST 256
31 #define BOTTLE_TAG_DICT 512
44 #ifndef DOXYGEN_SHOULD_SKIP_THIS
75 #if defined(SWIG) && (SWIG_VERSION < 0x300011)
83 using Searchable::check;
101 explicit Bottle(
const std::string& text);
121 Bottle(std::initializer_list<yarp::os::Value> values);
156 inline
void addInt(
int x)
158 addInt32(
static_cast<std::int32_t
>(x));
166 void addInt8(std::int8_t x);
173 void addInt16(std::int16_t x);
180 void addInt32(std::int32_t x);
187 void addInt64(std::int64_t x);
194 void addVocab(
int x);
204 inline
void addDouble(
double x)
230 void addString(
const char* str);
237 void addString(
const std::string& str);
244 void add(
const Value& value);
255 void add(
Value* value);
295 Value& get(size_type index)
const;
302 size_type size()
const;
314 void fromString(
const std::string& text);
322 void fromBinary(
const char* buf,
size_t len);
334 const char* toBinary(
size_t* size =
nullptr);
344 std::string
toString()
const override;
385 void onCommencement()
const override;
387 bool check(
const std::string& key)
const override;
389 Value& find(
const std::string& key)
const override;
393 bool isNull()
const override;
402 void copy(
const Bottle& alt, size_type first = 0, size_type len = npos);
409 static Bottle& getNullBottle();
417 bool operator==(
const Bottle& alt)
const;
425 bool operator!=(
const Bottle& alt)
const;
433 void append(
const Bottle& alt);
459 int getSpecialization();
468 static std::string describeBottleCode(
int code);
472 void setReadOnly(
bool readOnly);
477 #ifndef DOXYGEN_SHOULD_SKIP_THIS
#define BOTTLE_TAG_FLOAT64
constexpr std::int32_t BOTTLE_TAG_INT
constexpr std::int32_t BOTTLE_TAG_DOUBLE
RandScalar * implementation(void *t)
A simple collection of objects that can be described and transmitted in a portable way.
static const size_type npos
Bottle(std::initializer_list< yarp::os::Value > values)
Initializer list constructor.
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.
std::string toString(const T &value)
convert an arbitrary type to string.
std::string findGroup(const robotinterface::experimental::ParamList &list, const std::string &name)
bool read(ImageOf< PixelRgb > &dest, const std::string &src, image_fileformat format=FORMAT_ANY)
bool write(const ImageOf< PixelRgb > &src, const std::string &dest, image_fileformat format=FORMAT_PPM)
The main, catch-all namespace for YARP.
#define YARP_DEPRECATED_INTERNAL_MSG(X)