예제 #1
0
 private void BuildMethodReferences()
 {
     descendRef   = MethodRef(typeof(IQuery), "descend", new[] { typeof(string) });
     constrainRef = MethodRef(typeof(IQuery), "constrain", new[]
     {
         typeof(object)
     });
     greaterRef    = MethodRef(typeof(IConstraint), "greater", new Type[] {});
     smallerRef    = MethodRef(typeof(IConstraint), "smaller", new Type[] {});
     containsRef   = MethodRef(typeof(IConstraint), "contains", new Type[] {});
     startsWithRef = MethodRef(typeof(IConstraint), "startsWith", new[]
     {
         typeof(
             bool)
     });
     endsWithRef = MethodRef(typeof(IConstraint), "endsWith", new[]
     {
         typeof(bool
                )
     });
     notRef = MethodRef(typeof(IConstraint), "not", new Type[] {});
     andRef = MethodRef(typeof(IConstraint), "and", new[] { typeof(IConstraint) }
                        );
     orRef       = MethodRef(typeof(IConstraint), "or", new[] { typeof(IConstraint) });
     identityRef = MethodRef(typeof(IConstraint), "identity", new Type[] {});
 }
예제 #2
0
		public MethodCallValue(IMethodRef method, Db4objects.Db4o.Instrumentation.Api.CallingConvention
			 callingConvention, IComparisonOperandAnchor parent, IComparisonOperand[] args) : 
			base(parent)
		{
			_method = method;
			_args = args;
			_callingConvention = callingConvention;
		}
예제 #3
0
 public MethodCallValue(IMethodRef method, CallingConvention
     callingConvention, IComparisonOperandAnchor parent, IComparisonOperand[] args) :
         base(parent)
 {
     _method = method;
     _args = args;
     _callingConvention = callingConvention;
 }
예제 #4
0
 public MethodCallValue(IMethodRef method, Db4objects.Db4o.Instrumentation.Api.CallingConvention
                        callingConvention, IComparisonOperandAnchor parent, IComparisonOperand[] args) :
     base(parent)
 {
     _method            = method;
     _args              = args;
     _callingConvention = callingConvention;
 }
예제 #5
0
 public MethodCallValue(IMethodRef method, CallingConvention
                        callingConvention, IComparisonOperandAnchor parent, IComparisonOperand[] args) :
     base(parent)
 {
     _method            = method;
     _args              = args;
     _callingConvention = callingConvention;
 }
예제 #6
0
        public override bool Equals(object obj)
        {
            if (!(obj is IMethodRef))
            {
                return(false);
            }
            IMethodRef other = (IMethodRef)obj;

            return(Name.Equals(other.Name) && Check.ObjectsAreEqual(DeclaringType, other.DeclaringType
                                                                    ) && Check.ObjectsAreEqual(ReturnType, other.ReturnType) && Check.ArraysAreEqual
                       (ParamTypes, other.ParamTypes));
        }
        public virtual void Visit(MethodCallValue operand)
        {
            IMethodRef method  = operand.Method;
            ITypeRef   retType = method.ReturnType;
            // FIXME: this should be handled within conversions
            bool needConversion = retType.IsPrimitive;

            operand.Parent().Accept(this);
            bool oldInArithmetic = _inArithmetic;

            for (int paramIdx = 0; paramIdx < operand.Args.Length; paramIdx++)
            {
                _inArithmetic = operand.Method.ParamTypes[paramIdx].IsPrimitive;
                operand.Args[paramIdx].Accept(this);
            }
            _inArithmetic = oldInArithmetic;
            _methodBuilder.Invoke(method, operand.CallingConvention);
            Box(retType, !_inArithmetic && needConversion);
        }
예제 #8
0
 public void Invoke(IMethodRef method, CallingConvention convention)
 {
     _il.Emit(OpCodeForConvention(convention), CecilMethodRef.GetReference(method));
 }
		public MethodInfo Resolve(IMethodRef methodRef)
		{
			throw new NotImplementedException();
		}
예제 #10
0
 private void Invoke(IMethodRef method)
 {
     _builder.Invoke(method, CallingConvention.Interface);
 }
 public MethodInfo Resolve(IMethodRef methodRef)
 {
     throw new NotImplementedException();
 }
예제 #12
0
		private void BuildMethodReferences()
		{
			descendRef = MethodRef(typeof(IQuery), "descend", new Type[] { typeof(string) });
			constrainRef = MethodRef(typeof(IQuery), "constrain", new Type[] { typeof(object)
				 });
			greaterRef = MethodRef(typeof(IConstraint), "greater", new Type[] {  });
			smallerRef = MethodRef(typeof(IConstraint), "smaller", new Type[] {  });
			containsRef = MethodRef(typeof(IConstraint), "contains", new Type[] {  });
			startsWithRef = MethodRef(typeof(IConstraint), "startsWith", new Type[] { typeof(
				bool) });
			endsWithRef = MethodRef(typeof(IConstraint), "endsWith", new Type[] { typeof(bool
				) });
			notRef = MethodRef(typeof(IConstraint), "not", new Type[] {  });
			andRef = MethodRef(typeof(IConstraint), "and", new Type[] { typeof(IConstraint) }
				);
			orRef = MethodRef(typeof(IConstraint), "or", new Type[] { typeof(IConstraint) });
			identityRef = MethodRef(typeof(IConstraint), "identity", new Type[] {  });
		}
예제 #13
0
		private void Invoke(IMethodRef method)
		{
			_builder.Invoke(method, CallingConvention.Interface);
		}
예제 #14
0
 public void Invoke(IMethodRef method, CallingConvention convention)
 {
     _il.Emit(OpCodeForConvention(convention), CecilMethodRef.GetReference(method));
 }