![]() |
Gorgon Game Engine
|
This class represents an instance data member. More...
Public Member Functions | |
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 Type & | GetType () 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... | |
![]() | |
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 Member * | GetOwner () const |
std::string | GetQualifiedName () const |
Returns the namespace qualified name of this member. More... | |
Protected Member Functions | |
virtual Data | get (Data &source) const =0 |
This function should return the value of this member. More... | |
virtual void | set (Data &source, Data &value) const =0 |
This function should perform set operation. More... | |
virtual void | typecheck (const Type *type) const =0 |
Type checks the parent. More... | |
![]() | |
virtual void | SetParent (const Member &parent) |
Changes the parent of the member. More... | |
Protected Attributes | |
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 Type * | type |
Type of the datamember. More... | |
![]() | |
std::string | help |
Help string of the datamember. More... | |
std::string | name |
The name of the datamember. More... | |
const Member * | parent |
This class represents an instance data member.
InstanceMember | ( | const std::string & | name, |
const std::string & | help, | ||
const Type & | type, | ||
bool | constant = false , |
||
bool | ref = false , |
||
bool | readonly = false |
||
) |
Constructor.
|
virtual |
Gets data from the datamember.
References ASSERT, InstanceMember::constant, InstanceMember::get(), Data::IsReference(), Data::MakeConstant(), Member::name, and InstanceMember::reference.
This function should return the value of this member.
Implemented in MappedROInstanceMember_Function, and MappedROInstanceMember< C_, T_ >.
const Type& GetType | ( | ) | const |
Returns the type of this data member.
References InstanceMember::type.
bool IsConstant | ( | ) | const |
Returns whether this member is a constant.
References InstanceMember::constant.
|
finaloverridevirtual |
Returns if this member is an instance member.
Implements Member.
bool IsReadonly | ( | ) | const |
Returns whether this member is read-only.
Read-only members cannot be assigned to, however, their state can be altered using its data members or functions.
References InstanceMember::readonly.
bool IsReference | ( | ) | const |
Returns whether this member is a reference.
References InstanceMember::reference.
Sets the data of the data member, if the source is a reference, this function should perform in place replacement of the value.
References Member::name, InstanceMember::readonly, and InstanceMember::set().
This function should perform set operation.
Implemented in MappedInstanceMember_Function, MappedROInstanceMember_Function, MappedInstanceMember< C_, T_ >, and MappedROInstanceMember< C_, T_ >.
|
protectedpure virtual |
Type checks the parent.
Implemented in MappedROInstanceMember_Function, and MappedROInstanceMember< C_, T_ >.
|
protected |
This instance member is a constant.
|
protected |
Marks this instance as read-only.
|
protected |
This instance member is a reference.