|
Urbi SDK Remote for C++
2.7.3
|
Container for a value that handles all types known to URBI. More...
#include <uvalue.hh>


Public Member Functions | |
| UValue () | |
| Class UValue implementation. | |
| UValue (const UValue &) | |
| ~UValue () | |
| UValue & | operator= (const UValue &) |
| UValue & | set (const UValue &, bool copy=true) |
| Setter. | |
| void | clear () |
| Delete content and reset type to void. | |
| UValue & | operator, (const UValue &b) |
| We use an operator , that behaves like an assignment. | |
| const char * | format_string () const |
| Return a legible definition of UDataType. | |
| operator ufloat () const | |
| operator std::string () const | |
| operator bool () const | |
| operator const UBinary & () const | |
| Accessor. Gives us an implicit operator UBinary() const. | |
| operator UList () const | |
| Deep copy. | |
| operator UDictionary () const | |
| Deep copy. | |
| operator UImage () const | |
| Shallow copy. | |
| operator USound () const | |
| Shallow copy. | |
| UValue & | operator() () |
| This operator does nothing, but helps with the previous operator,. | |
| int | parse (const char *message, int pos, const binaries_type &bins, binaries_type::const_iterator &binpos) |
| Parse an uvalue in current message+pos, returns pos of end of match -pos of error if error. | |
| std::ostream & | print (std::ostream &s) const |
Print itself on s, and return it. | |
Static Public Member Functions | |
| static UValue & | error () |
| A specific UValue used when we want to return an error. | |
Public Attributes | |
| UDataType | type |
| ufloat | val |
| value if of type DATA_DOUBLE | |
| union { | |
| std::string * stringValue | |
| value if of type DATA_STRING | |
| UBinary * binary | |
| value if of type DATA_BINARY | |
| UList * list | |
| value if of type DATA_LIST | |
| UDictionary * dictionary | |
| value if of type DATA_DICTIONARY | |
| void * storage | |
| internal | |
| }; | |
Static Public Attributes | |
| static const bool | copy = true |
Container for a value that handles all types known to URBI.
| urbi::UValue::UValue | ( | ) |
Class UValue implementation.
Definition at line 343 of file uvalue-common.cc.
Referenced by parse().
| urbi::UValue::UValue | ( | const UValue & | v | ) |
Definition at line 593 of file uvalue-common.cc.
| urbi::UValue::~UValue | ( | ) |
Definition at line 437 of file uvalue-common.cc.
References clear().
| void urbi::UValue::clear | ( | ) |
Delete content and reset type to void.
Definition at line 413 of file uvalue-common.cc.
References binary, urbi::DATA_BINARY, urbi::DATA_DICTIONARY, urbi::DATA_DOUBLE, urbi::DATA_LIST, urbi::DATA_SLOTNAME, urbi::DATA_STRING, urbi::DATA_VOID, dictionary, list, stringValue, and type.
Referenced by urbi::loadUValue(), urbi::operator,(), set(), and ~UValue().
| UValue & urbi::UValue::error | ( | ) | [static] |
A specific UValue used when we want to return an error.
For instance, out-of-bound access returns this object.
Definition at line 88 of file uvalue-common.cc.
| const char * urbi::UValue::format_string | ( | ) | const |
Return a legible definition of UDataType.
Definition at line 105 of file uvalue-common.cc.
References urbi::DATA_VOID, urbi::formats, and type.
| urbi::UValue::operator bool | ( | ) | const [inline] |
Definition at line 195 of file uvalue.hxx.
| urbi::UValue::operator const UBinary & | ( | ) | const |
Accessor. Gives us an implicit operator UBinary() const.
Definition at line 485 of file uvalue-common.cc.
References binary, urbi::DATA_BINARY, and type.
| urbi::UValue::operator std::string | ( | ) | const |
Definition at line 461 of file uvalue-common.cc.
References urbi::DATA_BINARY, urbi::DATA_DOUBLE, urbi::DATA_SLOTNAME, urbi::DATA_STRING, urbi::SOUND_UNKNOWN, and urbi::USound::soundFormat.
| urbi::UValue::operator UDictionary | ( | ) | const |
Deep copy.
Definition at line 515 of file uvalue-common.cc.
References urbi::DATA_DICTIONARY, dictionary, and type.
| urbi::UValue::operator ufloat | ( | ) | const |
Definition at line 442 of file uvalue-common.cc.
References urbi::DATA_BINARY, urbi::DATA_DICTIONARY, urbi::DATA_DOUBLE, urbi::DATA_LIST, urbi::DATA_SLOTNAME, urbi::DATA_STRING, urbi::DATA_VOID, type, and val.
| urbi::UValue::operator UImage | ( | ) | const |
Shallow copy.
Definition at line 494 of file uvalue-common.cc.
References binary, urbi::BINARY_IMAGE, urbi::DATA_BINARY, urbi::UBinary::image, urbi::UImage::make(), urbi::UBinary::type, and type.
| urbi::UValue::operator UList | ( | ) | const |
Deep copy.
Definition at line 508 of file uvalue-common.cc.
References urbi::DATA_LIST, list, and type.
| urbi::UValue::operator USound | ( | ) | const |
Shallow copy.
Definition at line 501 of file uvalue-common.cc.
References binary, urbi::BINARY_SOUND, urbi::DATA_BINARY, urbi::USound::make(), urbi::UBinary::sound, urbi::UBinary::type, and type.
| UValue & urbi::UValue::operator() | ( | ) | [inline] |
This operator does nothing, but helps with the previous operator,.
Indeed, when writing "uval, void_expr", the compiler complains about uval being evaluated for nothing. Let's have it believe we're doing something...
Definition at line 203 of file uvalue.hxx.
We use an operator , that behaves like an assignment.
The only difference is when the rhs is void, in which case it is the regular comma which is used. This allows to write "uval, expr" to mean "compute expr and assign its result to uval, unless expr is void".
Definition at line 138 of file uvalue.hxx.
Definition at line 522 of file uvalue-common.cc.
| int urbi::UValue::parse | ( | const char * | message, |
| int | pos, | ||
| const binaries_type & | bins, | ||
| binaries_type::const_iterator & | binpos | ||
| ) |
Parse an uvalue in current message+pos, returns pos of end of match -pos of error if error.
Definition at line 149 of file uvalue-common.cc.
References urbi::UList::array, binary, CHECK_NEOF, urbi::DATA_BINARY, urbi::DATA_DICTIONARY, urbi::DATA_DOUBLE, urbi::DATA_LIST, urbi::DATA_STRING, urbi::DATA_VOID, dictionary, EXPECT, list, urbi::UBinary::parse(), parse(), SKIP_SPACES, stringValue, type, UValue(), and val.
Referenced by urbi::UMessage::init_(), and parse().
| std::ostream & urbi::UValue::print | ( | std::ostream & | s | ) | const |
Print itself on s, and return it.
Definition at line 307 of file uvalue-common.cc.
References binary, urbi::DATA_BINARY, urbi::DATA_DICTIONARY, urbi::DATA_DOUBLE, urbi::DATA_LIST, urbi::DATA_SLOTNAME, urbi::DATA_STRING, urbi::DATA_VOID, dictionary, list, stringValue, type, and val.
Referenced by urbi::operator<<().
Setter.
If copy is false, binary data if present is not copied. This is dangerous, as the user must ensure that the source UValue lives longer than this one.
Definition at line 527 of file uvalue-common.cc.
References urbi::UList::array, binary, clear(), urbi::DATA_BINARY, urbi::DATA_DICTIONARY, urbi::DATA_DOUBLE, urbi::DATA_LIST, urbi::DATA_SLOTNAME, urbi::DATA_STRING, urbi::DATA_VOID, dictionary, list, urbi::UList::offset, storage, stringValue, type, and val.
Referenced by urbi::impl::RemoteUContextImpl::assignMessage(), and urbi::impl::RemoteUVarImpl::sync().
| union { ... } |
value if of type DATA_BINARY
Definition at line 183 of file uvalue.hh.
Referenced by clear(), urbi::loadUValue(), operator const UBinary &(), operator UImage(), operator USound(), urbi::uvalue_caster< UBinary >::operator()(), urbi::uvalue_caster< UPackedData< T > >::operator()(), urbi::operator,(), parse(), print(), urbi::saveUValue(), urbi::UAbstractClient::send(), set(), urbi::USyncClient::syncGetImage(), urbi::USyncClient::syncGetSound(), and urbi::impl::RemoteUVarImpl::transmit().
const bool urbi::UValue::copy = true [static] |
value if of type DATA_DICTIONARY
Definition at line 185 of file uvalue.hh.
Referenced by clear(), urbi::loadUValue(), operator UDictionary(), urbi::uvalue_caster< UDictionary >::operator()(), urbi::uvalue_caster< boost::unordered_map< std::string, V > >::operator()(), urbi::operator,(), parse(), print(), urbi::saveUValue(), urbi::UAbstractClient::send(), and set().
value if of type DATA_LIST
Definition at line 184 of file uvalue.hh.
Referenced by clear(), urbi::impl::RemoteUContextImpl::dispatcher(), urbi::loadUValue(), urbi::impl::RemoteUObjectImpl::onUpdate(), operator UList(), urbi::uvalue_caster< UList >::operator()(), parse(), print(), urbi::impl::RemoteUContextImpl::RemoteUContextImpl(), urbi::saveUValue(), urbi::UAbstractClient::send(), set(), and transmitRemoteWrite().
| void* urbi::UValue::storage |
internal
Definition at line 186 of file uvalue.hh.
Referenced by urbi::uvalue_caster< UVar >::operator()(), set(), and urbi::uvar_uvalue_cast().
| std::string* urbi::UValue::stringValue |
value if of type DATA_STRING
Definition at line 182 of file uvalue.hh.
Referenced by clear(), urbi::uvalue_caster< UVar >::operator()(), urbi::uvalue_caster< const char * >::operator()(), urbi::uvalue_caster< UObject * >::operator()(), parse(), print(), urbi::saveUValue(), set(), urbi::UAbstractClient::setVersion(), and urbi::impl::RemoteUVarImpl::transmit().
Definition at line 177 of file uvalue.hh.
Referenced by urbi::impl::RemoteUContextImpl::call(), urbi::impl::call_result(), clear(), urbi::impl::RemoteUContextImpl::dispatcher(), urbi::impl::RemoteUContextImpl::emit(), format_string(), urbi::loadUValue(), urbi::impl::RemoteUContextImpl::onRTPListenMessage(), operator const UBinary &(), operator UDictionary(), operator ufloat(), operator UImage(), operator UList(), operator USound(), urbi::uvalue_caster< UVar >::operator()(), urbi::uvalue_caster< UBinary >::operator()(), urbi::uvalue_caster< UList >::operator()(), urbi::uvalue_caster< UDictionary >::operator()(), urbi::uvalue_caster< const char * >::operator()(), urbi::uvalue_caster< boost::unordered_map< std::string, V > >::operator()(), urbi::uvalue_caster< UPackedData< T > >::operator()(), urbi::uvalue_caster< UObject * >::operator()(), urbi::operator,(), parse(), print(), urbi::saveUValue(), urbi::UAbstractClient::send(), set(), urbi::UAbstractClient::setVersion(), urbi::USyncClient::syncGetImage(), urbi::USyncClient::syncGetSound(), urbi::impl::RemoteUVarImpl::transmit(), and urbi::uvar_uvalue_cast().
| ufloat urbi::UValue::val |
value if of type DATA_DOUBLE
Definition at line 179 of file uvalue.hh.
Referenced by urbi::impl::RemoteUContextImpl::onRTPListenMessage(), operator ufloat(), parse(), print(), urbi::saveUValue(), and set().