Exemplo n.º 1
0
        public async Task Anon_1(Event currentMachine_dequeuedEvent)
        {
            FaultTolerantMachine currentMachine         = this;
            PrtTuple <PMachineValue, PMachineValue> arg = ((PEvent <PrtTuple <PMachineValue, PMachineValue> >)currentMachine_dequeuedEvent).PayloadT;
            PMachineValue     TMP_tmp0_1 = null;
            PMachineValue     TMP_tmp1_1 = null;
            PMachineValue     TMP_tmp2_1 = null;
            IEventWithPayload TMP_tmp3_1 = null;
            PMachineValue     TMP_tmp4_1 = null;
            PrtBool           TMP_tmp5_1 = ((PrtBool)false);

            TMP_tmp0_1        = arg.Item1;
            service_1         = TMP_tmp0_1;
            TMP_tmp1_1        = arg.Item2;
            reliableStorage_1 = TMP_tmp1_1;
            TMP_tmp2_1        = ((PMachineValue)((IPrtValue)reliableStorage_1)?.Clone());
            TMP_tmp3_1        = new eQueryState(null);
            TMP_tmp4_1        = currentMachine.self;
            currentMachine.SendEvent(currentMachine, TMP_tmp2_1, (Event)TMP_tmp3_1, TMP_tmp4_1);
            var PGEN_recvEvent = await currentMachine.ReceiveEvent(typeof(eQueryStateResponse));

            switch (PGEN_recvEvent)
            {
            case eQueryStateResponse PGEN_evt: {
                var s = PGEN_evt.PayloadT;
                TMP_tmp5_1 = ((long)s) == ((long)((PrtInt)(long)MyState.State0));
                if (TMP_tmp5_1)
                {
                    currentMachine.GotoState <FaultTolerantMachine.State0>();
                    throw new PUnreachableCodeException();
                }
                else
                {
                    currentMachine.GotoState <FaultTolerantMachine.State1>();
                    throw new PUnreachableCodeException();
                }
            } break;
            }
        }
Exemplo n.º 2
0
 public class ConstructorEvent : PEvent <PrtTuple <PMachineValue, PMachineValue> > { public ConstructorEvent(PrtTuple <PMachineValue, PMachineValue> val) : base(val)
                                                                                     {
                                                                                     }