/* ----------------------------------------------------------------------------- GSFramework Copyright 2001-2013 Emmanuel Julien. All Rights Reserved. ----------------------------------------------------------------------------- */ #ifndef __NSCRIPTVARIANT__ #define __NSCRIPTVARIANT__ #include "data/nvariant.h" #include "script/script_vm.h" namespace GS { namespace Script { class Object; /// Script variant. struct Variant { enum Type { Type_None = 0, Type_Variant, Type_ScriptObject, Type_UserObject }; Type type; GS::Variant variant; bool object_owner; Object *object; void *ptr; uint typetag; bool operator == (const Variant &) const; bool operator != (const Variant &) const; void Set(); void Set(bool v); void Set(int v); void Set(uint v); void Set(float v); void Set(const char *v); void Set(const GS::Variant &v); void Set(Object *object, bool object_owner = false); void Set(const void *p, size_t size); void Set(void *ptr, uint typetag); Variant(); Variant(bool v); Variant(int v); Variant(uint v); Variant(float v); Variant(const char *v); Variant(const GS::Variant &v); Variant(Object *object, bool object_owner = false); Variant(const void *p, size_t size); Variant(void *ptr, uint typetag); ~Variant(); }; } // Script } // GS #endif // __NSCRIPTVARIANT__