|
YARP
Yet Another Robot Platform
|
|
Go to the documentation of this file.
11 #ifndef YARP_OS_IMPL_STORABLE_H
12 #define YARP_OS_IMPL_STORABLE_H
26 BOTTLE_TAG_FLOAT32 | \
27 BOTTLE_TAG_FLOAT64 | \
79 return createStorable();
84 return cloneStorable();
87 static Storable* createByCode(std::int32_t
id);
213 return static_cast<const char*
>(
nullptr);
235 bool check(
const std::string& key)
const override;
364 std::string
toString()
const override;
365 void fromString(
const std::string& src)
override;
367 static const std::int32_t
code;
450 std::string
toString()
const override;
451 void fromString(
const std::string& src)
override;
453 static const std::int32_t
code;
474 return static_cast<std::int8_t
>(x);
536 std::string
toString()
const override;
537 void fromString(
const std::string& src)
override;
539 static const std::int32_t
code;
550 return static_cast<std::int8_t
>(x);
560 return static_cast<std::int16_t
>(x);
621 std::string
toString()
const override;
622 void fromString(
const std::string& src)
override;
624 static const std::int32_t
code;
645 return static_cast<std::int8_t
>(x);
650 return static_cast<std::int16_t
>(x);
655 return static_cast<std::int32_t
>(x);
675 return (std::int32_t)x;
706 std::string
toString()
const override;
707 void fromString(
const std::string& src)
override;
709 static const std::int32_t
code;
725 return static_cast<std::int8_t
>(x);
730 return static_cast<std::int16_t
>(x);
735 return static_cast<std::int32_t
>(x);
740 return static_cast<std::int64_t
>(x);
781 std::string
toString()
const override;
782 void fromString(
const std::string& src)
override;
784 static const std::int32_t
code;
800 return static_cast<std::int8_t
>(x);
805 return static_cast<std::int16_t
>(x);
810 return static_cast<std::int32_t
>(x);
815 return static_cast<std::int64_t
>(x);
855 std::string
toString()
const override;
856 void fromString(
const std::string& src)
override;
857 std::string toStringNested()
const override;
858 void fromStringNested(
const std::string& src)
override;
860 static const std::int32_t
code;
871 return (x == 0 || x ==
'1');
942 std::string
toString()
const override;
943 void fromString(
const std::string& src)
override;
944 std::string toStringNested()
const override;
945 void fromStringNested(
const std::string& src)
override;
947 static const std::int32_t
code;
972 static std::string quotedString(
const std::string& x);
1007 std::string
toString()
const override;
1008 void fromString(
const std::string& src)
override;
1009 std::string toStringNested()
const override;
1010 void fromStringNested(
const std::string& src)
override;
1057 content = *(alt.
asList());
1065 std::string
toString()
const override;
1066 void fromString(
const std::string& src)
override;
1067 std::string toStringNested()
const override;
1068 void fromStringNested(
const std::string& src)
override;
1073 return code + subCode();
1089 std::int32_t subCode()
const override;
1093 return content.
find(key);
1122 content = *(alt.
asDict());
1130 std::string
toString()
const override;
1131 void fromString(
const std::string& src)
override;
1132 std::string toStringNested()
const override;
1133 void fromStringNested(
const std::string& src)
override;
1156 return content.
find(key);
1166 template <
typename T>
1169 std::int32_t c = -1;
1171 for (
unsigned int i = 0; i < content.size(); ++i) {
1172 std::int32_t sc = content.get(i).getCode();
1186 content.specialize(c);
1194 #endif // YARP_OS_IMPL_STORABLE_H
std::int32_t asVocab() const override
Get vocabulary identifier as an integer.
std::int32_t getCode() const override
Get standard type code of value.
void copy(const Storable &alt) override
Become a copy of the passed item.
A simple collection of objects that can be described and transmitted in a portable way.
StoreFloat32(yarp::conf::float32_t x)
yarp::conf::float32_t asFloat32() const override
Get 32-bit floating point value.
Value & find(const std::string &key) const override
Gets a value corresponding to a given keyword.
virtual void fromStringNested(const std::string &src)
Initialize from a string representation.
std::int64_t asInt64() const override
Get 64-bit integer value.
yarp::conf::float64_t asFloat64() const override
Get 64-bit floating point value.
StoreFloat64(yarp::conf::float64_t x)
yarp::conf::float64_t asFloat64() const override
Get 64-bit floating point value.
std::int16_t asInt16() const override
Get 16-bit integer value.
#define YARP_DECLARE_LOG_COMPONENT(name)
std::int32_t asInt32() const override
Get 32-bit integer value.
yarp::conf::float64_t asFloat64() const override
Get 64-bit floating point value.
virtual std::int32_t subCode() const
Return a code describing this item, used in serializing bottles.
virtual Storable * cloneStorable() const
Typed synonym for clone()
bool isFloat64() const override
Checks if value is a 64-bit floating point number.
void copy(const Storable &alt) override
Become a copy of the passed item.
yarp::os::Property * asDict() const override
Get dictionary (hash table) value.
A base class for nested structures that can be searched.
yarp::conf::float32_t asFloat32() const override
Get 32-bit floating point value.
bool read(ImageOf< PixelRgb > &dest, const std::string &src, image_fileformat format=FORMAT_ANY)
yarp::conf::float64_t asFloat64() const override
Get 64-bit floating point value.
virtual std::string toStringNested() const
Create string representation, including any syntax that should wrap it such as braces or parentheses.
bool isDict() const override
Checks if value is a dictionary.
std::int32_t asVocab() const override
Get vocabulary identifier as an integer.
bool isBool() const override
Checks if value is a boolean.
Storable * createStorable() const override
Factory method.
static const std::int32_t code
bool asBool() const override
Get boolean value.
static const std::int32_t code
virtual void fromString(const std::string &src)=0
Initialize from a string representation, assuming that any syntax around this representation such as ...
std::int64_t asInt64() const override
Get 64-bit integer value.
static const std::int32_t code
bool isVocab() const override
Checks if value is a vocabulary identifier.
std::int32_t asVocab() const override
Get vocabulary identifier as an integer.
#define YARP_SUPPRESS_DLL_INTERFACE_WARNING_ARG(x)
Suppress MSVC C4251 warning for the declaration.
void copy(const Storable &alt) override
Become a copy of the passed item.
virtual ~Storable()
Destructor.
std::int8_t asInt8() const override
Get 8-bit integer value.
std::int16_t asInt16() const override
Get 16-bit integer value.
bool isBlob() const override
Checks if value is a binary object.
std::int8_t asInt8() const override
Get 8-bit integer value.
bool isInt8() const override
Checks if value is a 8-bit integer.
static const std::int32_t code
static const std::int32_t code
Storable * createStorable() const override
Factory method.
bool isInt64() const override
Checks if value is a 64-bit integer.
static const std::int32_t code
bool isNull() const override
Checks if the object is invalid.
void copy(const Storable &alt) override
Become a copy of the passed item.
yarp::os::Value * clone() const override
Create a copy of the value.
yarp::os::Bottle & findGroup(const std::string &key) const override
Gets a list corresponding to a given keyword.
bool readRaw(ConnectionReader &connection) override
void copy(const Storable &alt) override
Become a copy of the passed item.
std::int8_t asInt8() const override
Get 8-bit integer value.
StoreInt64(std::int64_t x)
A single item in a Bottle.
void copy(const Storable &alt) override
Become a copy of the passed item.
std::int8_t asInt8() const override
Get 8-bit integer value.
static const std::int32_t code
std::int32_t getCode() const override
Get standard type code of value.
std::int32_t getCode() const override
Get standard type code of value.
yarp::os::Property * asDict() const override
Get dictionary (hash table) value.
yarp::conf::float64_t asFloat64() const override
Get 64-bit floating point value.
bool isInt8() const override
Checks if value is a 8-bit integer.
static const std::int32_t code
yarp::conf::float32_t asFloat32() const override
Get 32-bit floating point value.
bool isBlob() const override
Checks if value is a binary object.
static const std::int32_t code
bool isNull() const override
Checks if the object is invalid.
std::int32_t asInt32() const override
Get 32-bit integer value.
std::int32_t getCode() const override
Get standard type code of value.
std::int32_t getCode() const override
Get standard type code of value.
std::int64_t asInt64() const override
Get 64-bit integer value.
Bottle & findGroup(const std::string &key) const override
Gets a list corresponding to a given keyword.
yarp::conf::float32_t asFloat32() const override
Get 32-bit floating point value.
bool isBool() const override
Checks if value is a boolean.
Searchable * asSearchable() const override
Get dictionary or list value.
std::int32_t getCode() const override
Get standard type code of value.
bool asBool() const override
Get boolean value.
StoreBlob(const std::string &x)
std::int32_t asVocab() const override
Get vocabulary identifier as an integer.
bool asBool() const override
Get boolean value.
Storable * createStorable() const override
Factory method.
bool isString() const override
Checks if value is a string.
yarp::conf::float32_t asFloat32() const override
Get 32-bit floating point value.
void copy(const Storable &alt) override
Become a copy of the passed item.
std::int16_t asInt16() const override
Get 16-bit integer value.
bool isVocab() const override
Checks if value is a vocabulary identifier.
An interface for writing to a network connection.
Storable * createStorable() const override
Factory method.
bool isFloat64() const override
Checks if value is a 64-bit floating point number.
const char * asBlob() const override
Get binary data value.
void copy(const Storable &alt) override
Become a copy of the passed item.
std::int8_t asInt8() const override
Get 8-bit integer value.
std::int64_t asInt64() const override
Get 64-bit integer value.
yarp::os::Value & find(const std::string &key) const override
Gets a value corresponding to a given keyword.
std::int32_t getCode() const override
Get standard type code of value.
bool asBool() const override
Get boolean value.
bool isInt32() const override
Checks if value is a 32-bit integer.
bool writeRaw(ConnectionWriter &connection) const override
yarp::conf::float64_t asFloat64() const override
Get 64-bit floating point value.
std::int64_t asInt64() const override
Get 64-bit integer value.
std::int32_t asVocab() const override
Get vocabulary identifier as an integer.
size_t asBlobLength() const override
Get binary data length.
std::string asString() const override
Get string value.
bool isFloat32() const override
Checks if value is a 32-bit floating point number.
bool isFloat32() const override
Checks if value is a 32-bit floating point number.
yarp::os::Bottle * asList() const override
Get list value.
bool isInt16() const override
Checks if value is a 16-bit integer.
yarp::conf::float32_t asFloat32() const override
Get 32-bit floating point value.
A 32-bit floating point number item.
virtual bool check(const std::string &key) const =0
Check if there exists a property of the given name.
Storable * createStorable() const override
Factory method.
static const std::int32_t code
std::int32_t asInt32() const override
Get 32-bit integer value.
StoreString(const std::string &x)
NetInt32 encode(const std::string &str)
Convert a string into a vocabulary identifier.
void copy(const Storable &alt) override
Become a copy of the passed item.
yarp::os::Bottle * asList() const override
Get list value.
StoreInt16(std::int16_t x)
A 64-bit floating point number item.
std::int32_t asInt32() const override
Get 32-bit integer value.
bool isList() const override
Checks if value is a list.
StoreInt32(std::int32_t x)
bool asBool() const override
Get boolean value.
std::int32_t asInt32() const override
Get 32-bit integer value.
std::string toString() const override=0
Return a standard text representation of the content of the object.
Storable * createStorable() const override
Factory method.
std::int16_t asInt16() const override
Get 16-bit integer value.
yarp::os::Bottle & findGroup(const std::string &key) const override
Gets a list corresponding to a given keyword.
#define yCAssert(component, x)
virtual Storable * createStorable() const =0
Factory method.
bool isLeaf() const override
Storable * createStorable() const override
Factory method.
An interface for reading from a network connection.
virtual void copy(const Storable &alt)=0
Become a copy of the passed item.
std::int8_t asInt8() const override
Get 8-bit integer value.
std::int8_t asInt8() const override
Get 8-bit integer value.
std::int64_t asInt64() const override
Get 64-bit integer value.
Storable * createStorable() const override
Factory method.
void copy(const Storable &alt) override
Become a copy of the passed item.
std::int64_t asInt64() const override
Get 64-bit integer value.
yarp::conf::float64_t asFloat64() const override
Get 64-bit floating point value.
StoreVocab(std::int32_t x)
Storable * createStorable() const override
Factory method.
void copy(const Storable &alt) override
Become a copy of the passed item.
std::int32_t getCode() const override
Get standard type code of value.
size_t asBlobLength() const override
Get binary data length.
bool isString() const override
Checks if value is a string.
bool isInt64() const override
Checks if value is a 64-bit integer.
yarp::conf::float32_t asFloat32() const override
Get 32-bit floating point value.
bool asBool() const override
Get boolean value.
std::int32_t getCode() const override
Get standard type code of value.
std::string toString(const T &value)
convert an arbitrary type to string.
std::int16_t asInt16() const override
Get 16-bit integer value.
The main, catch-all namespace for YARP.
bool isDict() const override
Checks if value is a dictionary.
void fromString(const std::string &src) override
Initialize from a string representation, assuming that any syntax around this representation such as ...
std::string asString() const override
Get string value.
const char * asBlob() const override
Get binary data value.
std::int32_t asInt32() const override
Get 32-bit integer value.
virtual bool writeRaw(ConnectionWriter &connection) const =0
bool isInt32() const override
Checks if value is a 32-bit integer.
yarp::os::Value * create() const override
Create a new value of the same type.
std::int32_t getCode() const override
Get standard type code of value.
std::string toString() const override
Return a standard text representation of the content of the object.
std::int32_t asInt32() const override
Get 32-bit integer value.
yarp::conf::float32_t asFloat32() const override
Get 32-bit floating point value.
bool write(const ImageOf< PixelRgb > &src, const std::string &dest, image_fileformat format=FORMAT_PPM)
A single value (typically within a Bottle).
std::int64_t asInt64() const override
Get 64-bit integer value.
static const std::int32_t code
yarp::os::Value & find(const std::string &key) const override
Gets a value corresponding to a given keyword.
const yarp::os::LogComponent & STORABLE()
void copy(const Storable &alt) override
Become a copy of the passed item.
std::string asString() const override
Get string value.
Storable * createStorable() const override
Factory method.
std::int32_t subCoder(T &content)
std::int32_t getCode() const override
Get standard type code of value.
virtual bool readRaw(ConnectionReader &connection)=0
Storable * createStorable() const override
Factory method.
std::int32_t asInt32() const override
Get 32-bit integer value.
std::int32_t asVocab() const override
Get vocabulary identifier as an integer.
std::int32_t getCode() const override
Get standard type code of value.
yarp::conf::float64_t asFloat64() const override
Get 64-bit floating point value.
A class for storing options and configuration information.
std::int16_t asInt16() const override
Get 16-bit integer value.
bool isInt16() const override
Checks if value is a 16-bit integer.
bool isList() const override
Checks if value is a list.
std::int16_t asInt16() const override
Get 16-bit integer value.
std::int32_t asVocab() const override
Get vocabulary identifier as an integer.
Storable * createStorable() const override
Factory method.