C# Класс IronRuby.Builtins.RubyClass

Наследование: RubyModule, IDuplicable
Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание
AddAsDependencyOf void
AddMethodsOverwriteExisting bool
BuildDelegateConstructorCall void
BuildOverriddenInitializerCall void
CacheFailure void
ClassInheritedEvent void
CreateDummySingleton RubyClass
Duplicate RubyClass
ForEachAncestor bool
GetAllocatorNewExpression System.Linq.Expressions.Expression
GetClrExtensionMethods IEnumerable
GetClrVectorFactories OverloadInfo[]
GetConstructor System.Reflection.ConstructorInfo
GetConstructors OverloadInfo[]
GetDeclaredClrMethods IEnumerable
GetDeclaredClrMethods System.Reflection.MemberInfo[]
GetDummySingletonClass RubyClass
GetSuperClass RubyClass
GetVisibleMethodCount int
IDuplicable object
InitializeDependencies void
InitializeDummySingleton void
InvalidateGroupsInSubClasses int
IsFailureCached bool
IsVisible bool
IsVisible bool
IsWriteable bool
MakeGroup IronRuby.Runtime.Calls.RubyMethodGroupInfo
MakeGroup IronRuby.Runtime.Calls.RubyOverloadGroupInfo
MarkNewException System.Linq.Expressions.Expression
MethodRemoved void
MethodUndefined void
MixinsUpdated void
PrepareExtensionMethodsUpdate void
PrepareMethodUpdate void
PrepareMethodUpdate void
ResolveMethodMissingForSite IronRuby.Runtime.Calls.RubyMemberInfo
ResolveOverriddenMethod IronRuby.Runtime.Calls.RubyMemberInfo
RubyClass System.Linq.Expressions
SetGlobalScope void
TryGetClrEvent bool
TryGetClrEvent bool
TryGetClrField bool
TryGetClrField bool
TryGetClrMember bool
TryGetClrMethod bool
TryGetClrProperty bool

Открытые методы

Метод Описание
BuildAllocatorCall ( MetaObjectBuilder metaBuilder, CallArguments args, Func defaultExceptionMessage ) : bool
BuildClrObjectConstruction ( MetaObjectBuilder metaBuilder, CallArguments args, string methodName ) : void

Implements Class#clr_new feature.

BuildObjectAllocation ( MetaObjectBuilder metaBuilder, CallArguments args, string methodName ) : void

Implements Class#allocate feature.

BuildObjectConstruction ( MetaObjectBuilder metaBuilder, CallArguments args, string methodName ) : void

Implements Class#new feature.

