Example #1
0
        public BroadcastGlobal(BroadcastGlobal value)
        {
            /// Initiliaze the protected variables
            m_Body = new Body();
            m_Name = "BroadcastGlobal";

            /// Copy the values
            m_Body = value.m_Body;
        }
Example #2
0
        public bool  isEqual(BroadcastGlobal value)
        {
            if (!this.getBody().isEqual(value.getBody()))
            {
                return(false);
            }

            return(true);
        }
Example #3
0
 public bool  notEquals(BroadcastGlobal value)
 {
     return(!this.isEqual(value));
 }
Example #4
0
        public BroadcastGlobal setAs(BroadcastGlobal value)
        {
            m_Body = value.m_Body;

            return(this);
        }
Example #5
0
        //	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 ((!done) && ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("DiscoveryClient_ReceiveFSM") != 0))
                {
                    Receive casted_ie = (Receive)ie;
                    int     pos       = 0;
                    ushort  id        = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if (id == new ReportHeartbeatPulse().getID())
                    {
                        ReportHeartbeatPulse msg = new ReportHeartbeatPulse();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        pDiscoveryClient_ReceiveFSM.context.ReportHeartbeatPulseTransition();
                        done = true;
                    }
                }
            } catch (Exception e) {}

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

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

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

            try
            {
                if ((!done) && ie.getName().CompareTo("RHP_Timeout") == 0 && (ie.getSource().CompareTo("DiscoveryClient_ReceiveFSM") != 0))
                {
                    RHP_Timeout casted_ie = (RHP_Timeout)ie;
                    pDiscoveryClient_ReceiveFSM.context.RHP_TimeoutTransition();
                    done = true;
                }
            } catch (Exception e) {}

            try
            {
                if ((!done) && ie.getName().CompareTo("Send") == 0 && (ie.getSource().CompareTo("DiscoveryClient_ReceiveFSM") != 0))
                {
                    Send casted_ie = (Send)ie;
                    pDiscoveryClient_ReceiveFSM.context.SendTransition();
                    done = true;
                }
            } catch (Exception e) {}

            try
            {
                if ((!done) && ie.getName().CompareTo("BroadcastLocal") == 0 && (ie.getSource().CompareTo("DiscoveryClient_ReceiveFSM") != 0))
                {
                    BroadcastLocal casted_ie = (BroadcastLocal)ie;
                    pDiscoveryClient_ReceiveFSM.context.BroadcastLocalTransition();
                    done = true;
                }
            } catch (Exception e) {}

            try
            {
                if ((!done) && ie.getName().CompareTo("BroadcastGlobal") == 0 && (ie.getSource().CompareTo("DiscoveryClient_ReceiveFSM") != 0))
                {
                    BroadcastGlobal casted_ie = (BroadcastGlobal)ie;
                    pDiscoveryClient_ReceiveFSM.context.BroadcastGlobalTransition();
                    done = true;
                }
            } catch (Exception e) {}

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

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

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

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

            try
            {
                if ((!done) && ie.getName().CompareTo("RHP_Timeout") == 0 && (ie.getSource().CompareTo("DiscoveryClient_SendFSM") != 0))
                {
                    RHP_Timeout casted_ie = (RHP_Timeout)ie;
                    pDiscoveryClient_SendFSM.context.RHP_TimeoutTransition();
                    done = true;
                }
            } catch (Exception e) {}

            try
            {
                if ((!done) && ie.getName().CompareTo("Send") == 0 && (ie.getSource().CompareTo("DiscoveryClient_SendFSM") != 0))
                {
                    Send casted_ie = (Send)ie;
                    pDiscoveryClient_SendFSM.context.SendTransition();
                    done = true;
                }
            } catch (Exception e) {}

            try
            {
                if ((!done) && ie.getName().CompareTo("BroadcastLocal") == 0 && (ie.getSource().CompareTo("DiscoveryClient_SendFSM") != 0))
                {
                    BroadcastLocal casted_ie = (BroadcastLocal)ie;
                    pDiscoveryClient_SendFSM.context.BroadcastLocalTransition();
                    done = true;
                }
            } catch (Exception e) {}

            try
            {
                if ((!done) && ie.getName().CompareTo("BroadcastGlobal") == 0 && (ie.getSource().CompareTo("DiscoveryClient_SendFSM") != 0))
                {
                    BroadcastGlobal casted_ie = (BroadcastGlobal)ie;
                    pDiscoveryClient_SendFSM.context.BroadcastGlobalTransition();
                    done = true;
                }
            } catch (Exception e) {}



            mutex.ReleaseMutex();
            return(done);
        }