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
45 #ifndef DOXYGEN_SHOULD_SKIP_THIS
76 #if defined(SWIG) && (SWIG_VERSION < 0x300011)
84 using Searchable::check;
102 explicit Bottle(
const std::string& text);
122 Bottle(std::initializer_list<yarp::os::Value> values);
150 #ifndef YARP_NO_DEPRECATED
158 YARP_DEPRECATED_MSG("Use addInt32 instead")
161 addInt32(
static_cast<std::int32_t
>(x));
170 void addInt8(std::int8_t x);
177 void addInt16(std::int16_t x);
184 void addInt32(std::int32_t x);
191 void addInt64(std::int64_t x);
193 #ifndef YARP_NO_DEPRECATED
200 YARP_DEPRECATED_MSG("Use addVocab32 instead")
203 return addVocab32(x);
237 #ifndef YARP_NO_DEPRECATED
246 YARP_DEPRECATED_MSG("Use addFloat64 instead")
274 void addString(
const char* str);
281 void addString(
const std::string& str);
288 void add(
const Value& value);
299 void add(
Value* value);
339 Value& get(size_type index)
const;
346 size_type size()
const;
358 void fromString(
const std::string& text);
366 void fromBinary(
const char* buf,
size_t len);
378 const char* toBinary(
size_t* size =
nullptr);
388 std::string
toString()
const override;
429 void onCommencement()
const override;
431 bool check(
const std::string& key)
const override;
433 Value& find(
const std::string& key)
const override;
437 bool isNull()
const override;
446 void copy(
const Bottle& alt, size_type first = 0, size_type len = npos);
453 static Bottle& getNullBottle();
461 bool operator==(
const Bottle& alt)
const;
469 bool operator!=(
const Bottle& alt)
const;
477 void append(
const Bottle& alt);
503 int getSpecialization();
512 static std::string describeBottleCode(
int code);
516 void setReadOnly(
bool readOnly);
521 #ifndef DOXYGEN_SHOULD_SKIP_THIS
#define BOTTLE_TAG_FLOAT64
constexpr std::int32_t BOTTLE_TAG_INT
constexpr std::int32_t BOTTLE_TAG_DOUBLE
constexpr std::int32_t BOTTLE_TAG_VOCAB
#define BOTTLE_TAG_VOCAB32
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 addDouble(double x)
Places a floating point number in the bottle, at the end of the list.
void addInt(int x)
Places an integer 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
void addVocab(yarp::conf::vocab32_t x)
Places a vocabulary item in the bottle, at the end of the list.
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.
#define YARP_DEPRECATED_MSG(MSG)
Expands to either the standard [[deprecated]] attribute or a compiler-specific decorator such as __at...
std::string toString(const T &value)
convert an arbitrary type to string.
NetInt32 encode(const std::string &str)
Convert a string into a vocabulary identifier.
constexpr yarp::conf::vocab32_t createVocab32(char a, char b=0, char c=0, char d=0)
Create a vocab from chars.
std::string findGroup(const robotinterface::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.