Gorgon Game Engine
RuntimeOverload Class Reference
Inheritance diagram for RuntimeOverload:
[legend]

Public Member Functions

 RuntimeOverload (Scope &parent, const Type *returntype, ParameterList parameters, bool stretchlast, bool repeatlast, bool accessible, bool constant, bool returnsref, bool returnsconst, bool implicit)
 
virtual Data Call (bool ismethod, const std::vector< Data > &parameters) const override
 Class the stub for this function. More...
 
ScopeGetParentScope ()
 
std::shared_ptr< ScopeInstanceInstantiate (ScopeInstance &current) const
 
void SaveInstruction (Instruction inst, long pline)
 
void SaveInstructions (const std::vector< Instruction > &instructions)
 
- Public Member Functions inherited from Function::Overload
 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 FunctionGetParent () const
 Returns the function this variant belongs. More...
 
const TypeGetReturnType () 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...
 

Protected Member Functions

virtual void dochecks (bool ismethod) override
 This function should perform validity checks on the variant. More...
 

Additional Inherited Members

- Public Attributes inherited from Function::Overload
const ParameterListParameters
 The parameters of this overload. More...
 
- Protected Attributes inherited from Function::Overload
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...
 
Functionparent
 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 Typereturntype
 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...
 

Constructor & Destructor Documentation

◆ RuntimeOverload()

RuntimeOverload ( Scope parent,
const Type returntype,
ParameterList  parameters,
bool  stretchlast,
bool  repeatlast,
bool  accessible,
bool  constant,
bool  returnsref,
bool  returnsconst,
bool  implicit 
)

Member Function Documentation

◆ Call()

virtual Data Call ( bool  ismethod,
const std::vector< Data > &  parameters 
) const
overridevirtual

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 Gorgon::Scripting::ArrayType(), ASSERT, VirtualMachine::Get(), Data::GetType(), Data::GetValue(), RuntimeOverload::Instantiate(), Data::Invalid(), Function::IsMember(), Data::IsReference(), Data::MakeConstant(), Gorgon::Utils::NotImplemented(), Function::Overload::parameters, Function::Overload::parent, Array::PushData(), Function::Overload::repeatlast, Function::Overload::returnsconst, Function::Overload::returnsref, Function::Overload::returntype, and Scope::SetVariable().

◆ dochecks()

virtual void dochecks ( bool  ismethod)
overrideprotectedvirtual

This function should perform validity checks on the variant.

The base function should be called unless similar checks are repeated

Reimplemented from Function::Overload.

References Member::GetName(), Function::Overload::parent, and Scope::SetName().

◆ GetParentScope()

Scope& GetParentScope ( )

References Scope::GetParent().

◆ Instantiate()

std::shared_ptr<ScopeInstance> Instantiate ( ScopeInstance current) const

References Scope::Instantiate().

◆ SaveInstruction()

void SaveInstruction ( Instruction  inst,
long  pline 
)

◆ SaveInstructions()

void SaveInstructions ( const std::vector< Instruction > &  instructions)

The documentation for this class was generated from the following file: