YARP  2.3.70.1
Yet Another Robot Platform
yarp::os::impl::BottleImpl Class Reference

A flexible data format for holding a bunch of numbers and strings. More...

#include <yarp/os/impl/BottleImpl.h>

+ Inheritance diagram for yarp::os::impl::BottleImpl:

Public Member Functions

 BottleImpl ()
 
 BottleImpl (Searchable *parent)
 
virtual ~BottleImpl ()
 
bool isInt (int index)
 
bool isString (int index)
 
bool isDouble (int index)
 
bool isList (int index)
 
Storablepop ()
 
int getInt (int index)
 
yarp::os::ConstString getString (int index)
 
double getDouble (int index)
 
Storableget (int index) const
 
yarp::os::BottlegetList (int index)
 
void addInt (int x)
 
void addInt64 (const YARP_INT64 &x)
 
void addVocab (int x)
 
void addDouble (double x)
 
void addString (const yarp::os::ConstString &text)
 
yarp::os::BottleaddList ()
 
yarp::os::PropertyaddDict ()
 
void clear ()
 
void fromString (const ConstString &line)
 
ConstString toString ()
 
size_t size () const
 
virtual bool read (ConnectionReader &reader) override
 Read this object from a network connection. More...
 
virtual bool write (ConnectionWriter &writer) override
 Write this object to a network connection. More...
 
virtual void onCommencement () override
 This is called when the port is about to begin writing operations. More...
 
const char * getBytes ()
 
size_t byteCount ()
 
void copyRange (const BottleImpl *alt, int first=0, int len=-1)
 
bool fromBytes (const yarp::os::Bytes &data)
 
void toBytes (const yarp::os::Bytes &data)
 
bool fromBytes (yarp::os::ConnectionReader &reader)
 
void fromBinary (const char *text, int len)
 
void specialize (int subCode)
 
int getSpecialization ()
 
void setNested (bool nested)
 
int subCode ()
 
void addBit (yarp::os::Value *bit)
 
void addBit (const yarp::os::Value &bit)
 
yarp::os::ValueaddBit (const char *str)
 
void hasChanged ()
 
void edit ()
 
ValuefindGroupBit (const ConstString &key) const
 
ValuefindBit (const ConstString &key) const
 
- Public Member Functions inherited from yarp::os::Portable
virtual Type getType ()
 
- Public Member Functions inherited from yarp::os::PortReader
virtual ~PortReader ()
 Destructor. More...
 
virtual Type getReadType ()
 
- Public Member Functions inherited from yarp::os::PortWriter
virtual ~PortWriter ()
 Destructor. More...
 
virtual void onCompletion ()
 This is called when the port has finished all writing operations. More...
 
virtual Type getWriteType ()
 

Static Public Member Functions

static StoreNullgetNull ()
 
static bool isComplete (const char *txt)
 
static void fini ()
 
- Static Public Member Functions inherited from yarp::os::Portable
static bool copyPortable (PortWriter &writer, PortReader &reader)
 Copy one portable to another, via writing and reading. More...
 

Public Attributes

Searchable *const parent
 
bool invalid
 
bool ro
 

Private Member Functions

void add (Storable *s)
 
void smartAdd (const ConstString &str)
 
void synch ()
 

Private Attributes

PlatformVector< Storable * > content
 
PlatformVector< char > data
 
int speciality
 
bool nested
 
bool dirty
 

Static Private Attributes

static StoreNullstoreNull = YARP_NULLPTR
 

Detailed Description

A flexible data format for holding a bunch of numbers and strings.

Handy to use until you work out how to make your own more efficient formats for transmission.

Definition at line 435 of file BottleImpl.h.

Constructor & Destructor Documentation

◆ BottleImpl() [1/2]

BottleImpl::BottleImpl ( )

Definition at line 96 of file BottleImpl.cpp.

◆ BottleImpl() [2/2]

BottleImpl::BottleImpl ( Searchable parent)

Definition at line 105 of file BottleImpl.cpp.

◆ ~BottleImpl()

BottleImpl::~BottleImpl ( )
virtual

Definition at line 115 of file BottleImpl.cpp.

Member Function Documentation

◆ add()

void BottleImpl::add ( Storable s)
private

Definition at line 121 of file BottleImpl.cpp.

◆ addBit() [1/3]

