public IronPythonBuiltinFunctionTarget(IronPythonInterpreter interpreter, ObjectIdentityHandle overload, IronPythonType declType)
 {
     Debug.Assert(interpreter.Remote.TypeIs <MethodBase>(overload));
     _interpreter   = interpreter;
     _overload      = overload;
     _declaringType = declType;
 }
 public IronPythonConstructorFunctionTarget(IronPythonInterpreter interpreter, ObjectIdentityHandle overload, IronPythonType declType) {
     Debug.Assert(interpreter.Remote.TypeIs<MethodBase>(overload));
     _interpreter = interpreter;
     _interpreter.UnloadingDomain += Interpreter_UnloadingDomain;
     _remote = _interpreter.Remote;
     _overload = overload;
     _declaringType = declType;
 }
Beispiel #3
0
        internal IMember MakeObject(ObjectIdentityHandle obj)
        {
            if (obj.IsNull)
            {
                return(null);
            }

            lock (this) {
                IMember res;
                if (_members.TryGetValue(obj, out res))
                {
                    return(res);
                }

                switch (_remote.GetObjectKind(obj))
                {
                case ObjectKind.Module: res = new IronPythonModule(this, obj); break;

                case ObjectKind.Type: res = new IronPythonType(this, obj); break;

                case ObjectKind.ConstructorFunction: res = new IronPythonConstructorFunction(this, _remote.GetConstructorFunctionTargets(obj), GetTypeFromType(_remote.GetConstructorFunctionDeclaringType(obj))); break;

                case ObjectKind.BuiltinFunction: res = new IronPythonBuiltinFunction(this, obj); break;

                case ObjectKind.BuiltinMethodDesc: res = new IronPythonBuiltinMethodDescriptor(this, obj); break;

                case ObjectKind.ReflectedEvent: res = new IronPythonEvent(this, obj); break;

                case ObjectKind.ReflectedExtensionProperty: res = new IronPythonExtensionProperty(this, obj); break;

                case ObjectKind.ReflectedField: res = new IronPythonField(this, obj); break;

                case ObjectKind.ReflectedProperty: res = new IronPythonProperty(this, obj); break;

                case ObjectKind.TypeGroup: res = new IronPythonTypeGroup(this, obj); break;

                case ObjectKind.NamespaceTracker: res = new IronPythonNamespace(this, obj); break;

                case ObjectKind.Constant: res = new IronPythonConstant(this, obj); break;

                case ObjectKind.ClassMethod: res = new IronPythonGenericMember(this, obj, PythonMemberType.Method); break;

                case ObjectKind.Method: res = new IronPythonGenericMember(this, obj, PythonMemberType.Method); break;

                case ObjectKind.PythonTypeSlot: res = new IronPythonGenericMember(this, obj, PythonMemberType.Property); break;

                case ObjectKind.PythonTypeTypeSlot: res = new IronPythonGenericMember(this, obj, PythonMemberType.Property); break;

                case ObjectKind.Unknown: res = new PythonObject(this, obj); break;

                default:
                    throw new InvalidOperationException();
                }
                _members[obj] = res;
                return(res);
            }
        }
 public IronPythonConstructorFunctionTarget(IronPythonInterpreter interpreter, ObjectIdentityHandle overload, IronPythonType declType)
 {
     Debug.Assert(interpreter.Remote.TypeIs <MethodBase>(overload));
     _interpreter = interpreter;
     _interpreter.UnloadingDomain += Interpreter_UnloadingDomain;
     _remote        = _interpreter.Remote;
     _overload      = overload;
     _declaringType = declType;
 }
        internal IPythonType GetTypeFromType(Type type)
        {
            IronPythonType res;

            lock (_types) {
                if (!_types.TryGetValue(type, out res))
                {
                    _types[type] = res = new IronPythonType(this, DynamicHelpers.GetPythonTypeFromType(type));
                }
            }
            return(res);
        }
Beispiel #6
0
        internal IPythonType GetTypeFromType(ObjectIdentityHandle type)
        {
            if (type.IsNull)
            {
                return(null);
            }

            lock (this) {
                IMember res;
                if (!_members.TryGetValue(type, out res))
                {
                    _members[type] = res = new IronPythonType(this, type);
                }
                return(res as IPythonType);
            }
        }
 public IronPythonConstructorFunction(IronPythonInterpreter interpreter, ConstructorInfo[] infos, IronPythonType type)
 {
     _interpreter = interpreter;
     _infos       = infos;
     _type        = type;
 }
 public IronPythonNewClsParameterInfo(IronPythonType declaringType)
 {
     _declaringType = declaringType;
 }
Beispiel #9
0
        internal IMember MakeObject(ObjectIdentityHandle obj) {
            if (obj.IsNull) {
                return null;
            }

            lock (this) {
                IMember res;
                if (_members.TryGetValue(obj, out res)) {
                    return res;
                }

                switch (_remote.GetObjectKind(obj)) {
                    case ObjectKind.Module: res = new IronPythonModule(this, obj); break;
                    case ObjectKind.Type: res = new IronPythonType(this, obj); break;
                    case ObjectKind.BuiltinFunction: res = new IronPythonBuiltinFunction(this, obj); break;
                    case ObjectKind.BuiltinMethodDesc: res = new IronPythonBuiltinMethodDescriptor(this, obj); break;
                    case ObjectKind.ReflectedEvent: res = new IronPythonEvent(this, obj); break;
                    case ObjectKind.ReflectedExtensionProperty: res = new IronPythonExtensionProperty(this, obj); break;
                    case ObjectKind.ReflectedField: res = new IronPythonField(this, obj); break;
                    case ObjectKind.ReflectedProperty: res = new IronPythonProperty(this, obj); break;
                    case ObjectKind.TypeGroup: res = new IronPythonTypeGroup(this, obj); break;
                    case ObjectKind.NamespaceTracker: res = new IronPythonNamespace(this, obj); break;
                    case ObjectKind.Constant: res = new IronPythonConstant(this, obj); break;
                    case ObjectKind.ClassMethod: res = new IronPythonGenericMember(this, obj, PythonMemberType.Method); break;
                    case ObjectKind.Method: res = res = new IronPythonGenericMember(this, obj, PythonMemberType.Method); break;
                    case ObjectKind.PythonTypeSlot: res = new IronPythonGenericMember(this, obj, PythonMemberType.Property); break;
                    case ObjectKind.PythonTypeTypeSlot: res = new IronPythonGenericMember(this, obj, PythonMemberType.Property); break;
                    case ObjectKind.Unknown: res = new PythonObject(this, obj); break;
                    default:
                        throw new InvalidOperationException();
                }
                _members[obj] = res;
                return res;
            }
        }
Beispiel #10
0
        internal IPythonType GetTypeFromType(ObjectIdentityHandle type) {
            if (type.IsNull) {
                return null;
            }

            lock (this) {
                IMember res;
                if (!_members.TryGetValue(type, out res)) {
                    _members[type] = res = new IronPythonType(this, type);
                }
                return res as IPythonType;
            }
        }
 public IronPythonBuiltinFunctionTarget(IronPythonInterpreter interpreter, ObjectIdentityHandle overload, IronPythonType declType) {
     Debug.Assert(interpreter.Remote.TypeIs<MethodBase>(overload));
     _interpreter = interpreter;
     _overload = overload;
     _declaringType = declType;
 }
 public IronPythonNewClsParameterInfo(IronPythonType declaringType) {
     _declaringType = declaringType;
 }