YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
yarp::os::impl::StoreBlob Class Reference

A binary blob item. More...

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

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

Public Member Functions

 StoreBlob ()=default
 
 StoreBlob (const std::string &x)
 
StorablecreateStorable () const override
 Factory method.
 
void copy (const Storable &alt) override
 Become a copy of the passed item.
 
std::string toString () const override
 Return a standard text representation of the content of the object.
 
void fromString (const std::string &src) override
 Initialize from a string representation, assuming that any syntax around this representation such as braces or parentheses has already been consumed.
 
std::string toStringNested () const override
 Create string representation, including any syntax that should wrap it such as braces or parentheses.
 
void fromStringNested (const std::string &src) override
 Initialize from a string representation.
 
std::int32_t getCode () const override
 Get standard type code of value.
 
bool readRaw (ConnectionReader &reader) override
 
bool writeRaw (ConnectionWriter &writer) const override
 
bool isBlob () const override
 Checks if value is a binary object.
 
const charasBlob () const override
 Get binary data value.
 
size_t asBlobLength () const override
 Get binary data length.
 
- Public Member Functions inherited from yarp::os::impl::Storable
virtual ~Storable ()
 Destructor.
 
virtual StorablecloneStorable () const
 Typed synonym for clone()
 
bool operator== (const yarp::os::Value &alt) const
 
yarp::os::Valuecreate () const override
 Create a new value of the same type.
 
yarp::os::Valueclone () const override
 Create a copy of the value.
 
bool read (ConnectionReader &connection) override
 Read this object from a network connection.
 
bool write (ConnectionWriter &connection) const override
 Write this object to a network connection.
 
bool isBool () const override
 Checks if value is a boolean.
 
bool asBool () const override
 Get boolean value.
 
bool isInt8 () const override
 Checks if value is a 8-bit integer.
 
std::int8_t asInt8 () const override
 Get 8-bit integer value.
 
bool isInt16 () const override
 Checks if value is a 16-bit integer.
 
std::int16_t asInt16 () const override
 Get 16-bit integer value.
 
bool isInt32 () const override
 Checks if value is a 32-bit integer.
 
std::int32_t asInt32 () const override
 Get 32-bit integer value.
 
bool isInt64 () const override
 Checks if value is a 64-bit integer.
 
std::int64_t asInt64 () const override
 Get 64-bit integer value.
 
bool isFloat32 () const override
 Checks if value is a 32-bit floating point number.
 
yarp::conf::float32_t asFloat32 () const override
 Get 32-bit floating point value.
 
bool isFloat64 () const override
 Checks if value is a 64-bit floating point number.
 
yarp::conf::float64_t asFloat64 () const override
 Get 64-bit floating point value.
 
bool isString () const override
 Checks if value is a string.
 
std::string asString () const override
 Get string value.
 
bool isList () const override
 Checks if value is a list.
 
yarp::os::BottleasList () const override
 Get list value.
 
bool isDict () const override
 Checks if value is a dictionary.
 
yarp::os::PropertyasDict () const override
 Get dictionary (hash table) value.
 
bool isVocab32 () const override
 Checks if value is a vocabulary identifier.
 
yarp::conf::vocab32_t asVocab32 () const override
 Get vocabulary identifier as an integer.
 
bool isNull () const override
 Checks if the object is invalid.
 
SearchableasSearchable () const override
 Get dictionary or list value.
 
bool check (const std::string &key) const override
 Check if there exists a property of the given name.
 
yarp::os::Valuefind (const std::string &key) const override
 Gets a value corresponding to a given keyword.
 
yarp::os::BottlefindGroup (const std::string &key) const override
 Gets a list corresponding to a given keyword.
 
virtual std::int32_t subCode () const
 Return a code describing this item, used in serializing bottles.
 
bool isLeaf () const override
 
- Public Member Functions inherited from yarp::os::Value
 Value ()
 Construct a list Value.
 
 Value (std::int32_t x, bool isVocab32=false)
 Construct an integer Value.
 
 Value (yarp::conf::float64_t x)
 Construct a floating point Value.
 
 Value (const std::string &str, bool isVocab32=false)
 Construct a string Value.
 
 Value (void *data, int length)
 Construct a binary data Value.
 
 Value (const Value &alt)
 Copy constructor.
 