void yarp::os::impl::BottleImpl::addBit ( yarp::os::Value bit)
inline

Definition at line 501 of file BottleImpl.h.

◆ addBit() [2/3]

void yarp::os::impl::BottleImpl::addBit ( const yarp::os::Value bit)
inline

Definition at line 507 of file BottleImpl.h.

◆ addBit() [3/3]

yarp::os::Value& yarp::os::impl::BottleImpl::addBit ( const char *  str)
inline

Definition at line 515 of file BottleImpl.h.

◆ addDict()

yarp::os::Property & BottleImpl::addDict ( )

Definition at line 1294 of file BottleImpl.cpp.

◆ addDouble()

void yarp::os::impl::BottleImpl::addDouble ( double  x)
inline

Definition at line 462 of file BottleImpl.h.

◆ addInt()

void yarp::os::impl::BottleImpl::addInt ( int  x)
inline

Definition at line 459 of file BottleImpl.h.

◆ addInt64()

void yarp::os::impl::BottleImpl::addInt64 ( const YARP_INT64 &  x)
inline

Definition at line 460 of file BottleImpl.h.

◆ addList()

yarp::os::Bottle & BottleImpl::addList ( )

Definition at line 1287 of file BottleImpl.cpp.

◆ addString()

void yarp::os::impl::BottleImpl::addString ( const yarp::os::ConstString text)
inline

Definition at line 463 of file BottleImpl.h.

◆ addVocab()

void yarp::os::impl::BottleImpl::addVocab ( int  x)
inline

Definition at line 461 of file BottleImpl.h.

◆ byteCount()

size_t BottleImpl::byteCount ( )

Definition at line 521 of file BottleImpl.cpp.

◆ clear()

void BottleImpl::clear ( )

Definition at line 128 of file BottleImpl.cpp.

◆ copyRange()

void BottleImpl::copyRange ( const BottleImpl alt,
int  first = 0,
int  len = -1 
)

Definition at line 1301 of file BottleImpl.cpp.

◆ edit()

void BottleImpl::edit ( )

Definition at line 1384 of file BottleImpl.cpp.

◆ findBit()

Value & BottleImpl::findBit ( const ConstString key) const

Definition at line 1410 of file BottleImpl.cpp.

◆ findGroupBit()

Value & BottleImpl::findGroupBit ( const ConstString key) const

Definition at line 1394 of file BottleImpl.cpp.

◆ fini()

static void yarp::os::impl::BottleImpl::fini ( )
inlinestatic

Definition at line 538 of file BottleImpl.h.

◆ fromBinary()

void BottleImpl::fromBinary ( const char *  text,
int  len 
)

Definition at line 453 of file BottleImpl.cpp.

◆ fromBytes() [1/2]

bool BottleImpl::fromBytes ( const yarp::os::Bytes data)

Definition at line 465 of file BottleImpl.cpp.

◆ fromBytes() [2/2]

bool BottleImpl::fromBytes ( yarp::os::ConnectionReader reader)

Definition at line 427 of file BottleImpl.cpp.

◆ fromString()

void BottleImpl::fromString ( const ConstString line)

Definition at line 233 of file BottleImpl.cpp.

◆ get()

Storable & BottleImpl::get ( int  index) const

Definition at line 1247 of file BottleImpl.cpp.

◆ getBytes()

const char * BottleImpl::getBytes ( )

Definition at line 514 of file BottleImpl.cpp.

◆ getDouble()

double BottleImpl::getDouble ( int  index)

Definition at line 1271 of file BottleImpl.cpp.

◆ getInt()

int BottleImpl::getInt ( int  index)

Definition at line 1255 of file BottleImpl.cpp.

◆ getList()

yarp::os::Bottle * BottleImpl::getList ( int  index)

Definition at line 1279 of file BottleImpl.cpp.

◆ getNull()

static StoreNull& yarp::os::impl::BottleImpl::getNull ( )
inlinestatic

Definition at line 526 of file BottleImpl.h.

◆ getSpecialization()

int BottleImpl::getSpecialization ( )

Definition at line 693 of file BottleImpl.cpp.

◆ getString()

yarp::os::ConstString BottleImpl::getString ( int  index)

Definition at line 1263 of file BottleImpl.cpp.

◆ hasChanged()

