std::Type class
Instances of the Type class represent types (classes or interfaces). They are primarily used for constructing objects (class instances) and for testing the type of objects. The Type constructor cannot be used to build new classes. New types can only be defined using the class and interface constructs.
See also: reflection::TypeOf allows querying the class of arbitrary objects.
Methods
- members()
- Return an array of all defined public member names for the type. The order of the names is arbitrary. The array includes both members defined directly in the type and any inherited members. Not implemented yet
- supertype()
- Return the supertype of the type, or nil if the type has no supertype.
Operations
Type objects support the following operations:
- type(...)
- Construct an instance of the type by calling the type object. This
operation is only valid for type objects that represent classes. The
arguments are passed to the create method of the class.
Note: Some primitive types do not support directly calling the type object. Instances of these classes must be constructed using other means, such as by using the to operator for creating Range objects.
- x is type
- Return a boolean indicating whether x is an instance of type or a subtype of type. If x is nil, return False.
- Str(type)
- Return a string containing the fully qualified name of the type.