Gorgon Game Engine
MappedInstanceMember< C_, T_ > Class Template Reference

This class allows a one to one mapping of a data member to a c++ data member. More...

Inheritance diagram for MappedInstanceMember< C_, T_ >:
[legend]

Public Member Functions

 MappedInstanceMember (T_ classbase::*member, const std::string &name, const std::string &help, const Type *type, bool constant=false, bool ref=false)
 Constructor. More...
 
- Public Member Functions inherited from MappedROInstanceMember< C_, T_ >
 MappedROInstanceMember (T_ classbase::*member, const std::string &name, const std::string &help, const Type *type, bool constant=false)
 Constructor. More...
 
virtual ~MappedROInstanceMember ()
 
- Public Member Functions inherited from InstanceMember
 InstanceMember (const std::string &name, const std::string &help, const Type &type, bool constant=false, bool ref=false, bool readonly=false)
 Constructor. More...
 
virtual ~InstanceMember ()
 
Data Get (Data &source) const
 Gets data from the datamember. More...
 
const TypeGetType () const
 Returns the type of this data member. More...
 
bool IsConstant () const
 Returns whether this member is a constant. More...
 
virtual bool IsInstanceMember () const override final
 Returns if this member is an instance member. More...
 
bool IsReadonly () const
 Returns whether this member is read-only. More...
 
bool IsReference () const
 Returns whether this member is a reference. More...
 
void Set (Data &source, Data &value) const
 Sets the data of the data member, if the source is a reference, this function should perform in place replacement of the value. More...
 
- Public Member Functions inherited from Member
 Member (const std::string &name, const std::string &help)
 
virtual ~Member ()
 
std::string GetHelp () const
 Returns the help string. Help strings may contain markdown notation. More...
 
std::string GetName () const
 Returns the name of this member. More...
 
const MemberGetOwner () const
 
std::string GetQualifiedName () const
 Returns the namespace qualified name of this member. More...
 

Protected Types

using classptr = typename std::remove_pointer< C_ >::type *
 
- Protected Types inherited from MappedROInstanceMember< C_, T_ >
enum  { istypeconst, istypeptr }
 
using classbase = typename std::remove_pointer< C_ >::type
 
using classptr = typename std::remove_pointer< C_ >::type *
 
using normaltype = typename std::remove_const< typename std::remove_pointer< T_ >::type >::type
 

Protected Member Functions

template<class T2_ = T_>
std::enable_if<!std::is_pointer< T2_ >::value, T2_ >::typegetref (T2_ &value) const
 
template<class T2_ = T_>
std::enable_if< std::is_pointer< T2_ >::value, typename std::remove_pointer< T2_ >::type >::typegetref (T2_ value) const
 
virtual void set (Data &source, Data &value) const override
 This function should perform set operation. More...
 
- Protected Member Functions inherited from MappedROInstanceMember< C_, T_ >
 MappedROInstanceMember (T_ classbase::*member, const std::string &name, const std::string &help, const Type *type, bool constant, bool ref, bool readonly)
 
virtual Data get (Scripting::Data &data) const override
 This function should return the value of this member. More...
 
template<class T2_ = T_>
std::enable_if< std::is_copy_constructible< T2_ >::value, Data >::type getnonref (Data &data) const
 
template<class T2_ = T_>
std::enable_if<!std::is_copy_constructible< T2_ >::value, Data >::type getnonref (Data &data) const
 
virtual void typecheck (const Scripting::Type *type) const override final
 Type checks the parent. More...
 
- Protected Member Functions inherited from Member
virtual void SetParent (const Member &parent)
 Changes the parent of the member. More...
 

Additional Inherited Members

- Static Protected Member Functions inherited from MappedROInstanceMember< C_, T_ >
template<class C2_ = C_>
static std::enable_if<!std::is_pointer< C2_ >::value, const C2_ * >::type clstoptr (const C2_ &val)
 
template<class C2_ = C_>
static std::enable_if< std::is_pointer< C2_ >::value, const C2_ >::type clstoptr (const C2_ val)
 
template<class T2_ = T_>
static std::enable_if< istypeptr, typename std::remove_pointer< T2_ >::type >::type deref (const T2_ val)
 
template<class T2_ = T_>
static std::enable_if<!istypeptr, typename std::remove_pointer< T2_ >::type >::type deref (const T2_ val)
 
template<class T2_ = T_>
static std::enable_if<!istypeptr, T2_ * >::type toptr (T2_ &val)
 
template<class T2_ = T_>
static std::enable_if< istypeptr, T2_ >::type toptr (T2_ val)
 
- Protected Attributes inherited from MappedROInstanceMember< C_, T_ >
T_ classbase::* member
 
- Protected Attributes inherited from InstanceMember
bool constant
 This instance member is a constant. More...
 
bool readonly
 Marks this instance as read-only. More...
 
bool reference
 This instance member is a reference. More...
 
const Typetype
 Type of the datamember. More...
 
- Protected Attributes inherited from Member
std::string help
 Help string of the datamember. More...
 
std::string name
 The name of the datamember. More...
 
const Memberparent
 

Detailed Description

template<class C_, class T_>
class Gorgon::Scripting::MappedInstanceMember< C_, T_ >

This class allows a one to one mapping of a data member to a c++ data member.

Member Typedef Documentation

◆ classptr

using classptr = typename std::remove_pointer<C_>::type *
protected

Constructor & Destructor Documentation

◆ MappedInstanceMember()

MappedInstanceMember ( T_ classbase::*  member,
const std::string &  name,
const std::string &  help,
const Type type,
bool  constant = false,
bool  ref = false 
)

Constructor.

References ASSERT, InstanceMember::constant, and Member::name.

Member Function Documentation

◆ getref() [1/2]

std::enable_if<!std::is_pointer<T2_>::value, T2_>::type& getref ( T2_ &  value) const
protected

◆ getref() [2/2]

std::enable_if<std::is_pointer<T2_>::value, typename std::remove_pointer<T2_>::type>::type& getref ( T2_  value) const
protected

◆ set()


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