BuildObjectConstructionNoFlow ( MetaObjectBuilder metaBuilder, CallArguments args, string methodName ) : void
CreateAnonymousClass ( IronRuby.Runtime.RubyScope scope, BlockParam body, RubyClass self, [ superClass ) : object
GetNonSingletonClass ( ) : RubyClass
GetUnderlyingSystemType ( ) : Type
InitializeClassCopy ( RubyClass rubyClass ) : void
IsException ( ) : bool
IsSubclassOf ( RubyClass super ) : bool

Returns true if this class is equal to super or it is its descendant.

MethodAdded ( string name ) : void
RubyClass ( RubyClass rubyClass ) : System.Linq.Expressions
TryGetClrConstructor ( IronRuby.Runtime.Calls.RubyMemberInfo &method ) : bool
TryGetClrMember ( string name, Type asType, IronRuby.Runtime.Calls.RubyMemberInfo &method ) : bool

Защищенные методы

Метод Описание
EnumerateClrMembers ( Type type ) : IEnumerable
TryGetClrMember ( Type type, string name, bool mapNames, bool unmangleNames, IronRuby.Runtime.Calls.RubyMemberInfo &method ) : bool

Приватные методы

Метод Описание
AddAsDependencyOf ( IList modules ) : void
AddMethodsOverwriteExisting ( Dictionary &methods, IEnumerable newOverloads, IronRuby.Runtime.Calls.RubyOverloadGroupInfo overloadOwners, bool specialNameOnly ) : bool
BuildDelegateConstructorCall ( MetaObjectBuilder metaBuilder, CallArguments args, Type type ) : void
BuildOverriddenInitializerCall ( MetaObjectBuilder metaBuilder, CallArguments args, IronRuby.Runtime.Calls.RubyMemberInfo initializer ) : void
CacheFailure ( Type type, string methodName, bool isStatic, int extensionVersion ) : void
ClassInheritedEvent ( RubyClass subClass ) : void
CreateDummySingleton ( ) : RubyClass
Duplicate ( object singletonClassOf ) : RubyClass

Duplicates this class object. When duplicating singleton class a new "singletonClassOf" reference needs to be provided. NOT thread safe.

ForEachAncestor ( bool>.Func action ) : bool
GetAllocatorNewExpression ( CallArguments args, Func defaultExceptionMessage ) : Expression
GetClrExtensionMethods ( Type type, string name ) : IEnumerable
GetClrVectorFactories ( ) : OverloadInfo[]
GetConstructor ( Type type ) : ConstructorInfo
GetConstructors ( Type type ) : OverloadInfo[]
GetDeclaredClrMethods ( Type type, BindingFlags bindingFlags, string prefix, string name, string altName, bool specialNameOnly ) : IEnumerable
GetDeclaredClrMethods ( Type type, BindingFlags bindingFlags, string name ) : System.Reflection.MemberInfo[]
GetDummySingletonClass ( ) : RubyClass
GetSuperClass ( ) : RubyClass
GetVisibleMethodCount ( IEnumerable members, bool specialNameOnly ) : int
IDuplicable ( RubyContext context, bool copySingletonMembers ) : object
InitializeDependencies ( ) : void
InitializeDummySingleton ( ) : void
InvalidateGroupsInSubClasses ( string methodName, int maxLevel ) : int
IsFailureCached ( Type type, string methodName, bool isStatic, int extensionVersion ) : bool
IsVisible ( FieldInfo field ) : bool
IsVisible ( MethodAttributes attributes, Type declaringType, bool specialNameOnly ) : bool
IsWriteable ( FieldInfo field ) : bool
MakeGroup ( IEnumerable members, int visibleMemberCount, bool specialNameOnly, bool isDetached ) : RubyMethodGroupInfo
MakeGroup ( ICollection allMethods ) : IronRuby.Runtime.Calls.RubyOverloadGroupInfo
MarkNewException ( Expression expression ) : Expression
MethodRemoved ( string name ) : void
MethodUndefined ( string name ) : void
MixinsUpdated ( RubyModule oldMixins, RubyModule newMixins ) : void
PrepareExtensionMethodsUpdate ( List extensions ) : void

Invalidates - failure cache on RubyClass via incrementing extension version - groups - call sites via incrementing method version

PrepareMethodUpdate ( string methodName, IronRuby.Runtime.Calls.RubyMemberInfo method ) : void
PrepareMethodUpdate ( string methodName, IronRuby.Runtime.Calls.RubyMemberInfo method, int mixinsToSkip ) : void
ResolveMethodMissingForSite ( string name, RubyMethodVisibility incompatibleVisibility ) : IronRuby.Runtime.Calls.RubyMemberInfo
ResolveOverriddenMethod ( string name, int modulesToSkip ) : IronRuby.Runtime.Calls.RubyMemberInfo
RubyClass ( RubyContext context, string name, Type type, object singletonClassOf, Action methodsInitializer, Action constantsInitializer, Delegate factories, RubyClass superClass, RubyModule expandedMixins, TypeTracker tracker, RubyStruct structInfo, bool isRubyClass, bool isSingletonClass, ModuleRestrictions restrictions ) : System.Linq.Expressions
SetGlobalScope ( RubyGlobalScope value ) : void
TryGetClrEvent ( Type type, BindingFlags bindingFlags, string name, IronRuby.Runtime.Calls.RubyMemberInfo &method ) : bool
TryGetClrEvent ( Type type, BindingFlags bindingFlags, string name, string altName, IronRuby.Runtime.Calls.RubyMemberInfo &method ) : bool
TryGetClrField ( Type type, BindingFlags bindingFlags, bool isWrite, string name, IronRuby.Runtime.Calls.RubyMemberInfo &method ) : bool
TryGetClrField ( Type type, BindingFlags bindingFlags, bool isWrite, string name, string altName, IronRuby.Runtime.Calls.RubyMemberInfo &method ) : bool
TryGetClrMember ( Type type, string name, bool mapNames, bool unmangleNames, BindingFlags basicBindingFlags, IronRuby.Runtime.Calls.RubyMemberInfo &method ) : bool

Returns a fresh instance of RubyMemberInfo each time it is called. The caller needs to cache it if appropriate. May add or use method groups to/from super-clases if BindingFlags.DeclaredOnly is used.

TryGetClrMethod ( Type type, BindingFlags bindingFlags, bool specialNameOnly, string name, string clrNamePrefix, string clrName, string altClrName, IronRuby.Runtime.Calls.RubyMemberInfo &method ) : bool

There are basically 4 cases: 1) CLR method of the given name is not defined in the specified type. Do nothing, the method will be found as we traverse the hierarhy towards the Kernel module. 2) Otherwise 1) There is no RubyMemberInfo of given name present in the (type..Kernel] ancestors. We need to search all types in (type..Object] for CLR method overloads. 2) There is a RubyMemberInfo in a class, say C, in (type..Kernel]. We need to get CLR methods from (type..C) in addition to the members in the type. 1) C.HidesInheritedOverloads == true All overloads of the method we look for are in [type..C). 2) C.HidesInheritedOverloads == false All overloads of the method we look for are in [type..C) and in the RubyMemberInfo.

Doesn't include explicitly implemented interface methods. Including them would allow to call them directly (obj.foo) if the overload resolution succeeds. However, the interface methods are probably implemented explicitly for a reason: 1) There is a conflict in signatures -> the overload resolution would probably fail. 2) The class was designed with an intention to not expose the implementations directly.

TryGetClrProperty ( Type type, BindingFlags bindingFlags, bool isWrite, string name, string clrName, string altClrName, IronRuby.Runtime.Calls.RubyMemberInfo &method ) : bool

Описание методов

BuildAllocatorCall() публичный Метод

public BuildAllocatorCall ( MetaObjectBuilder metaBuilder, CallArguments args, Func defaultExceptionMessage ) : bool
metaBuilder IronRuby.Runtime.Calls.MetaObjectBuilder
args IronRuby.Runtime.Calls.CallArguments
defaultExceptionMessage Func
Результат bool

BuildClrObjectConstruction() публичный Метод

Implements Class#clr_new feature.
public BuildClrObjectConstruction ( MetaObjectBuilder metaBuilder, CallArguments args, string methodName ) : void
metaBuilder IronRuby.Runtime.Calls.MetaObjectBuilder
args IronRuby.Runtime.Calls.CallArguments
methodName string
Результат void

BuildObjectAllocation() публичный Метод

Implements Class#allocate feature.
public BuildObjectAllocation ( MetaObjectBuilder metaBuilder, CallArguments args, string methodName ) : void
metaBuilder IronRuby.Runtime.Calls.MetaObjectBuilder
args IronRuby.Runtime.Calls.CallArguments
methodName string
Результат void

BuildObjectConstruction() публичный Метод

Implements Class#new feature.
public BuildObjectConstruction ( MetaObjectBuilder metaBuilder, CallArguments args, string methodName ) : void
metaBuilder IronRuby.Runtime.Calls.MetaObjectBuilder
args IronRuby.Runtime.Calls.CallArguments
methodName string
Результат void

BuildObjectConstructionNoFlow() публичный Метод

public BuildObjectConstructionNoFlow ( MetaObjectBuilder metaBuilder, CallArguments args, string methodName ) : void
metaBuilder IronRuby.Runtime.Calls.MetaObjectBuilder
args IronRuby.Runtime.Calls.CallArguments
methodName string
Результат void

CreateAnonymousClass() публичный статический Метод

public static CreateAnonymousClass ( IronRuby.Runtime.RubyScope scope, BlockParam body, RubyClass self, [ superClass ) : object
scope IronRuby.Runtime.RubyScope
body IronRuby.Runtime.BlockParam
self RubyClass
superClass [
Результат object

EnumerateClrMembers() защищенный Метод

protected EnumerateClrMembers ( Type type ) : IEnumerable
type System.Type
Результат IEnumerable

GetNonSingletonClass() публичный Метод

public GetNonSingletonClass ( ) : RubyClass
Результат RubyClass

GetUnderlyingSystemType() публичный Метод

public GetUnderlyingSystemType ( ) : Type
Результат System.Type

InitializeClassCopy() публичный Метод

public InitializeClassCopy ( RubyClass rubyClass ) : void
rubyClass RubyClass
Результат void

IsException() публичный Метод

public IsException ( ) : bool
Результат bool

IsSubclassOf() публичный Метод

Returns true if this class is equal to super or it is its descendant.
public IsSubclassOf ( RubyClass super ) : bool
super RubyClass
Результат bool

MethodAdded() публичный Метод

public MethodAdded ( string name ) : void
name string
Результат void

RubyClass() публичный Метод

public RubyClass ( RubyClass rubyClass ) : System.Linq.Expressions
rubyClass RubyClass
Результат System.Linq.Expressions

TryGetClrConstructor() публичный Метод

public TryGetClrConstructor ( IronRuby.Runtime.Calls.RubyMemberInfo &method ) : bool
method IronRuby.Runtime.Calls.RubyMemberInfo
Результат bool

TryGetClrMember() защищенный Метод

protected TryGetClrMember ( Type type, string name, bool mapNames, bool unmangleNames, IronRuby.Runtime.Calls.RubyMemberInfo &method ) : bool
type System.Type
name string
mapNames bool
unmangleNames bool
method IronRuby.Runtime.Calls.RubyMemberInfo
Результат bool

TryGetClrMember() публичный Метод

public TryGetClrMember ( string name, Type asType, IronRuby.Runtime.Calls.RubyMemberInfo &method ) : bool
name string
asType System.Type
method IronRuby.Runtime.Calls.RubyMemberInfo
Результат bool