Urbi SDK Remote for C++  2.7.5
uvalue.hh File Reference
#include <libport/warning-push.hh>
#include <vector>
#include <libport/hash.hh>
#include <libport/preproc.hh>
#include <libport/traits.hh>
#include <libport/ufloat.h>
#include <urbi/fwd.hh>
#include <urbi/export.hh>
#include <urbi/ubinary.hh>
#include <urbi/uvalue.hxx>
#include <libport/warning-pop.hh>
Include dependency graph for uvalue.hh:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  urbi::UList
 Class storing URBI List type. More...
class  urbi::UNamedValue
class  urbi::UValue
 Container for a value that handles all types known to URBI. More...
struct  urbi::uvalue_caster< Type >
struct  urbi::uvar_ref_traits< T >
struct  urbi::uvar_ref_traits< UVar >
struct  urbi::uvalue_cast_return_type< T >
struct  urbi::uvalue_cast_return_type< const UValue & >
class  UPackedData< T >
 Packed data structure. More...

Namespaces

namespace  urbi
 

Global definition of the starterlist.


Defines

#define SYNCLINE_PUSH()   "//#push " BOOST_PP_STRINGIZE(__LINE__) " \"" __FILE__ "\"\n"
#define SYNCLINE_POP()   "//#pop\n"
#define __SRCDIR__   ""
#define SYNCLINE_WRAP(...)
#define CTOR_AND_ASSIGN_AND_COMMA(Type)
#define URBI_DERIVED_NUMERIC_TYPES
#define URBI_NUMERIC_TYPES
#define URBI_STRING_TYPES   LIBPORT_LIST(const char*, const void*, const std::string&,)
#define URBI_MISC_TYPES
#define CAST_OPERATOR(Type)   operator Type() const;
#define URBI_STRUCT_CAST_FIELD(_, Cname, Field)
#define URBI_STRUCT_BCAST_FIELD(_, Cname, Field)   dict[BOOST_PP_STRINGIZE(Field)], c.Field;
#define URBI_REGISTER_STRUCT(Cname,...)

Typedefs

typedef boost::unordered_map
< std::string, UValue > 
urbi::UDictionary

Enumerations

enum  urbi::UDataType {
  urbi::DATA_BINARY = 0, urbi::DATA_DOUBLE = 2, urbi::DATA_LIST = 3, urbi::DATA_STRING = 5,
  urbi::DATA_SLOTNAME = 6, urbi::DATA_VOID = 7
}
 Possible value types a UValue can contain. More...

Functions

int & urbi::kernelMajor (std::ostream &o)
 If a kernel version was associated to this stream, its value.
std::string urbi::syncline_push (const std::string &srcdir, std::string file, unsigned line)
 Issue a syncline.
std::ostream & urbi::operator<< (std::ostream &o, const UList &t)
std::ostream & urbi::operator<< (std::ostream &s, const urbi::UDictionary &d)
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)

Detailed Description

Definition in file uvalue.hh.


Define Documentation

#define __SRCDIR__   ""

Definition at line 55 of file uvalue.hh.

#define CAST_OPERATOR (   Type)    operator Type() const;

Definition at line 267 of file uvalue.hh.

#define CTOR_AND_ASSIGN_AND_COMMA (   Type)
Value:
explicit UValue(Type, bool copy=true);    \
    UValue& operator=(Type);                      \
    UValue& operator,(Type rhs);

Definition at line 216 of file uvalue.hh.

#define SYNCLINE_POP ( )    "//#pop\n"

Definition at line 51 of file uvalue.hh.

#define SYNCLINE_PUSH ( )    "//#push " BOOST_PP_STRINGIZE(__LINE__) " \"" __FILE__ "\"\n"

Definition at line 48 of file uvalue.hh.

#define URBI_DERIVED_NUMERIC_TYPES
Value:
LIBPORT_LIST(int, long, unsigned int, unsigned long, \
               unsigned long long, long long,)

Definition at line 222 of file uvalue.hh.

#define URBI_MISC_TYPES
Value:
LIBPORT_LIST(const UBinary&, const UList&, const UDictionary&, \
               const USound&, const UImage&,)

Definition at line 234 of file uvalue.hh.

#define URBI_NUMERIC_TYPES
Value:
LIBPORT_LIST(ufloat, int, long, unsigned int, unsigned long, \
               unsigned long long, long long,)

Definition at line 226 of file uvalue.hh.

#define URBI_REGISTER_STRUCT (   Cname,
  ... 
)
Value:
namespace urbi                                                        \
  {                                                                     \
    template<>                                                          \
      struct uvalue_caster<Cname>                                       \
    {                                                                   \
      Cname operator()(UValue& v)                                       \
      {                                                                 \
        if (v.type != DATA_DICTIONARY)                                  \
          throw std::runtime_error("invalid cast to " #Cname "from "    \
                                   + string_cast(v));                   \
        UDictionary& dict = *v.dictionary;                              \
        Cname res;                                                      \
        LIBPORT_VAARGS_APPLY(URBI_STRUCT_CAST_FIELD, Cname, __VA_ARGS__); \
        return res;                                                     \
      }                                                                 \
    };                                                                  \
                                                                        \
    static UValue& operator,(UValue& v, const Cname &c)                 \
    {                                                                   \
      v = UDictionary();                                                \
      UDictionary& dict = *v.dictionary;                                \
      dict["$sn"] = BOOST_PP_STRINGIZE(Cname);                          \
      LIBPORT_VAARGS_APPLY(URBI_STRUCT_BCAST_FIELD, Cname, __VA_ARGS__); \
      return v;                                                         \
    }                                                                   \
  }

Definition at line 389 of file uvalue.hh.

#define URBI_STRING_TYPES   LIBPORT_LIST(const char*, const void*, const std::string&,)

Definition at line 231 of file uvalue.hh.

#define URBI_STRUCT_BCAST_FIELD (   _,
  Cname,
  Field 
)    dict[BOOST_PP_STRINGIZE(Field)], c.Field;

Definition at line 385 of file uvalue.hh.

#define URBI_STRUCT_CAST_FIELD (   _,
  Cname,
  Field 
)
Value:
if (libport::mhas(dict, BOOST_PP_STRINGIZE(Field)))                   \
    uvalue_cast_bounce(res.Field, dict[BOOST_PP_STRINGIZE(Field)]);     \
  else                                                                  \
    GD_WARN("Serialized data for " #Cname "is missing field"            \
            BOOST_PP_STRINGIZE(Field));                                 \

Definition at line 378 of file uvalue.hh.