public override Object GetValueDirect(TypedReference obj)
 {
     throw new NotImplementedException();
 }
Esempio n. 2
1
 private static void Method1(TypedReference param1, object obj)
 {
 }
        // TODO: Replace with FieldInfo.SetValueDirect when available and functional
        internal static void SetValueDirect(this FieldInfo field, TypedReference obj, object value) // TODO: Replace with FieldInfo.SetValueDirect when available
        {
            if (field == null)
            {
                throw new NullReferenceException();
            }
            if (obj == null)
            {
                throw new ArgumentNullException(nameof(obj));
            }

            // This is extremely inefficient, but without runtime support, we can't do much better.

            object[] values = new object[obj._fields.Length + 1];

            values[0] = obj._target;
            for (int i = 0; i < obj._fields.Length; i++)
            {
                values[i + 1] = obj._fields[i].GetValue(values[i]);
            }

            field.SetValue(values[values.Length - 1], value);

            for (int i = values.Length - 2; i >= 0; i--)
            {
                obj._fields[i].SetValue(values[i], values[i + 1]);
            }
        }
Esempio n. 4
0
 static public void Check(TypedReference r, Object v) {
     if (!v.Equals(TypedReference.ToObject(r))) {
         Console.WriteLine("Expected: " + v);
         Console.WriteLine("Actual: " + TypedReference.ToObject(r));
         Environment.Exit(1);
     }
  }
Esempio n. 5
0
 static void M(ref TypedReference a)
 {
 }
Esempio n. 6
0
 private static double test_6_0(double num, TypedReference tr_init)
 {
     return(__refvalue(tr_init, AA).q);
 }
Esempio n. 7
0
 protected abstract object UncheckedGetFieldDirectFromValueType(TypedReference typedReference);
Esempio n. 8
0
 private static byte test_6_0(byte num, TypedReference tr_init)
 {
     return __refvalue(tr_init, AA).q;
 }
 public static RuntimeTypeHandle TargetTypeToken(TypedReference value)
 {
 }
        internal static ObjectHandleOnStack GetObjectHandleOnStack <T>(ref T o) where T : class
        {
            TypedReference reference = __makeref(o);

            return(new ObjectHandleOnStack(reference.GetPointerOnStack()));
        }
Esempio n. 11
0
 private static void Test(TypedReference arg, String result)
 {
 }
Esempio n. 12
0
 private static extern void _Exchange(TypedReference location1, TypedReference value);
Esempio n. 13
0
 private static extern void _CompareExchange(TypedReference location1, TypedReference value, Object comparand);
