77 if (
proxy ==
nullptr) {
85 if (
alt.proxy !=
nullptr) {
93 if (
proxy !=
nullptr) {
108 if (
proxy !=
nullptr) {
117 return proxy->isBool();
123 return proxy->isInt8();
129 return proxy->isInt16();
135 return proxy->isInt32();
141 return proxy->isInt64();
147 return proxy->isFloat32();
153 return proxy->isFloat64();
159 return proxy->isString();
165 return proxy->isList();
171 return proxy->isDict();
177 return proxy->isVocab32();
183 return proxy->isBlob();
189 return proxy->asBool();
195 return proxy->asInt8();
201 return proxy->asInt16();
207 return proxy->asInt32();
213 return proxy->asInt64();
219 return proxy->asFloat32();
225 return proxy->asFloat64();
231 return proxy->asVocab32();
237 return proxy->asString();
243 return proxy->asList();
249 return proxy->asDict();
255 if (
proxy->isDict()) {
256 return proxy->asDict();
258 return proxy->asList();
264 return proxy->asBlob();
270 return proxy->asBlobLength();
275 if (
proxy !=
nullptr) {
280 if ((x & 0xffff) != x) {
296 x &= ~BOTTLE_TAG_LIST;
303 if (
proxy ==
nullptr) {
311 if (
proxy ==
nullptr) {
324 return proxy->check(key);
330 return proxy->find(key);
336 return proxy->findGroup(key);
348 return !((*this) ==
alt);
359 return proxy->toString();
365 return proxy->create();
371 return proxy->clone();
377 return proxy->getCode();
383 return proxy->isNull();
435 std::string s((
char*)data, length);
450 v->
asList()->fromString(txt);
459 if (bot.
size() > 1) {
474 if (this->proxy !=
nullptr) {
476 this->proxy =
nullptr;
482void Value::ok()
const
484 const Value* op =
this;
485 if (
proxy ==
nullptr) {
A simple collection of objects that can be described and transmitted in a portable way.
size_type size() const
Gets the number of elements in the bottle.
Value & get(size_type index) const
Reads a Value v from a certain part of the list.
A mini-server for performing network communication in the background.
void write(bool forceStrict=false)
Write the current object being returned by BufferedPort::prepare.
An interface for reading from a network connection.
An interface for writing to a network connection.
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).
virtual yarp::conf::float64_t asFloat64() const
Get 64-bit floating point value.
virtual bool isString() const
Checks if value is a string.
static Value * makeList()
Create a list Value.
virtual std::int8_t asInt8() const
Get 8-bit integer value.
bool operator!=(const Value &alt) const
Inequality test.
virtual Value * clone() const
Create a copy of the value.
bool write(ConnectionWriter &connection) const override
Write this object to a network connection.
static Value * makeFloat64(yarp::conf::float64_t x)
Create a 64-bit floating point Value.
static Value * makeInt8(std::int8_t x)
Create a 8-bit integer Value.
virtual std::int64_t asInt64() const
Get 64-bit integer value.
virtual Searchable * asSearchable() const
Get dictionary or list value.
virtual bool isBool() const
Checks if value is a boolean.
virtual yarp::conf::vocab32_t asVocab32() const
Get vocabulary identifier as an integer.
static Value * makeVocab32(yarp::conf::vocab32_t v)
Create a vocabulary identifier Value.
static Value * makeInt64(std::int64_t x)
Create a 64-bit integer Value.
virtual bool isLeaf() const
virtual bool asBool() const
Get boolean value.
virtual std::int32_t asInt32() const
Get 32-bit integer value.
virtual size_t asBlobLength() const
Get binary data length.
static Value * makeValue(const std::string &txt)
Create a Value from a text description.
virtual bool isInt16() const
Checks if value is a 16-bit integer.
virtual bool isList() const
Checks if value is a list.
static Value & getNullValue()
Return an invalid, "null" Value.
virtual Bottle * asList() const
Get list value.
virtual bool isInt8() const
Checks if value is a 8-bit integer.
static Value * makeInt16(std::int16_t x)
Create a 16-bit integer Value.
static Value * makeFloat32(yarp::conf::float32_t x)
Create a 32-bit floating point Value.
virtual Property * asDict() const
Get dictionary (hash table) value.
static Value * makeBlob(void *data, int length)
Create a Value containing binary data.
virtual bool isBlob() const
Checks if value is a binary object.
virtual const char * asBlob() const
Get binary data value.
~Value() override
Destructor.
virtual bool isFloat64() const
Checks if value is a 64-bit floating point number.
Bottle & findGroup(const std::string &key) const override
Gets a list corresponding to a given keyword.
std::string toString() const override
Return a standard text representation of the content of the object.
virtual bool isInt32() const
Checks if value is a 32-bit integer.
static Value * makeString(const std::string &str)
Create a string Value.
virtual bool isDict() const
Checks if value is a dictionary.
virtual std::int32_t getCode() const
Get standard type code of value.
virtual bool isInt64() const
Checks if value is a 64-bit integer.
static Value * makeInt32(std::int32_t x)
Create a 32-bit integer Value.
virtual Value * create() const
Create a new value of the same type.
Value & find(const std::string &key) const override
Gets a value corresponding to a given keyword.
bool read(ConnectionReader &connection) override
Read this object from a network connection.
virtual bool isFloat32() const
Checks if value is a 32-bit floating point number.
Value()
Construct a list Value.
bool isNull() const override
Checks if the object is invalid.
virtual bool isVocab32() const
Checks if value is a vocabulary identifier.
bool check(const std::string &key) const override
Check if there exists a property of the given name.
bool operator==(const Value &alt) const
Equality test.
const Value & operator=(const Value &alt)
Assignment operator.
void fromString(const char *str)
Set value to correspond to a textual representation.
virtual yarp::conf::float32_t asFloat32() const
Get 32-bit floating point value.
virtual std::int16_t asInt16() const
Get 16-bit integer value.
virtual std::string asString() const
Get string value.
static StoreNull & getNull()
A single item in a Bottle.
static Storable * createByCode(std::int32_t id)
virtual bool readRaw(ConnectionReader &connection)=0
A 32-bit floating point number item.
A 64-bit floating point number item.
The components from which ports and connections are built.
An interface to the operating system, including Port based communication.