94 for (
const auto& val : values) {
112 rhs.implementation->parent = &
rhs;
224 if (
size !=
nullptr) {
284 return !
val2.isNull();
298 return *(
bb.asList());
350 return !((*this) ==
alt);
356 for (
size_t i = 0;
i <
alt.size();
i++) {
#define BOTTLE_TAG_FLOAT64
#define BOTTLE_TAG_STRING
#define BOTTLE_TAG_VOCAB32
RandScalar * implementation(void *t)
bool isNull() const override
Checks if the object is invalid.
A simple collection of objects that can be described and transmitted in a portable way.
static Bottle & getNullBottle()
A special Bottle with no content.
void add(const Value &value)
Add a Value to the bottle, at the end of the list.
static std::string describeBottleCode(int code)
Convert a numeric bottle code to a string.
Value pop()
Removes a Value v from the end of the list and returns this value.
Bottle & operator=(const Bottle &rhs)
Copy assignment operator.
void addVocab32(yarp::conf::vocab32_t x)
Places a vocabulary item in the bottle, at the end of the list.
void fromString(const std::string &text)
Initializes bottle from a string.
void append(const Bottle &alt)
Append the content of the given bottle to the current list.
int getSpecialization()
Get numeric bottle code for this bottle.
~Bottle() override
Destructor.
Property & addDict()
Places an empty key/value object in the bottle, at the end of the list.
Bottle & addList()
Places an empty nested list in the bottle, at the end of the list.
void addInt8(std::int8_t x)
Places a 8-bit integer in the bottle, at the end of the list.
size_type size() const
Gets the number of elements in the bottle.
bool read(ConnectionReader &reader) override
Set the bottle's value based on input from a network connection.
void addFloat64(yarp::conf::float64_t x)
Places a 64-bit floating point number in the bottle, at the end of the list.
void addFloat32(yarp::conf::float32_t x)
Places a 32-bit floating point number in the bottle, at the end of the list.
void setReadOnly(bool readOnly)
Value & get(size_type index) const
Reads a Value v from a certain part of the list.
Bottle & findGroup(const std::string &key) const override
Gets a list corresponding to a given keyword.
void copy(const Bottle &alt, size_type first=0, size_type len=npos)
Copy all or part of another Bottle.
static const size_type npos
bool check(const std::string &key) const override
Check if there exists a property of the given name.
Bottle tail() const
Get all but the first element of a bottle.
bool operator==(const Bottle &alt) const
Equality test.
void onCommencement() const override
This is called when the port is about to begin writing operations.
void clear()
Empties the bottle of any objects it contains.
void addInt16(std::int16_t x)
Places a 16-bit integer in the bottle, at the end of the list.
bool write(ConnectionWriter &writer) const override
Output a representation of the bottle to a network connection.
void addInt64(std::int64_t x)
Places a 64-bit integer in the bottle, at the end of the list.
bool operator!=(const Bottle &alt) const
Inequality test.
void addInt32(std::int32_t x)
Places a 32-bit integer in the bottle, at the end of the list.
bool isNull() const override
Checks if the object is invalid.
void addString(const char *str)
Places a string in the bottle, at the end of the list.
std::string toString() const override
Gives a human-readable textual representation of the bottle.
void hasChanged()
Declare that the content of the Bottle has been changed.
const char * toBinary(size_t *size=nullptr)
Returns binary representation of bottle.
void fromBinary(const char *buf, size_t len)
Initializes bottle from a binary representation.
Value & find(const std::string &key) const override
Gets a value corresponding to a given keyword.
A mini-server for performing network communication in the background.
T * read(bool shouldWait=true) override
Read an available object from the port.
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.
A dummy connection to test yarp::os::Portable implementations.
ConnectionWriter & getWriter()
Get the dummy ConnectionWriter loaded with whatever was written the ConnectionWriter since it was las...
void setTextMode(bool textmode)
Set the textMode of the dummy connection.
ConnectionReader & getReader(ConnectionWriter *replyWriter=nullptr)
Get the dummy ConnectionReader loaded with whatever was written the ConnectionWriter since it was las...
Interface implemented by all objects that can read themselves from the network, such as Bottle object...
virtual bool read(ConnectionReader &reader)=0
Read this object from a network connection.
Interface implemented by all objects that can write themselves to the network, such as Bottle objects...
virtual bool write(ConnectionWriter &writer) const =0
Write this object 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).
A flexible data format for holding a bunch of numbers and strings.
A single item in a Bottle.
#define yCAssert(component, x)
#define YARP_OS_LOG_COMPONENT(name, name_string)
std::string to_string(IntegerType x)