![]() |
Gorgon Game Engine
|
Namespace contains other static members as members. More...
Public Member Functions | |
Namespace (const std::string &name, const std::string &help) | |
virtual void | AddMember (StaticMember &member) |
Adds a new member to this namespace. More... | |
virtual void | AddMember (StaticMember *member) |
Adds a new member to this namespace. More... | |
virtual void | AddMembers (std::initializer_list< StaticMember * > newmembers) |
Adds a list of members to this namespace. More... | |
virtual void | AddMembers (std::vector< StaticMember * > newmembers) |
Adds a list of members to this namespace. More... | |
virtual Data | Get () const override |
Returns the value of this static member. More... | |
const Scripting::Function & | GetFunction (const std::string &name) const |
Convenience function, returns the function with the given name. More... | |
virtual MemberType | GetMemberType () const override |
Returns the type of this member. More... | |
const Namespace & | GetNamespace (const std::string &name) const |
Convenience function, returns the namespace with the given name. More... | |
const Type & | GetType (const std::string &name) const |
Convenience function, returns the type with the given name. More... | |
Data | ValueOf (const std::string &name) const |
Convenience function, returns the value of the symbol with the given name. More... | |
![]() | |
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... | |
![]() | |
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... | |
Public Attributes | |
const StaticMemberList & | Members |
List of static members. More... | |
Protected Attributes | |
StaticMemberList | members |
![]() | |
std::string | help |
Help string of the datamember. More... | |
std::string | name |
The name of the datamember. More... | |
const Member * | parent |
Additional Inherited Members | |
![]() | |
enum | MemberType { RegularType, EventType, EnumType, Namespace, DataMember, Function, Constant } |
Possible member types. More... | |
![]() | |
virtual void | SetParent (const Member &parent) |
Changes the parent of the member. More... | |
Namespace contains other static members as members.
All types and library are also namespaces themselves.
Namespace | ( | const std::string & | name, |
const std::string & | help | ||
) |
|
virtual |
Adds a new member to this namespace.
Reimplemented in Type.
References Hashmap< K_, T_, KeyFn, M_, C_ >::Add(), ASSERT, Hashmap< K_, T_, KeyFn, M_, C_ >::Find(), Member::GetName(), Namespace::members, and Member::SetParent().
|
virtual |
Adds a new member to this namespace.
Reimplemented in Type.
References Hashmap< K_, T_, KeyFn, M_, C_ >::Add(), ASSERT, Hashmap< K_, T_, KeyFn, M_, C_ >::Find(), Member::GetName(), Namespace::members, and Member::SetParent().
|
virtual |
Adds a list of members to this namespace.
Reimplemented in Type.
References Hashmap< K_, T_, KeyFn, M_, C_ >::Add(), ASSERT, Hashmap< K_, T_, KeyFn, M_, C_ >::Find(), and Namespace::members.
|
virtual |
Adds a list of members to this namespace.
Reimplemented in Type.
References Hashmap< K_, T_, KeyFn, M_, C_ >::Add(), ASSERT, Hashmap< K_, T_, KeyFn, M_, C_ >::Find(), and Namespace::members.
|
overridevirtual |
Returns the value of this static member.
For types and functions, this function returns type and function objects.
Implements StaticMember.
Reimplemented in EnumType, EventType, and Type.
References Gorgon::Scripting::Types::Namespace().
const Function & GetFunction | ( | const std::string & | name | ) | const |
Convenience function, returns the function with the given name.
If there is no such function, symbol not found error is given.
References Gorgon::Scripting::Types::Function(), StaticMember::Function, and Member::name.
|
overridevirtual |
Returns the type of this member.
Implements StaticMember.
Reimplemented in EnumType, EventType, and Type.
References StaticMember::DataMember.
const Namespace & GetNamespace | ( | const std::string & | name | ) | const |
Convenience function, returns the namespace with the given name.
Types are also considered as namespaces as they are derived from it. If there is no such namespace, symbol not found error is given.
References Member::name, and StaticMember::Namespace.
const Type & GetType | ( | const std::string & | name | ) | const |
Convenience function, returns the type with the given name.
If there is no such type, symbol not found error is given. Any class that is derived from type is also valid.
References Member::name.
Data ValueOf | ( | const std::string & | name | ) | const |
Convenience function, returns the value of the symbol with the given name.
References Hashmap< K_, T_, KeyFn, M_, C_ >::Find(), Namespace::members, and Member::name.
const StaticMemberList& Members |
List of static members.
|
protected |