예제 #1
0
        public override bool Equals(object obj)
        {
            if (Object.ReferenceEquals(this, obj))
            {
                return(true);
            }
            CLRFFIFunctionPointer fp = obj as CLRFFIFunctionPointer;

            if (fp == null)
            {
                return(false);
            }

            return(Contains(fp.Name, fp.mArgTypes, fp.mReturnType));
        }
예제 #2
0
        public override FFIFunctionPointer GetFunctionPointer(string className, string name, List <ProtoCore.Type> argTypes, ProtoCore.Type returnType)
        {
            List <FFIFunctionPointer> pointers = GetFunctionPointers(className, name);

            if (null == pointers)
            {
                return(null);
            }

            foreach (var ptr in pointers)
            {
                CLRFFIFunctionPointer clrPtr = ptr as CLRFFIFunctionPointer;
                if (clrPtr.Contains(name, argTypes, returnType))
                {
                    return(clrPtr);
                }
            }

            return(null);
        }
예제 #3
0
        private void RegisterFunctionPointer(string functionName, MemberInfo method, ProtoCore.Type retype)
        {
            List <FFIFunctionPointer> pointers = GetFunctionPointers(functionName);
            FFIFunctionPointer        f        = null;

            if (functionName == ProtoCore.DSDefinitions.Keyword.Dispose)
            {
                f = new DisposeFunctionPointer(Module, method, retype);
            }
            else if (CoreUtils.IsGetter(functionName))
            {
                f = new GetterFunctionPointer(Module, functionName, method, retype);
            }
            else
            {
                f = new CLRFFIFunctionPointer(Module, functionName, method, null, retype);
            }

            if (!pointers.Contains(f))
            {
                pointers.Add(f);
            }
        }
예제 #4
0
        private void RegisterFunctionPointer(string functionName, MemberInfo method, List <ProtoCore.Type> argTypes, ProtoCore.Type retype)
        {
            List <FFIFunctionPointer> pointers = GetFunctionPointers(functionName);
            FFIFunctionPointer        f        = null;

            if (CoreUtils.IsDisposeMethod(functionName))
            {
                f = new DisposeFunctionPointer(Module, method, retype);
            }
            else if (CoreUtils.IsGetter(functionName))
            {
                f = new GetterFunctionPointer(Module, functionName, method, retype);
            }
            else
            {
                f = new CLRFFIFunctionPointer(Module, functionName, method, argTypes, retype);
            }

            if (!pointers.Contains(f))
            {
                pointers.Add(f);
            }
        }
예제 #5
0
        private void RegisterFunctionPointer(string functionName, MemberInfo method, List<ProtoCore.Type> argTypes, ProtoCore.Type retype)
        {
            List<FFIFunctionPointer> pointers = GetFunctionPointers(functionName);
            FFIFunctionPointer f = null;
            if (CoreUtils.IsDisposeMethod(functionName))
                f = new DisposeFunctionPointer(Module, method, retype);
            else if (CoreUtils.IsGetter(functionName))
                f = new GetterFunctionPointer(Module, functionName, method, retype);
            else
                f = new CLRFFIFunctionPointer(Module, functionName, method, argTypes, retype);

            if (!pointers.Contains(f))
                pointers.Add(f);
        }
예제 #6
0
        private void RegisterFunctionPointer(string functionName, MemberInfo method, ProtoCore.Type retype)
        {
            List<FFIFunctionPointer> pointers = GetFunctionPointers(functionName);
            FFIFunctionPointer f = null;
            if (functionName == ProtoCore.DSDefinitions.Keyword.Dispose)
                f = new DisposeFunctionPointer(Module, method, retype);
            else if (CoreUtils.IsGetter(functionName))
                f = new GetterFunctionPointer(Module, functionName, method, retype);
            else
                f = new CLRFFIFunctionPointer(Module, functionName, method, null, retype);

            if (!pointers.Contains(f))
                pointers.Add(f);
        }