Gorgon Game Engine
MappedStaticDataMember< T_ > Class Template Reference
Inheritance diagram for MappedStaticDataMember< T_ >:
[legend]

Public Member Functions

 MappedStaticDataMember (T_ value, const std::string &name, const std::string &help, const Type *type, bool constant=false, bool ref=false)
 If T_ is a non-pointer type or T_ is pointer and ref is set to true, the value would be used as initial value. More...
 
- Public Member Functions inherited from MappedROStaticDataMember< T_ >
 MappedROStaticDataMember (T_ value, const std::string &name, const std::string &help, const Type *type, bool isconstant=false)
 If T_ is not a pointer, uses the value as initial value and stores the current value locally. More...
 
virtual ~MappedROStaticDataMember ()
 
T_ & GetValue ()
 Returns the value stored in this data. More...
 
T_ GetValue () const
 Returns the value stored in this data. More...
 
- Public Member Functions inherited from StaticDataMember
 StaticDataMember (const std::string &name, const std::string &help, const Type *type)
 
 StaticDataMember (const std::string &name, const std::string &help, const Type *type, bool constant, bool ref, bool readonly)
 
template<class ... P_>
 StaticDataMember (const std::string &name, const std::string &help, const Type *type, Tag first, P_ ...rest)
 
virtual Data Get () const override
 Gets data from the datamember. More...
 
virtual MemberType GetMemberType () const override
 Returns the type of this member. More...
 
const TypeGetType () const
 Returns the type of this static member. More...
 
bool IsConstant () const
 Returns whether this member is a constant. 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 &newval)
 Changes the value of this member. More...
 
- Public Member Functions inherited from StaticMember
 StaticMember (const std::string &name, const std::string &help)
 
bool IsInstanceable () const
 Whether this member can be used to instantiate an object. More...
 
virtual bool IsInstanceMember () const override final
 Returns if this member is an instance member. 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 Member Functions

template<class T2_ = T_>
std::enable_if< std::is_pointer< T2_ >::value, typename std::remove_pointer< T2_ >::type >::typegetref ()
 
template<class T2_ = T_>
std::enable_if<!std::is_pointer< T2_ >::value, T2_ >::typegetref ()
 
virtual void set (Data &value) const override
 
- Protected Member Functions inherited from MappedROStaticDataMember< T_ >
 MappedROStaticDataMember (T_ value, const std::string &name, const std::string &help, const Type *type, bool isconstant, bool ref, bool readonly)
 
virtual Data get () const override
 This function should return the data. It is overloaded to enforce modifiers. More...
 
template<class T2_ = T_>
std::enable_if< std::is_copy_constructible< T2_ >::value, Data >::type getnonref ()
 
template<class T2_ = T_>
std::enable_if<!std::is_copy_constructible< T2_ >::value, Data >::type getnonref ()
 
virtual void set (Data &source, Data &value) const override
 
- Protected Member Functions inherited from StaticDataMember
virtual void set (Data &newval)=0
 Implementers of static data member should overload this function for assignment. More...
 
- Protected Member Functions inherited from Member
virtual void SetParent (const Member &parent)
 Changes the parent of the member. More...
 

Additional Inherited Members

- Public Types inherited from StaticMember
enum  MemberType {
  RegularType, EventType, EnumType, Namespace,
  DataMember, Function, Constant
}
 Possible member types. More...
 
- Protected Types inherited from MappedROStaticDataMember< T_ >
enum  { istypeconst, istypeptr }
 
using normaltype = typename std::remove_const< typename std::remove_pointer< T_ >::type >::type
 
- Protected Attributes inherited from MappedROStaticDataMember< T_ >
T_ value
 
- Protected Attributes inherited from StaticDataMember
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
 

Constructor & Destructor Documentation

◆ MappedStaticDataMember()

MappedStaticDataMember ( T_  value,
const std::string &  name,
const std::string &  help,
const Type type,
bool  constant = false,
bool  ref = false 
)

If T_ is a non-pointer type or T_ is pointer and ref is set to true, the value would be used as initial value.

It is possible to access current value through GetValue function. If T_ is a pointer and ref is false value is used as the storage.

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

Member Function Documentation

◆ getref() [1/2]

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

◆ getref() [2/2]

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

◆ set()


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