![]() |
Gorgon Game Engine
|
E_ is an enumeration with defined strings. More...
Public Member Functions | |
MappedStringEnum (const std::string &name, const std::string &help, const std::vector< std::pair< std::string, std::string >> &strings, E_ defval=E_(), bool binary=false) | |
strings parameter should contain, name and help of enum entries. More... | |
MappedStringEnum (const std::string &name, const std::string &help, E_ defval=E_(), bool binary=false) | |
This constructor adds all elements without any help. More... | |
virtual void | Assign (Data &l, const Data &r) const override |
Assigns the value of the second parameter to the first, reference types can ignore this function. More... | |
virtual Data | Parse (const std::string &s) const |
Parses a string into this data. This function is allowed to throw. More... | |
virtual std::string | ToString (const Data &d) const |
Converts a data of this type to string. More... | |
![]() | |
EnumType (const std::string &name, const std::string &help, const std::vector< ElementInitializer > &elements, TMP::RTTH *typeinterface) | |
virtual Data | Get () const override final |
Returns the value of this static member. More... | |
virtual MemberType | GetMemberType () const override |
Returns the type of this member. More... | |
![]() | |
Type (const std::string &name, const std::string &help, const Any &defaultvalue, TMP::RTTH *typeinterface, bool isref) | |
virtual | ~Type () |
Destructor. More... | |
void | AddConstructor (Function::Overload &element) |
Adds the given constructor. More... | |
void | AddConstructors (std::initializer_list< Function::Overload * > elements) |
Adds the given constructors. More... | |
void | AddInheritance (const Type &type, Inheritance::ConversionFunction from, Inheritance::ConversionFunction to) |
Adds an inheritance parent. More... | |
virtual void | AddMember (InstanceMember &member) |
Adds a list of instance members to this type. More... | |
virtual void | AddMember (InstanceMember *member) |
Adds a list of instance members to this type. More... | |
virtual void | AddMember (StaticMember &member) override |
Adds a static member to this type. More... | |
virtual void | AddMember (StaticMember *member) override |
Adds a static member to this type. More... | |
virtual void | AddMembers (std::initializer_list< InstanceMember * > newmembers) |
Adds an instance member to this type. More... | |
virtual void | AddMembers (std::initializer_list< StaticMember * > newmembers) override |
Adds a list of static members to this type. More... | |
virtual void | AddMembers (std::vector< InstanceMember * > newmembers) |
Adds an instance member to this type. More... | |
virtual void | AddMembers (std::vector< StaticMember * > newmembers) override |
Adds a list of static members to this type. More... | |
MorphType | CanMorphTo (const Type &type) const |
Check if it is possible to morph this type to the other. More... | |
bool | Compare (const Data &l, const Data &r) const |
This function compares two instances of this type. Both left and right should of this type. More... | |
Data | Construct (const std::vector< Data > ¶meters) const |
!Unsafe. Constructs a new object from the given parameters. Requires parameters to be the exact type. More... | |
void | Delete (const Data &obj) const |
Deletes the object. More... | |
Any | GetDefaultValue () const |
Returns the value of the type. More... | |
const Function::Overload * | GetTypeCastingFrom (const Type *other, bool implicit=true) const |
This function returns type casting function from a given type to this one. More... | |
bool | IsReferenceType () const |
Returns whether this type is a reference type. More... | |
Data | MorphTo (const Type &type, Data source, bool allowtypecast=true) const |
Morphs the given data into the target type. More... | |
operator const Type * () const | |
Converts this type to its pointer. More... | |
bool | operator!= (const Type &other) const |
Compares two types. More... | |
bool | operator!= (const Type *other) const |
bool | operator== (const Type &other) const |
Compares two types. More... | |
bool | operator== (const Type *other) const |
![]() | |
Namespace (const std::string &name, const std::string &help) | |
const Scripting::Function & | GetFunction (const std::string &name) const |
Convenience function, returns the function with the given name. 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... | |
Protected Member Functions | |
virtual bool | compare (const Data &l, const Data &r) const |
This function should compare two instances of the type. More... | |
virtual void | deleteobject (const Data &obj) const override |
This function should delete the given object. More... | |
![]() | |
EnumType (const std::string &name, const std::string &help, Any defval, TMP::RTTH *typeinterface) | |
void | add (const ElementInitializer &element) |
![]() | |
virtual void | SetParent (const Member &parent) |
Changes the parent of the member. More... | |
Additional Inherited Members | |
![]() | |
enum | MorphType { NotPossible, AlreadMatching, UpCasting, DownCasting, TypeCasting } |
There are multiple ways to morph a type to another, this enumeration holds these types. More... | |
![]() | |
enum | MemberType { RegularType, EventType, EnumType, Namespace, DataMember, Function, Constant } |
Possible member types. More... | |
![]() | |
const std::vector< const Scripting::Constant * > & | Ordered |
Ordered list of allowed values. More... | |
![]() | |
const Scripting::Function & | Constructor |
Constructors of this type. More... | |
const Containers::Hashmap< std::string, const Type, nullptr, std::map, String::CaseInsensitiveLess > & | InheritedSymbols |
Inherited symbols. More... | |
const std::map< const Type *, Inheritance > & | InheritsFrom |
Inheritance list. More... | |
const InstanceMemberList & | InstanceMembers |
const std::map< const Type *, const Type * > & | Parents |
Parents of this type. This includes indirect parents as well. More... | |
TMP::RTTH & | TypeInterface |
Type interface used for this type. More... | |
![]() | |
const StaticMemberList & | Members |
List of static members. More... | |
![]() | |
Scripting::Function | constructor |
Constructors of this type. More... | |
Any | defaultvalue |
Default value of this type. More... | |
Containers::Hashmap< std::string, const Type, nullptr, std::map, String::CaseInsensitiveLess > | inheritedsymbols |
Inherited symbols. More... | |
std::map< const Type *, Inheritance > | inheritsfrom |
Inheritance list. More... | |
InstanceMemberList | instancemembers |
Instance members of this type. More... | |
std::map< const Type *, const Type * > | parents |
This lists all parents of this type in the entire hierarchy. More... | |
bool | referencetype |
Whether this type is a reference type. More... | |
![]() | |
StaticMemberList | members |
![]() | |
std::string | help |
Help string of the datamember. More... | |
std::string | name |
The name of the datamember. More... | |
const Member * | parent |
E_ is an enumeration with defined strings.
MappedStringEnum | ( | const std::string & | name, |
const std::string & | help, | ||
const std::vector< std::pair< std::string, std::string >> & | strings, | ||
E_ | defval = E_() , |
||
bool | binary = false |
||
) |
strings parameter should contain, name and help of enum entries.
Names could be any of the alternative names listed in the enum strings
References Type::AddConstructors(), Type::AddMember(), Type::AddMembers(), Gorgon::Scripting::ConstTag, Gorgon::Scripting::Types::Function(), MAP_COMPARE, and Gorgon::Scripting::MapFunction().
MappedStringEnum | ( | const std::string & | name, |
const std::string & | help, | ||
E_ | defval = E_() , |
||
bool | binary = false |
||
) |
This constructor adds all elements without any help.
Consider using the constructor that enables help text for enum items.
Assigns the value of the second parameter to the first, reference types can ignore this function.
Implements Type.
References Member::GetName(), Data::GetType(), Data::GetValue(), Data::IsConstant(), Data::IsReference(), and Data::ReferenceValue().
This function should compare two instances of the type.
Not required for reference types as pointers will be compared
Reimplemented from Type.
References Data::GetValue().
|
overrideprotectedvirtual |
This function should delete the given object.
Implements Type.
References ASSERT, Data::IsConstant(), Data::IsReference(), and Data::ReferenceValue().
|
virtual |
Parses a string into this data. This function is allowed to throw.
Implements Type.
|
virtual |
Converts a data of this type to string.
This function should never throw, if there is no data to display, recommended this play is either [ EMPTY ], or Typename #id
Implements Type.
References Gorgon::String::From(), and Data::GetValue().