![]() |
Gorgon Game Engine
|
This class wraps a C++ function into an overload. It can be constructed using MapFunction. More...
Public Member Functions | |
template<class ... P_> | |
MappedFunction (F_ fn, const Scripting::Type *returntype, Scripting::ParameterList parameters, P_ ...tags) | |
Constructor. More... | |
virtual Data | Call (bool ismethod, const std::vector< Data > ¶meters) const override |
Class the stub for this function. More... | |
![]() | |
Overload (const Type *returntype, ParameterList parameters, bool stretchlast, bool repeatlast, bool accessible, bool constant, bool returnsref, bool returnsconst, bool implicit) | |
A full constructor. More... | |
template<class ... P_> | |
Overload (const Type *returntype, ParameterList parameters, P_ ...tags) | |
Regular constructor that can take as many tags as needed. More... | |
virtual | ~Overload () |
const Function & | GetParent () const |
Returns the function this variant belongs. More... | |
const Type & | GetReturnType () const |
Returns the type this variant returns. More... | |
bool | HasReturnType () const |
Returns whether this variant returns a value. More... | |
bool | IsConstant () const |
Returns whether this function is a constant. More... | |
bool | IsImplicit () const |
Returns if this variant can be used as implicit conversion. More... | |
bool | IsSame (const Overload &var) const |
Compares two variants if they have the same signature. More... | |
bool | RepeatLast () const |
Returns if the last parameter of this function should be repeated. More... | |
bool | ReturnsConst () const |
This function variant returns a constant. More... | |
bool | ReturnsRef () const |
This function variant returns a reference to a value rather than the value itself. More... | |
bool | StretchLast () const |
Returns if the last parameter of this function should be stretched. More... | |
Additional Inherited Members | |
![]() | |
const ParameterList & | Parameters |
The parameters of this overload. More... | |
![]() | |
bool | accessible |
Only meaningful in class member functions. More... | |
bool | constant |
Makes this function constant. Only works on member functions. More... | |
bool | implicit |
If the parent function is constructor, marks this variant as an implicit type conversion. More... | |
ParameterList | parameters |
Modifiable parameters of this overload. More... | |
Function * | parent |
The parent function of this variant. More... | |
bool | repeatlast |
If true last parameter can be specified any number of times. More... | |
bool | returnsconst |
This function variant returns a constant, useful with references. More... | |
bool | returnsref |
This function variant returns a reference. More... | |
const Type * | returntype |
Return type of this function variant. If nullptr this function does not return a value. More... | |
bool | stretchlast |
If true, in console dialect, spaces in the last parameter are not treated as parameter separator as if it is in quotes. More... | |
This class wraps a C++ function into an overload. It can be constructed using MapFunction.
MappedFunction | ( | F_ | fn, |
const Scripting::Type * | returntype, | ||
Scripting::ParameterList | parameters, | ||
P_ ... | tags | ||
) |
Constructor.
Class the stub for this function.
If ismethod parameter is set and method variant exists method variant is called. But if there is no method variant, it simply prints out the return of the function. When ismethod is set, this function will never return a value.
Implements Function::Overload.
References VirtualMachine::Get(), VirtualMachine::GetOutput(), Data::Invalid(), and Function::Overload::parameters.