Esempio n. 14
0
 public void FieldTypedReferenceValueType()
 {
     TypedReference reference = __makeref(field);
     ref Guid       g         = ref reference.AsRef <Guid>();
Esempio n. 15
0
 private static long test_6_0(long num, TypedReference tr_init)
 {
     return(__refvalue(tr_init, AA).q);
 }
	private static void AcceptTypedRef(TypedReference tr)
	{
		Console.WriteLine("Value is: " + __refvalue(tr, object).ToString());
		Console.WriteLine("Type is: " + __reftype(tr).Name);
		__refvalue(tr, object) = 1;
	}
Esempio n. 17
0
 private static int test_6_0(int num, TypedReference tr_init)
 {
     return __refvalue(tr_init, AA).q.val;
 }
        internal static StackCrawlMarkHandle GetStackCrawlMarkHandle(ref StackCrawlMark stackMark)
        {
            TypedReference reference = __makeref(stackMark);

            return(new StackCrawlMarkHandle(reference.GetPointerOnStack()));
        }
 public static Type GetTargetType(TypedReference value)
 {
 }
        internal static StringHandleOnStack GetStringHandleOnStack(ref string s)
        {
            TypedReference reference = __makeref(s);

            return(new StringHandleOnStack(reference.GetPointerOnStack()));
        }
		public virtual object GetValueDirect (TypedReference obj)
		{
			throw new NotImplementedException ();
		}
 protected sealed override object UncheckedGetFieldDirectFromValueType(TypedReference typedReference)
 {
     return(RuntimeAugments.LoadValueTypeFieldValueFromValueType(typedReference, this.Offset, this.FieldTypeHandle));
 }
Esempio n. 23
0
 private static double test_6_0(double num, TypedReference tr_init)
 {
     return __refvalue(tr_init, AA).q;
 }
 protected sealed override void UncheckedSetFieldDirectIntoValueType(TypedReference typedReference, object value)
 {
     RuntimeAugments.StoreValueTypeFieldValueIntoValueType(typedReference, this.Offset, value, this.FieldTypeHandle);
 }
 public override void SetValueDirect(TypedReference obj, Object value)
 {
     throw new NotImplementedException();
 }
Esempio n. 26
0
 public Pointer(TypedReference reference)
 {
     ptr = (void *)reference.ToPointer();
 }
Esempio n. 27
0
        static void Main(string[] args)
        {
            var request = new SetServos()
            {
                s0 = 90,
                s1 = 90,
                s2 = 90,
                s3 = 90,
            };

            while (true)
            {
                try
                {
                    Console.WriteLine($"ServoID => value");

                    var servoId = Console.ReadLine();
                    if (servoId == "")
                    {
                        break;
                    }

                    var servoValue = Console.ReadLine();
                    if (servoValue == "")
                    {
                        break;
                    }

                    var port = new SerialPort();
                    port.PortName  = "COM3";
                    port.BaudRate  = 115200;// 9600;
                    port.Parity    = Parity.None;
                    port.DataBits  = 8;
                    port.StopBits  = StopBits.Two;
                    port.Handshake = Handshake.None;

                    var data = new byte[]
                    {
                        byte.Parse(servoId),
                        byte.Parse(servoValue),
                    };

                    var            prop = request.GetType().GetField($"s{data[0]}");
                    TypedReference tr   = __makeref(request);
                    prop.SetValueDirect(tr, data[1]);

                    var payload = QuokkaJson.SerializeObject(new[] { request });
                    var bytes   = Encoding.ASCII.GetBytes(payload);
                    port.Open();
                    port.Write(bytes, 0, bytes.Length);

                    Console.WriteLine("Waiting for response ...");

                    var buff     = new byte[10];
                    var received = port.Read(buff, 0, 2);

                    foreach (var resp in buff.Take(received))
                    {
                        Console.WriteLine($"Got {resp}");
                    }

                    port.Close();
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                }
            }
        }
Esempio n. 28
0
 public static IntPtr GetStructAddress(TypedReference typedRef)
 {
     return(Pointer.UnBox(typedRef));
 }
Esempio n. 29
0
 public static int _MakeRef(TypedReference a)
 {
     return(__refvalue(a, int?) ?? 314159);
 }
Esempio n. 30
0
        public static void MakeTypedRef(object o)
        {
            TypedReference tr = __makeref(o);

            UndocumentedExpressions.AcceptTypedRef(tr);
        }
Esempio n. 31
0
	static void M (ref TypedReference a)
	{
	}
Esempio n. 32
0
 private static void AcceptTypedRef(TypedReference tr)
 {
     Console.WriteLine("Value is: " + __refvalue(tr, object).ToString());
     Console.WriteLine("Type is: " + __reftype(tr).Name);
     __refvalue(tr, object) = 1;
 }
Esempio n. 33
0
		public virtual void SetValueDirect (TypedReference obj, object value)
		{
			throw new NotSupportedException(Environment.GetResourceString("NotSupported_AbstractNonCLS"));
		}
Esempio n. 34
0
 public void TestPrimitives1(bool bo, byte b, char c, short s, int i, long l, IntPtr ip, sbyte sb, ushort us, uint ui, ulong ul, UIntPtr uip, float fl, double db, object o, string str, TypedReference tr) => throw null !;
 public static void SetTypedReference(TypedReference target, object value)
 {
 }
Esempio n. 36
0
 public override object GetValue(TypedReference typedRef)
 {
     return(Value);
 }
 public static object ToObject(TypedReference value)
 {
 }
Esempio n. 38
0
 public override void SetValue(TypedReference typedRef, object value)
 {
     Value = (TValue)value;
 }
Esempio n. 39
0
 public static double[,][] Static1(TypedReference param1)
 {
     object[,,][,,,][][,,,] local2 = (new object[((uint)(30.0f)), 99u, 71u]
         [,,,][][,,,]);
     return (new double[((uint)(90.0f)), ((uint)(((byte)((0.0f)))))][]);
 }
Esempio n. 40
0
 public static TResult PassReference <TArg, TResult>(TypedReference tref, RefDelegate <TArg, TResult> del)
 {
     return(ReferenceBuilder <TArg, TResult> .PassRef(tref, del));
 }
Esempio n. 41
0
 private static short test_6_0(short num, TypedReference tr_init)
 {
     return __refvalue(tr_init, AA).q;
 }
Esempio n. 42
0
 public static void PassReference <TArg>(TypedReference tref, RefDelegate <TArg> del)
 {
     ReferenceBuilder <TArg> .PassRef(tref, del);
 }
		public virtual void SetValueDirect (TypedReference obj, object value)
		{
			throw new NotImplementedException ();
		}
Esempio n. 44
0
 public static TResult PassReference <TArg, TResult>(TypedReference tref, OutDelegate <TArg, TResult> del)
 {
     return(PassReference <TArg, TResult>(tref, delegate(ref TArg arg) { return del(out arg); }));
 }
Esempio n. 45
0
 private static long test_6_0(long num, TypedReference tr_init)
 {
     return __refvalue(tr_init, AA).q;
 }
Esempio n. 46
0
 public static void PassReference <TArg>(TypedReference tref, OutDelegate <TArg> del)
 {
     PassReference <TArg>(tref, delegate(ref TArg arg) { del(out arg); });
 }
Esempio n. 47
0
 private static float test_6_0(float num, TypedReference tr_init)
 {
     return __refvalue(tr_init, AA).q;
 }
Esempio n. 48
0
 internal static void SerializationSetValueDirect(FieldInfo fi, TypedReference target, Object value)
 {
     BCLDebug.Assert(fi is RuntimeFieldInfo, "[SerializationSetValue]fi is RuntimeFieldInfo.  Contact JRoxe if you see this assert.");
     ((RuntimeFieldInfo)fi).SetValueDirectImpl(target, value, false);
 }