void yarp::os::impl::BottleImpl::hasChanged ( )
inline

Definition at line 537 of file BottleImpl.h.

◆ isComplete()

bool BottleImpl::isComplete ( const char *  txt)
static

Definition at line 299 of file BottleImpl.cpp.

◆ isDouble()

bool BottleImpl::isDouble ( int  index)

Definition at line 1216 of file BottleImpl.cpp.

◆ isInt()

bool BottleImpl::isInt ( int  index)

Definition at line 1199 of file BottleImpl.cpp.

◆ isList()

bool BottleImpl::isList ( int  index)

Definition at line 1225 of file BottleImpl.cpp.

◆ isString()

bool BottleImpl::isString ( int  index)

Definition at line 1208 of file BottleImpl.cpp.

◆ onCommencement()

void BottleImpl::onCommencement ( )
overridevirtual

This is called when the port is about to begin writing operations.

After this point, the write method may be called zero, once, or many times by YARP depending on the mix of formats and protocols in use.

Reimplemented from yarp::os::PortWriter.

Definition at line 527 of file BottleImpl.cpp.

◆ pop()

Storable * BottleImpl::pop ( )

Definition at line 1233 of file BottleImpl.cpp.

◆ read()

bool BottleImpl::read ( ConnectionReader reader)
overridevirtual

Read this object from a network connection.

Override this for your particular class.

Parameters
readeran interface to the network connection for reading
Returns
true iff the object is successfully read

Implements yarp::os::Portable.

Definition at line 563 of file BottleImpl.cpp.

◆ setNested()

void BottleImpl::setNested ( bool  nested)

Definition at line 698 of file BottleImpl.cpp.

◆ size()

size_t BottleImpl::size ( ) const

Definition at line 370 of file BottleImpl.cpp.

◆ smartAdd()

void BottleImpl::smartAdd ( const ConstString str)
private

Definition at line 137 of file BottleImpl.cpp.

◆ specialize()

void BottleImpl::specialize ( int  subCode)

Definition at line 687 of file BottleImpl.cpp.

◆ subCode()

int BottleImpl::subCode ( )

Definition at line 1194 of file BottleImpl.cpp.

◆ synch()

void BottleImpl::synch ( )
private

Definition at line 650 of file BottleImpl.cpp.

◆ toBytes()

void BottleImpl::toBytes ( const yarp::os::Bytes data)

Definition at line 506 of file BottleImpl.cpp.

◆ toString()

ConstString BottleImpl::toString ( )

Definition at line 357 of file BottleImpl.cpp.

◆ write()

bool BottleImpl::write ( ConnectionWriter writer)
overridevirtual

Write this object to a network connection.

Override this for your particular class. Be aware that depending on the nature of the connections a port has, and what protocol they use, and how efficient the YARP implementation is, this method may be called once, twice, or many times, as the result of a single call to Port::write

Parameters
writeran interface to the network connection for writing
Returns
true iff the object is successfully written

Implements yarp::os::Portable.

Definition at line 532 of file BottleImpl.cpp.

Member Data Documentation

◆ content

PlatformVector<Storable*> yarp::os::impl::BottleImpl::content
private

Definition at line 557 of file BottleImpl.h.

◆ data

PlatformVector<char> yarp::os::impl::BottleImpl::data
private

Definition at line 558 of file BottleImpl.h.

◆ dirty

bool yarp::os::impl::BottleImpl::dirty
private

Definition at line 561 of file BottleImpl.h.

◆ invalid

bool yarp::os::impl::BottleImpl::invalid

Definition at line 546 of file BottleImpl.h.

◆ nested

bool yarp::os::impl::BottleImpl::nested
private

Definition at line 560 of file BottleImpl.h.

◆ parent

Searchable* const yarp::os::impl::BottleImpl::parent

Definition at line 442 of file BottleImpl.h.

◆ ro

bool yarp::os::impl::BottleImpl::ro

Definition at line 547 of file BottleImpl.h.

◆ speciality

int yarp::os::impl::BottleImpl::speciality
private

Definition at line 559 of file BottleImpl.h.

◆ storeNull

yarp::os::impl::StoreNull * BottleImpl::storeNull = YARP_NULLPTR
staticprivate

Definition at line 555 of file BottleImpl.h.


The documentation for this class was generated from the following files: