UGDK  0.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
virtualprimitive.h File Reference
#include <ugdk/script/virtualdata.h>
#include <ugdk/script/type.h>
#include <ugdk/system/exceptions.h>
#include <type_traits>
Include dependency graph for virtualprimitive.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  ugdk::script::is_virtual_primitive< T >
 
class  ugdk::script::VirtualPrimitive< T >
 
class  ugdk::script::VirtualPrimitive< T * >
 
struct  ugdk::script::is_virtual_primitive< T * >
 
class  ugdk::script::VirtualPrimitive< T & >
 
struct  ugdk::script::is_virtual_primitive< T & >
 
class  ugdk::script::VirtualPrimitive< std::unique_ptr< T > >
 
struct  ugdk::script::is_virtual_primitive< std::unique_ptr< T > >
 

Namespaces

 ugdk
 
 ugdk::script
 

Macros

#define TYPENAME_MAP(definition)
 
#define DEFINE_SCRIPT_PRIMITIVE_VALUE(type, name, arg)
 
#define DEFINE_SCRIPT_SIMPLE_PRIMITIVE_VALUE(type, name)   DEFINE_SCRIPT_PRIMITIVE_VALUE(type, name, value)
 

Functions

template<typename T , typename S >
ugdk::script::CheckAndCast (S value)
 
template<>
std::string ugdk::script::CheckAndCast< std::string, const char * > (const char *value)
 
 ugdk::script::DEFINE_SCRIPT_PRIMITIVE_VALUE (std::string, String, value.c_str())
 

Macro Definition Documentation

#define DEFINE_SCRIPT_PRIMITIVE_VALUE (   type,
  name,
  arg 
)
Value:
template <> \
class VirtualPrimitive<type> { \
public: \
static type value(const VirtualData::Ptr data, bool) { \
return CheckAndCast<type>(data->Unwrap##name()); \
} \
static void set_value(const VirtualData::Ptr data, type value, bool) { \
data->Wrap##name(arg); \
} \
private: \
VirtualPrimitive() {} \
}; \
template <> \
struct is_virtual_primitive<type> { static const bool value = true; }
#define DEFINE_SCRIPT_SIMPLE_PRIMITIVE_VALUE (   type,
  name 
)    DEFINE_SCRIPT_PRIMITIVE_VALUE(type, name, value)
#define TYPENAME_MAP (   definition)
Value:
definition(const char*, String); \
definition(bool, Boolean); \
definition(int, Integer); \
definition(long, Integer); \
definition(short, Integer); \
definition(float, Number); \
definition(double, Number);