Coder Social home page Coder Social logo

Comments (3)

kiishor avatar kiishor commented on May 26, 2024

Hi spachner,

Thanks for pointing it. Yes it’s a bug. I’ll fix it soon.

Thanks,
Nandkishor

from uml-state-machine-in-c.

kiishor avatar kiishor commented on May 26, 2024

Hi Stefan,

After analyzing and debugging, I found that it's not a bug. The entry handler is getting called as per the order.

pTarget_State is traversed upward to its parent node in the process of finding the traverse path.
as shown below

  // Is Source hierarchy level greater than target level?
  else if(pSource_State->Level < pTarget_State->Level)
  {
    // Traverse the target state to upward,
    // Till it matches with source state hierarchy level.
    while(pSource_State->Level < pTarget_State->Level)
    {
      pTarget_Path[index++] = pTarget_State;  // Store the target node path.
      pTarget_State = pTarget_State->Parent;
    }
  }

  // Now Source & Target are at same hierarchy level.
  // Traverse the source & target state to upward, till we find their common parent.
  while(pSource_State->Parent != pTarget_State->Parent)
  {
    EXECUTE_HANDLER(pSource_State->Exit, triggered_to_self, pState_Machine);
    pSource_State = pSource_State->Parent;  // Move source state to upward state.

    pTarget_Path[index++] = pTarget_State;  // Store the target node path.
    pTarget_State = pTarget_State->Parent;    // Move the target state to upward state.
  }

pTarget_State is not the final node, it is the first node for the entry traverse.

Thanks,
Nandkishor

from uml-state-machine-in-c.

spachner avatar spachner commented on May 26, 2024

Hi Nandkishor,

great, thank's for pointing that out. I was missleaded by the variable's name pTarget_State which is actually not the target in this line. I'm am closing the ticket.

regards

spachner

from uml-state-machine-in-c.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.