|
Urbi SDK Remote for C++
2.7.5
|
UVar class definition. More...
#include <uvar.hh>


Public Types | |
| enum | RtpMode { RTP_DEFAULT, RTP_YES, RTP_NO } |
Public Member Functions | |
| UVar () | |
| Creates an unbound UVar. Call init() to bind it. | |
| UVar (const std::string &, impl::UContextImpl *=0) | |
| UVar (const std::string &, const std::string &, impl::UContextImpl *=0) | |
| UVar (UObject &, const std::string &, impl::UContextImpl *=0) | |
| UVar (const UVar &) | |
| ~UVar () | |
| void | init (const std::string &varname, impl::UContextImpl *=0) |
| void | init (const std::string &object, const std::string &slot, impl::UContextImpl *=0) |
| void | setOwned () |
| UDataType | type () const |
| The type of the current content. | |
| void | syncValue () |
| Request the current value, wait until it is available. | |
| void | keepSynchronized () |
| Keep this UVar synchronized with kernel value. | |
| void | reset (ufloat) |
| UVar & | operator= (ufloat) |
| UVar & | operator= (const std::string &) |
| UVar & | operator= (const UBinary &) |
| Deep copy. | |
| UVar & | operator= (const UImage &i) |
| Deep copy. | |
| UVar & | operator= (const USound &s) |
| Deep copy. | |
| UVar & | operator= (const UList &l) |
| UVar & | operator= (const UDictionary &d) |
| UVar & | operator= (const UValue &v) |
| template<typename T > | |
| UVar & | operator= (const T &) |
| template<typename T > | |
| bool | operator== (const T &) const |
| template<typename T > | |
| T | as (T *) const |
| Cast operator taking a dummy value of the target type. | |
| template<typename T > | |
| T | as () const |
| Generic cast operator using the extensible uvalue_cast mechanism. | |
| template<typename T > | |
| T & | fill (T &) const |
| Conveniance wrapper on as(). | |
| operator int () const | |
| operator bool () const | |
| operator const UBinary & () const | |
| operator UBinary * () const | |
| Deep copy, binary will have to be deleted by the user. | |
| operator UImage () const | |
| In plugin mode, gives direct access to the buffer, which may not be valid after the calling function returns. | |
| operator USound () const | |
| In plugin mode, gives direct access to the buffer, which may not be valid after the calling function returns. | |
| operator ufloat () const | |
| operator std::string () const | |
| operator UList () const | |
| operator UDictionary () const | |
| void | unnotify () |
| Deactivate all callbacks associated with this UVar and stop synchro. | |
| ufloat & | in () |
| Kernel operators. | |
| ufloat & | out () |
| UValue | getProp (UProperty prop) |
| void | setProp (UProperty prop, const UValue &v) |
| void | setProp (UProperty prop, ufloat v) |
| void | setProp (UProperty prop, const char *v) |
| void | setProp (UProperty prop, const std::string &v) |
| bool | setBypass (bool enable=true) |
| Enable bypass-mode for this UVar. | |
| void | useRTP (bool enable=true) |
| Use RTP mode to transmit this variable if possible. | |
| const UValue & | val () const |
| libport::utime_t | timestamp () const |
| void | check () const |
| Check that impl_ is set or throw a runtime error. | |
Public Attributes | |
| bool | owned |
| Is the variable owned by the module? | |
| UProp | rangemin |
| Property accessors. | |
| UProp | rangemax |
| UProp | speedmin |
| UProp | speedmax |
| UProp | delta |
| UProp | blend |
| UProp | constant |
| impl::UVarImpl * | impl_ |
Private Member Functions | |
| UVar & | operator= (const UVar &) |
| void | __init () |
| PRIVATE (bool, temp) | |
| Full name of the variable as seen in URBI. | |
| PRIVATE (RtpMode, rtp) | |
| PRIVATE (bool, local) | |
| If set, this variable will never export its content remotely. | |
| bool | invariant () const |
Private Attributes | |
| UVardata * | vardata |
| Pointer to internal data specifics. | |
Friends | |
| class | impl::UVarImpl |
UVar class definition.
Each UVar instance corresponds to one URBI variable. The class provides access to the variable properties, and reading/writing the value to/from all known types.
| enum urbi::UVar::RtpMode |
| urbi::UVar::UVar | ( | ) | [inline] |
| urbi::UVar::UVar | ( | const std::string & | varname, |
| impl::UContextImpl * | impl = 0 |
||
| ) |
Definition at line 27 of file uvar-common.cc.
References __init().
| urbi::UVar::UVar | ( | const std::string & | objname, |
| const std::string & | varname, | ||
| impl::UContextImpl * | impl = 0 |
||
| ) |
Definition at line 45 of file uvar-common.cc.
References __init().
| urbi::UVar::UVar | ( | UObject & | obj, |
| const std::string & | varname, | ||
| impl::UContextImpl * | impl = 0 |
||
| ) |
Definition at line 36 of file uvar-common.cc.
References __init().
| urbi::UVar::UVar | ( | const UVar & | b | ) |
Definition at line 55 of file uvar-common.cc.
References __init().
| urbi::UVar::~UVar | ( | ) |
Definition at line 122 of file uvar-common.cc.
References urbi::impl::UVarImpl::clean(), impl_, urbi::name(), and unnotify().
| void urbi::UVar::__init | ( | ) | [private] |
Definition at line 108 of file uvar-common.cc.
References urbi::UContext::ctx_, urbi::impl::UContextImpl::getVarImpl(), impl_, urbi::impl::UVarImpl::initialize(), owned, RTP_DEFAULT, and vardata.
| T urbi::UVar::as | ( | T * | ) | const |
Cast operator taking a dummy value of the target type.
Definition at line 209 of file uvar.hxx.
References urbi::uvalue_cast(), and val().
| T urbi::UVar::as | ( | ) | const |
Generic cast operator using the extensible uvalue_cast mechanism.
Definition at line 203 of file uvar.hxx.
References urbi::uvalue_cast(), and val().
| void urbi::UVar::check | ( | ) | const [inline] |
Check that impl_ is set or throw a runtime error.
Definition at line 189 of file uvar.hxx.
References impl_.
Referenced by getProp(), keepSynchronized(), operator=(), setBypass(), setOwned(), setProp(), syncValue(), timestamp(), type(), urbi::UGenericCallback::UGenericCallback(), unnotify(), and val().
| T & urbi::UVar::fill | ( | T & | v | ) | const |
Conveniance wrapper on as().
Definition at line 215 of file uvar.hxx.
References urbi::uvalue_cast(), and val().
Referenced by urbi::CustomUVar< T >::updateCache().
Definition at line 175 of file uvar.hxx.
References check(), urbi::impl::UVarImpl::getProp(), and impl_.
Referenced by urbi::UProp::operator ufloat(), and urbi::UProp::operator UValue().
| ufloat& urbi::UVar::in | ( | ) |
Kernel operators.
| void urbi::UVar::init | ( | const std::string & | varname, |
| impl::UContextImpl * | ctx = 0 |
||
| ) |
Definition at line 65 of file uvar-common.cc.
References __init(), urbi::impl::UVarImpl::clean(), urbi::UContext::ctx_, urbi::getCurrentContext(), impl_, urbi::name(), and unnotify().
Referenced by init(), and urbi::UObject::UObject().
| void urbi::UVar::init | ( | const std::string & | object, |
| const std::string & | slot, | ||
| impl::UContextImpl * | ctx = 0 |
||
| ) | [inline] |
| bool urbi::UVar::invariant | ( | ) | const [private] |
Definition at line 90 of file uvar-common.cc.
References urbi::name(), and vardata.
| void urbi::UVar::keepSynchronized | ( | ) | [inline] |
Keep this UVar synchronized with kernel value.
Definition at line 81 of file uvar.hxx.
References check(), impl_, and urbi::impl::UVarImpl::keepSynchronized().
Referenced by urbi::UObject::USync().
| urbi::UVar::operator const UBinary & | ( | ) | const |
| urbi::UVar::operator int | ( | ) | const |
| urbi::UVar::operator std::string | ( | ) | const |
| urbi::UVar::operator UBinary * | ( | ) | const [inline] |
| urbi::UVar::operator UDictionary | ( | ) | const |
| urbi::UVar::operator ufloat | ( | ) | const |
| urbi::UVar::operator UImage | ( | ) | const |
In plugin mode, gives direct access to the buffer, which may not be valid after the calling function returns.
Changes to the other fields of the structure have no effect.
| urbi::UVar::operator UList | ( | ) | const |
| urbi::UVar::operator USound | ( | ) | const |
In plugin mode, gives direct access to the buffer, which may not be valid after the calling function returns.
Changes to the other fields of the structure have no effect.
Referenced by urbi::CustomUVar< T >::operator=().
| UVar& urbi::UVar::operator= | ( | ufloat | ) |
| UVar& urbi::UVar::operator= | ( | const std::string & | ) |
| UVar& urbi::UVar::operator= | ( | const UDictionary & | d | ) |
Definition at line 89 of file uvar.hxx.
References check(), impl_, and urbi::impl::UVarImpl::set().
| UVar & urbi::UVar::operator= | ( | const T & | v | ) |
| bool urbi::UVar::operator== | ( | const T & | v | ) | const |
Definition at line 223 of file uvar.hxx.
References urbi::uvalue_cast(), and val().
| ufloat& urbi::UVar::out | ( | ) |
| urbi::UVar::PRIVATE | ( | bool | , |
| temp | |||
| ) | [private] |
Full name of the variable as seen in URBI.
True if the variable is a temporary and must not be stored in callbacks
| urbi::UVar::PRIVATE | ( | RtpMode | , |
| rtp | |||
| ) | [private] |
| urbi::UVar::PRIVATE | ( | bool | , |
| local | |||
| ) | [private] |
If set, this variable will never export its content remotely.
| void urbi::UVar::reset | ( | ufloat | n | ) |
Definition at line 134 of file uvar-common.cc.
| bool urbi::UVar::setBypass | ( | bool | enable = true | ) | [inline] |
Enable bypass-mode for this UVar.
Plugin-mode only. In bypass mode, if the UVar contains binary data, the data is never copied. The consequence is that the data is only accessible from notifyChange callbacks (urbiScript or C++): it is invalidated as soon as all callbacks have returned.
Definition at line 168 of file uvar.hxx.
References check(), impl_, and urbi::impl::UVarImpl::setBypass().
| void urbi::UVar::setOwned | ( | ) | [inline] |
Definition at line 50 of file uvar.hxx.
References check(), impl_, and urbi::impl::UVarImpl::setOwned().
Definition at line 147 of file uvar.hxx.
References check(), impl_, and urbi::impl::UVarImpl::setProp().
Referenced by urbi::UProp::operator=().
| void urbi::UVar::setProp | ( | UProperty | prop, |
| ufloat | v | ||
| ) | [inline] |
Definition at line 160 of file uvar.hxx.
References check(), impl_, and urbi::impl::UVarImpl::setProp().
| void urbi::UVar::setProp | ( | UProperty | prop, |
| const char * | v | ||
| ) | [inline] |
Definition at line 153 of file uvar.hxx.
References check(), impl_, and urbi::impl::UVarImpl::setProp().
| void urbi::UVar::setProp | ( | UProperty | prop, |
| const std::string & | v | ||
| ) | [inline] |
| void urbi::UVar::syncValue | ( | ) | [inline] |
Request the current value, wait until it is available.
Definition at line 66 of file uvar.hxx.
References check(), impl_, and urbi::impl::UVarImpl::sync().
| libport::utime_t urbi::UVar::timestamp | ( | ) | const |
Definition at line 171 of file uvar-common.cc.
References check(), impl_, and urbi::impl::UVarImpl::timestamp().
| UDataType urbi::UVar::type | ( | ) | const [inline] |
The type of the current content.
Definition at line 58 of file uvar.hxx.
References check(), impl_, and urbi::impl::UVarImpl::type().
| void urbi::UVar::unnotify | ( | ) | [inline] |
Deactivate all callbacks associated with this UVar and stop synchro.
Reimplemented in urbi::InputPort.
Definition at line 182 of file uvar.hxx.
References check(), impl_, and urbi::impl::UVarImpl::unnotify().
| void urbi::UVar::useRTP | ( | bool | enable = true | ) | [inline] |
Use RTP mode to transmit this variable if possible.
Definition at line 196 of file uvar.hxx.
References impl_, RTP_NO, RTP_YES, and urbi::impl::UVarImpl::useRTP().
Referenced by urbi::impl::RemoteUContextImpl::setRTPMessage().
| const UValue & urbi::UVar::val | ( | ) | const [inline] |
Definition at line 73 of file uvar.hxx.
References check(), urbi::impl::UVarImpl::get(), and impl_.
Referenced by as(), fill(), urbi::operator<<(), operator=(), urbi::UList::operator=(), operator==(), and urbi::uvar_uvalue_cast().
friend class impl::UVarImpl [friend] |
Definition at line 153 of file uvar.hh.
Referenced by __init(), check(), getProp(), urbi::InputPort::init(), init(), urbi::InputPort::InputPort(), keepSynchronized(), urbi::InputPort::operator=(), operator=(), urbi::impl::RemoteUGenericCallbackImpl::registerCallback(), setBypass(), setOwned(), setProp(), syncValue(), timestamp(), type(), unnotify(), useRTP(), val(), and ~UVar().
| bool urbi::UVar::owned |
Is the variable owned by the module?
Definition at line 124 of file uvar.hh.
Referenced by __init(), urbi::impl::RemoteUVarImpl::setOwned(), and urbi::UGenericCallback::UGenericCallback().
UVardata* urbi::UVar::vardata [private] |
Pointer to internal data specifics.
Definition at line 168 of file uvar.hh.
Referenced by __init(), and invariant().