const Valueoperator= (const Value &alt)
 Assignment operator.
 
 ~Value () override
 Destructor.
 
bool read (ConnectionReader &connection) override
 Read this object from a network connection.
 
bool write (ConnectionWriter &connection) const override
 Write this object to a network connection.
 
bool check (const std::string &key) const override
 Check if there exists a property of the given name.
 
Valuefind (const std::string &key) const override
 Gets a value corresponding to a given keyword.
 
BottlefindGroup (const std::string &key) const override
 Gets a list corresponding to a given keyword.
 
bool operator== (const Value &alt) const
 Equality test.
 
bool operator!= (const Value &alt) const
 Inequality test.
 
void fromString (const char *str)
 Set value to correspond to a textual representation.
 
std::string toString () const override
 Return a standard text representation of the content of the object.
 
bool isNull () const override
 Checks if the object is invalid.
 
virtual bool check (const std::string &key) const=0
 Check if there exists a property of the given name.
 
virtual bool check (const std::string &key, const std::string &comment) const
 Check if there exists a property of the given name.
 
virtual bool check (const std::string &key, Value *&result, const std::string &comment="") const
 Gets a value corresponding to a given keyword.
 
virtual Value check (const std::string &key, const Value &fallback, const std::string &comment="") const
 Gets a value corresponding to a given keyword.
 
virtual BottlefindGroup (const std::string &key) const=0
 Gets a list corresponding to a given keyword.
 
BottlefindGroup (const std::string &key, const std::string &comment) const
 Gets a list corresponding to a given keyword.
 
- Public Member Functions inherited from yarp::os::Portable
virtual Type getType () const
 
- Public Member Functions inherited from yarp::os::PortReader
virtual ~PortReader ()
 Destructor.
 
virtual Type getReadType () const
 
- Public Member Functions inherited from yarp::os::PortWriter
virtual ~PortWriter ()
 Destructor.
 
virtual void onCompletion () const
 This is called when the port has finished all writing operations.
 
virtual void onCommencement () const
 This is called when the port is about to begin writing operations.
 
virtual yarp::os::Type getWriteType () const
 
- Public Member Functions inherited from yarp::os::Searchable
 Searchable ()
 Default constructor.
 
 Searchable (const Searchable &rhs)=default
 Copy constructor.
 
 Searchable (Searchable &&rhs) noexcept=default
 Move constructor.
 
virtual ~Searchable ()
 Destructor.
 
Searchableoperator= (const Searchable &rhs)=default
 Copy assignment operator.
 
Searchableoperator= (Searchable &&rhs) noexcept=default
 Move assignment operator.
 
BottlefindGroup (const std::string &key, const std::string &comment) const
 Gets a list corresponding to a given keyword.
 

Static Public Attributes

static const std::int32_t code = (4 + 8)
 

Additional Inherited Members

- Static Public Member Functions inherited from yarp::os::impl::Storable
static StorablecreateByCode (std::int32_t id)
 
- Static Public Member Functions inherited from yarp::os::Value
static ValuemakeInt8 (std::int8_t x)
 Create a 8-bit integer Value.
 
static ValuemakeInt16 (std::int16_t x)
 Create a 16-bit integer Value.
 
static ValuemakeInt32 (std::int32_t x)
 Create a 32-bit integer Value.
 
static ValuemakeInt64 (std::int64_t x)
 Create a 64-bit integer Value.
 
static ValuemakeFloat32 (yarp::conf::float32_t x)
 Create a 32-bit floating point Value.
 
static ValuemakeFloat64 (yarp::conf::float64_t x)
 Create a 64-bit floating point Value.
 
static ValuemakeString (const std::string &str)
 Create a string Value.
 
static ValuemakeVocab32 (yarp::conf::vocab32_t v)
 Create a vocabulary identifier Value.
 
static ValuemakeVocab32 (char a, char b=0, char c=0, char d=0)
 Create a vocabulary identifier Value.
 
static ValuemakeVocab32 (const std::string &str)
 Create a vocabulary identifier Value If the string is longer than 4 characters, only the first 4 are used.
 
static ValuemakeBlob (void *data, int length)
 Create a Value containing binary data.
 
static ValuemakeList ()
 Create a list Value.
 
