Esempio n. 1
0
        public ReportAddition setAs(ReportAddition value)
        {
            m_Header             = value.m_Header;
            m_AdditionOutputBody = value.m_AdditionOutputBody;

            return(this);
        }
        //	This is the function that will process an event either generated
        //  by the service, sent to it by another service on the same component,
        //  or as a message sent by a different component.
        public override bool processTransitions(InternalEvent ie)
        {
            bool done = false;

            // Since this function can be called from multiple threads,
            // we use a mutex to ensure only one state transition is
            // active at a time.
            mutex.WaitOne();

            // Invoke the FSM transition for this event.
            try
            {
                if (ie.getName().CompareTo("InitToReadyEventDef") == 0 && (ie.getSource().CompareTo("AdditionClientServiceDef_additionClientFSM") != 0) && (!done))
                {
                    InitToReadyEventDef casted_ie = (InitToReadyEventDef)ie;
                    pAdditionClientServiceDef_additionClientFSM.context.InitToReadyEventDefTransition();
                    done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_AdditionClientServiceDef_additionClientFSM_Ready") == 0 && (ie.getSource().CompareTo("AdditionClientServiceDef_additionClientFSM") != 0) && (!done))
                {
                    pAdditionClientServiceDef_additionClientFSM.context.InternalStateChange_To_AdditionClientServiceDef_additionClientFSM_ReadyTransition(ie);
                    done = true;
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("AdditionClientServiceDef_additionClientFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive)ie;
                    int     pos       = 0;
                    ushort  id        = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if (id == new ReportAddition().getID())
                    {
                        ReportAddition msg = new ReportAddition();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        pAdditionClientServiceDef_additionClientFSM.context.ReportAdditionTransition(msg);
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InternalStateChange_To_AdditionClientServiceDef_additionClientFSM_Init") == 0 && (ie.getSource().CompareTo("AdditionClientServiceDef_additionClientFSM") != 0) && (!done))
                {
                    pAdditionClientServiceDef_additionClientFSM.context.InternalStateChange_To_AdditionClientServiceDef_additionClientFSM_InitTransition(ie);
                    done = true;
                }
            } catch (Exception e) {}



            mutex.ReleaseMutex();
            return(done);
        }
Esempio n. 3
0
 public void ReportAdditionTransition(ReportAddition msg)
 {
     transition_ = "ReportAdditionTransition";
     State.ReportAdditionTransition(this, msg);
     transition_ = "";
     return;
 }
Esempio n. 4
0
        public ReportAddition(ReportAddition value)
        {
            /// Initiliaze the protected variables
            m_Header = new Header();
            m_AdditionOutputBody = new AdditionOutputBody();
            m_IsCommand = false;

            /// Copy the values
            m_Header = value.m_Header;
            m_AdditionOutputBody = value.m_AdditionOutputBody;
        }
Esempio n. 5
0
        public ReportAddition(ReportAddition value)
        {
            /// Initiliaze the protected variables
            m_Header             = new Header();
            m_AdditionOutputBody = new AdditionOutputBody();
            m_IsCommand          = false;

            /// Copy the values
            m_Header             = value.m_Header;
            m_AdditionOutputBody = value.m_AdditionOutputBody;
        }
Esempio n. 6
0
        public bool  isEqual(ReportAddition value)
        {
            if (!this.getHeader().isEqual(value.getHeader()))
            {
                return(false);
            }
            if (!this.getAdditionOutputBody().isEqual(value.getAdditionOutputBody()))
            {
                return(false);
            }

            return(true);
        }
        //    This is the function that will check for default transitions if
        //  no other transitions were satisfied.
        //
        public override bool defaultTransitions(InternalEvent ie)
        {
            bool done = false;

               // Since this function can be called from multiple threads,
               // we use a mutex to ensure only one state transition is
               // active at a time.
               mutex.WaitOne();

            // Invoke the FSM transition for this event.
            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("AdditionClientServiceDef_additionClientFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new ReportAddition().getID())
                    {
                        ReportAddition msg = new ReportAddition();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        pAdditionClientServiceDef_additionClientFSM.context.ReportAdditionTransition();
                        done = true;
                    }
                }
            } catch (Exception e) {}

            try
            {
                if (ie.getName().CompareTo("InitToReadyEventDef") == 0 && (ie.getSource().CompareTo("AdditionClientServiceDef_additionClientFSM") != 0) && (!done))
                {
                    InitToReadyEventDef casted_ie = (InitToReadyEventDef) ie;
                        pAdditionClientServiceDef_additionClientFSM.context.InitToReadyEventDefTransition();
                        done = true;
                }
            } catch (Exception e) {}

            mutex.ReleaseMutex();
            return done;
        }
Esempio n. 8
0
 public virtual void printAnswerToScreenAction(ReportAddition msg)
 {
     Console.WriteLine("Transitioned back to Ready");
     Console.WriteLine("  The answer is "
                       + msg.getAdditionOutputBody().getAdditionOutput().getAdditionResult());
 }
Esempio n. 9
0
 protected internal virtual void ReportAdditionTransition(AdditionClientServiceDef_additionClientFSMContext context, ReportAddition msg)
 {
     Default(context);
 }
Esempio n. 10
0
                protected internal override void ReportAdditionTransition(AdditionClientServiceDef_additionClientFSMContext context, ReportAddition msg)
                {
                    AdditionClientServiceDef_additionClientFSM ctxt = context.Owner;


#if TRACE
                    Trace.WriteLine(
                        "TRANSITION   : AdditionClientServiceDef_additionClientFSM_SM.Ready.ReportAdditionTransition(, ReportAddition msg)");
#endif

                    AdditionClientServiceDef_additionClientFSMState endState = context.State;

                    context.ClearState();

                    try
                    {
                        ctxt.printAnswerToScreenAction(msg);
                    }
                    finally
                    {
                        context.State = endState;
                    }

                    return;
                }
Esempio n. 11
0
        public ReportAddition setAs(ReportAddition value)
        {
            m_Header = value.m_Header;
            m_AdditionOutputBody = value.m_AdditionOutputBody;

            return this;
        }
 protected internal virtual void ReportAdditionTransition(AdditionClientServiceDef_additionClientFSMContext context, ReportAddition msg)
 {
     Default(context);
 }
Esempio n. 13
0
 public bool notEquals(ReportAddition value)
 {
     return !this.isEqual(value);
 }
Esempio n. 14
0
        public bool isEqual(ReportAddition value)
        {
            if (!this.getHeader().isEqual(value.getHeader()))
            {
            return false;
            }
            if (!this.getAdditionOutputBody().isEqual(value.getAdditionOutputBody()))
            {
            return false;
            }

            return true;
        }
                protected internal override void ReportAdditionTransition(AdditionClientServiceDef_additionClientFSMContext context, ReportAddition msg)
                {
                    AdditionClientServiceDef_additionClientFSM ctxt = context.Owner;

                    #if TRACE
                    Trace.WriteLine(
                        "TRANSITION   : AdditionClientServiceDef_additionClientFSM_SM.Ready.ReportAdditionTransition(, ReportAddition msg)");
                    #endif

                    AdditionClientServiceDef_additionClientFSMState endState = context.State;

                    context.ClearState();

                    try
                    {
                        ctxt.printAnswerToScreenAction(msg);
                    }
                    finally
                    {
                        context.State = endState;
                    }

                    return;
                }
 public void ReportAdditionTransition(ReportAddition msg)
 {
     transition_ = "ReportAdditionTransition";
     State.ReportAdditionTransition(this, msg);
     transition_ = "";
     return;
 }
Esempio n. 17
0
 public bool  notEquals(ReportAddition value)
 {
     return(!this.isEqual(value));
 }