Urbi SDK Remote for C++  2.7.5
urbi::UVar Class Reference

UVar class definition. More...

#include <uvar.hh>

Inheritance diagram for urbi::UVar:
Collaboration diagram for urbi::UVar:

List of all members.

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)
UVaroperator= (ufloat)
UVaroperator= (const std::string &)
UVaroperator= (const UBinary &)
 Deep copy.
UVaroperator= (const UImage &i)
 Deep copy.
UVaroperator= (const USound &s)
 Deep copy.
UVaroperator= (const UList &l)
UVaroperator= (const UDictionary &d)
UVaroperator= (const UValue &v)
template<typename T >
UVaroperator= (const T &)
template<typename T >
bool operator== (const T &) const
template<typename T >
as (T *) const
 Cast operator taking a dummy value of the target type.
template<typename 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 UValueval () 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::UVarImplimpl_

Private Member Functions

UVaroperator= (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

Detailed Description

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.

Definition at line 33 of file uvar.hh.


Member Enumeration Documentation

Enumerator:
RTP_DEFAULT 

Use RTP if it is the default mode.

RTP_YES 

Force RTP.

RTP_NO 

Do not use RTP.

Definition at line 158 of file uvar.hh.


Constructor & Destructor Documentation

urbi::UVar::UVar ( ) [inline]

Creates an unbound UVar. Call init() to bind it.

Definition at line 28 of file uvar.hxx.

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().


Member Function Documentation

void urbi::UVar::__init ( ) [private]
template<typename T >
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().

template<typename T >
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().

template<typename T >
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().

UValue urbi::UVar::getProp ( UProperty  prop) [inline]
ufloat& urbi::UVar::in ( )

Kernel operators.

void urbi::UVar::init ( const std::string &  varname,
impl::UContextImpl ctx = 0 
)
void urbi::UVar::init ( const std::string &  object,
const std::string &  slot,
impl::UContextImpl ctx = 0 
) [inline]

Reimplemented in urbi::InputPort.

Definition at line 41 of file uvar.hxx.

References init().

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 bool ( ) const [inline]

Definition at line 22 of file uvar.hxx.

urbi::UVar::operator const UBinary & ( ) const
urbi::UVar::operator int ( ) const
urbi::UVar::operator std::string ( ) const
urbi::UVar::operator UBinary * ( ) const [inline]

Deep copy, binary will have to be deleted by the user.

Definition at line 142 of file uvar.hxx.

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.

UVar& urbi::UVar::operator= ( const UVar ) [private]
UVar& urbi::UVar::operator= ( ufloat  )
UVar& urbi::UVar::operator= ( const std::string &  )
UVar& urbi::UVar::operator= ( const UBinary )

Deep copy.

UVar& urbi::UVar::operator= ( const UImage i)

Deep copy.

UVar& urbi::UVar::operator= ( const USound s)

Deep copy.

UVar& urbi::UVar::operator= ( const UList l)
UVar& urbi::UVar::operator= ( const UDictionary d)
UVar & urbi::UVar::operator= ( const UValue v) [inline]

Definition at line 89 of file uvar.hxx.

References check(), impl_, and urbi::impl::UVarImpl::set().

template<typename T >
UVar & urbi::UVar::operator= ( const T &  v)

Definition at line 116 of file uvar.hxx.

References check(), impl_, urbi::impl::UVarImpl::set(), and val().

template<typename T >
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().

void urbi::UVar::setProp ( UProperty  prop,
const UValue v 
) [inline]

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]

Definition at line 139 of file uvar.hh.

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().

Referenced by init(), and ~UVar().

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]

Friends And Related Function Documentation

friend class impl::UVarImpl [friend]

Definition at line 203 of file uvar.hh.


Member Data Documentation

Definition at line 132 of file uvar.hh.

Definition at line 133 of file uvar.hh.

Definition at line 131 of file uvar.hh.

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().

Definition at line 128 of file uvar.hh.

Property accessors.

Definition at line 127 of file uvar.hh.

Definition at line 130 of file uvar.hh.

Definition at line 129 of file uvar.hh.

UVardata* urbi::UVar::vardata [private]

Pointer to internal data specifics.

Definition at line 168 of file uvar.hh.

Referenced by __init(), and invariant().


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