Urbi SDK Remote for C++  2.7.5
uvalue.hxx File Reference
#include <libport/cassert>
#include <libport/foreach.hh>
#include <libport/lexical-cast.hh>
#include <libport/preproc.hh>
Include dependency graph for uvalue.hxx:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  urbi::uvalue_caster< UVar >
struct  urbi::uvalue_caster< UBinary >
struct  urbi::uvalue_caster< UList >
struct  urbi::uvalue_caster< UDictionary >
struct  urbi::uvalue_caster< const char * >
struct  urbi::uvalue_caster< boost::unordered_map< std::string, V > >
struct  urbi::uvalue_caster< UPackedData< T > >

Namespaces

namespace  urbi
 

Global definition of the starterlist.


Defines

#define ULIST_NTH(Const)
#define CONTAINER_TO_UVALUE_DECLARE(Type)
#define OP_COMMA(Type)
#define UVALUE_INTEGRAL_CAST(Type)
#define UVALUE_CASTER_DEFINE(Type)
#define UVALUE_CASTER_DEFINE(Type)
#define UVALUE_CASTER_DECLARE(Type)
#define UVALUE_CONTAINER_CASTER_DECLARE(Type)

Functions

std::ostream & urbi::operator<< (std::ostream &s, const UValue &v)
template<typename Type >
uvar_ref_traits< typename
uvalue_cast_return_type< Type >
::type >::type 
urbi::uvalue_cast (UValue &v)
 urbi::UVALUE_CASTER_DEFINE (std::string)
 urbi::UVALUE_CASTER_DEFINE (bool)
 urbi::UVALUE_CASTER_DEFINE (UImage)
 urbi::UVALUE_CASTER_DEFINE (USound)
 urbi::UVALUE_CASTER_DEFINE (const UValue &)
 urbi::UVALUE_CASTER_DEFINE (UValue &)
 urbi::UVALUE_CASTER_DEFINE (const UValue)
 urbi::UVALUE_CONTAINER_CASTER_DECLARE (std::list)
 urbi::UVALUE_CONTAINER_CASTER_DECLARE (std::vector)
template<typename V >
UValue & urbi::operator, (UValue &v, const boost::unordered_map< std::string, V > &d)
template<typename T >
void urbi::uvalue_cast_bounce (T &t, UValue &v)
 Bounce to uvalue_cast().
template<typename T >
UValue & urbi::operator, (UValue &v, const UPackedData< T > &d)

Detailed Description

Definition in file uvalue.hxx.


Define Documentation

#define CONTAINER_TO_UVALUE_DECLARE (   Type)
Value:
template <typename T>                                         \
  inline                                                        \
  UValue&                                                       \
  operator, (UValue &b, const Type<T> &v)                       \
  {                                                             \
    b.type = DATA_LIST;                                         \
    b.list = new UList();                                       \
    for (typename Type<T>::const_iterator i = v.begin(),        \
           i_end = v.end();                                     \
         i != i_end; ++i)                                       \
    {                                                           \
      UValue r;                                                 \
      r, *i;                                                    \
      b.list->array.push_back(new UValue(r));                   \
    }                                                           \
    return b;                                                   \
  }

Definition at line 142 of file uvalue.hxx.

#define OP_COMMA (   Type)
Value:
inline                                        \
  UValue& UValue::operator, (Type rhs)          \
  {                                             \
    return *this = rhs;                         \
  }

Definition at line 167 of file uvalue.hxx.

#define ULIST_NTH (   Const)
Value:
inline                                        \
  Const UValue&                                 \
  UList::operator[](size_t i) Const             \
  {                                             \
    i += offset;                                \
    if (i < size())                             \
      return *array[i];                         \
    else                                        \
      return UValue::error();                   \
  }

Definition at line 25 of file uvalue.hxx.

#define UVALUE_CASTER_DECLARE (   Type)
Value:
template <>                                     \
  struct URBI_SDK_API uvalue_caster<Type>       \
  {                                             \
    Type operator () (UValue& v);               \
  }

Definition at line 286 of file uvalue.hxx.

#define UVALUE_CASTER_DEFINE (   Type)
Value:
template <>                                     \
  struct uvalue_caster <Type>                   \
  {                                             \
    Type operator() (UValue& v)                 \
    {                                           \
      return v;                                 \
    }                                           \
  };

Definition at line 260 of file uvalue.hxx.

#define UVALUE_CASTER_DEFINE (   Type)
Value:
template <>                                   \
  struct uvalue_caster<Type>                    \
  {                                             \
    const UValue& operator()(UValue& v)         \
    {                                           \
      return v;                                 \
    }                                           \
  }

Definition at line 260 of file uvalue.hxx.

#define UVALUE_CONTAINER_CASTER_DECLARE (   Type)
Value:
template <typename T>                                         \
  struct uvalue_caster< Type<T> >                               \
  {                                                             \
    Type<T>                                                     \
    operator()(UValue& v)                                       \
    {                                                           \
      Type<T> res;                                              \
      if (v.type != DATA_LIST)                                  \
        /* Cast just the element.  */                           \
        res.push_back(uvalue_cast<T>(v));                       \
      else                                                      \
        for (size_t i = 0; i < v.list->size(); ++i)             \
          res.push_back(uvalue_cast<T>(*v.list->array[i]));     \
      return res;                                               \
    }                                                           \
  }

Definition at line 303 of file uvalue.hxx.

#define UVALUE_INTEGRAL_CAST (   Type)
Value:
inline                                                        \
  UValue::operator Type() const                                 \
  {                                                             \
    return static_cast<Type>(static_cast<ufloat>((*this)));     \
  }

Definition at line 182 of file uvalue.hxx.