Detailed Description

This represents a set of methods each with the same name and return type. It's used by classes being compiled to track the methods within them.

Public Member Functions

 MethodOverloads (Type returnType)
 Creates a new method overloads set. All methods must have the same return type. More...
 
void AddMethod (CompiledMethod method)
 Adds a method to this overload set. More...
 
void ParametersOk (CompiledMethod method)
 Makes sure that two overloads don't have the same parameter set. Throws an error if More...
 
MethodInfo GetOverload (Type[] arguments)
 Gets the overload from this set that suits the given arguments. More...
 
void CompileParameters ()
 Compiles the parameter block for all methods in this set. More...
 
void CompileBody ()
 Compiles the body of all methods in this set. More...
 

Public Attributes

Type ReturnType
 The return type of all methods in this set. More...
 
List< CompiledMethodMethods =new List<CompiledMethod>()
 The set of overloaded methods. More...
 

Private Member Functions

bool NewBaseCall (CodeFragment fragment)
 Looks for base.new in the given fragment. More...
 

Constructor & Destructor Documentation

Nitro.MethodOverloads.MethodOverloads ( Type  returnType)
inline

Creates a new method overloads set. All methods must have the same return type.

Parameters
returnTypeThe return type of all methods in this set.

Member Function Documentation

void Nitro.MethodOverloads.AddMethod ( CompiledMethod  method)
inline

Adds a method to this overload set.

Parameters
methodThe method to add.
void Nitro.MethodOverloads.CompileBody ( )
inline

Compiles the body of all methods in this set.

void Nitro.MethodOverloads.CompileParameters ( )
inline

Compiles the parameter block for all methods in this set.

MethodInfo Nitro.MethodOverloads.GetOverload ( Type[]  arguments)
inline

Gets the overload from this set that suits the given arguments.

Parameters
argumentsThe types of the arguments being provided.
bool Nitro.MethodOverloads.NewBaseCall ( CodeFragment  fragment)
inlineprivate

Looks for base.new in the given fragment.

Parameters
fragmentThe code fragment to look in.
Returns
True if base.new is in this fragment.
void Nitro.MethodOverloads.ParametersOk ( CompiledMethod  method)
inline

Makes sure that two overloads don't have the same parameter set. Throws an error if

Parameters
methodThe method to check for matches against existing methods in this set.

Member Data Documentation

List<CompiledMethod> Nitro.MethodOverloads.Methods =new List<CompiledMethod>()

The set of overloaded methods.

Type Nitro.MethodOverloads.ReturnType

The return type of all methods in this set.