static ValuemakeList (const char *txt)
 Create a list Value and initialize it.
 
static ValuemakeValue (const std::string &txt)
 Create a Value from a text description.
 
static ValuegetNullValue ()
 Return an invalid, "null" Value.
 
- Static Public Member Functions inherited from yarp::os::Portable
static bool copyPortable (const PortWriter &writer, PortReader &reader)
 Copy one portable to another, via writing and reading.
 

Detailed Description

A binary blob item.

Definition at line 973 of file Storable.h.

Constructor & Destructor Documentation

◆ StoreBlob() [1/2]

yarp::os::impl::StoreBlob::StoreBlob ( )
default

◆ StoreBlob() [2/2]

yarp::os::impl::StoreBlob::StoreBlob ( const std::string &  x)
inline

Definition at line 982 of file Storable.h.

Member Function Documentation

◆ asBlob()

const char * yarp::os::impl::StoreBlob::asBlob ( ) const
inlineoverridevirtual

Get binary data value.

Returns
pointer to binary data if value is indeed binary data. Otherwise returns nullptr

Reimplemented from yarp::os::impl::Storable.

Definition at line 1021 of file Storable.h.

◆ asBlobLength()

size_t yarp::os::impl::StoreBlob::asBlobLength ( ) const
inlineoverridevirtual

Get binary data length.

Returns
length of binary data if value is indeed binary data. Otherwise returns 0

Reimplemented from yarp::os::impl::Storable.

Definition at line 1026 of file Storable.h.

◆ copy()

void yarp::os::impl::StoreBlob::copy ( const Storable alt)
inlineoverridevirtual

Become a copy of the passed item.

Implements yarp::os::impl::Storable.

Definition at line 992 of file Storable.h.

◆ createStorable()

Storable * yarp::os::impl::StoreBlob::createStorable ( ) const
inlineoverridevirtual

Factory method.

Implements yarp::os::impl::Storable.

Definition at line 987 of file Storable.h.

◆ fromString()

void StoreBlob::fromString ( const std::string &  src)
overridevirtual

Initialize from a string representation, assuming that any syntax around this representation such as braces or parentheses has already been consumed.

Implements yarp::os::impl::Storable.

Definition at line 533 of file Storable.cpp.

◆ fromStringNested()

void StoreBlob::fromStringNested ( const std::string &  src)
overridevirtual

Initialize from a string representation.

This should consume any syntax around that representation such as braces or parentheses.

Reimplemented from yarp::os::impl::Storable.

Definition at line 543 of file Storable.cpp.

◆ getCode()

std::int32_t yarp::os::impl::StoreBlob::getCode ( ) const
inlineoverridevirtual

Get standard type code of value.

Returns
the standard type code of the value.

Reimplemented from yarp::os::Value.

Definition at line 1008 of file Storable.h.

◆ isBlob()

bool yarp::os::impl::StoreBlob::isBlob ( ) const
inlineoverridevirtual

Checks if value is a binary object.

If so, asBlob() and asBlobLength() will return it.

Returns
true iff value is a binary object.

Reimplemented from yarp::os::impl::Storable.

Definition at line 1016 of file Storable.h.

◆ readRaw()

bool StoreBlob::readRaw ( ConnectionReader reader)
overridevirtual

Implements yarp::os::impl::Storable.

Definition at line 554 of file Storable.cpp.

◆ toString()

std::string StoreBlob::toString ( ) const
overridevirtual

Return a standard text representation of the content of the object.

The representation is readable by the Bottle and Property classes.

Returns
A standard text representation of the content of the object.

Implements yarp::os::impl::Storable.

Definition at line 515 of file Storable.cpp.

◆ toStringNested()

std::string StoreBlob::toStringNested ( ) const
overridevirtual

Create string representation, including any syntax that should wrap it such as braces or parentheses.

Reimplemented from yarp::os::impl::Storable.

Definition at line 528 of file Storable.cpp.

◆ writeRaw()

bool StoreBlob::writeRaw ( ConnectionWriter writer) const
overridevirtual

Implements yarp::os::impl::Storable.

Definition at line 562 of file Storable.cpp.

Member Data Documentation

◆ code

const int StoreBlob::code = (4 + 8)
static

Definition at line 1007 of file Storable.h.


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