Boost logo

Boost Users :

From: Andreas Huber (ahd6974-spamboostorgtrap_at_[hidden])
Date: 2008-04-10 14:33:35


Hi Igor

> > The fact that transition actions are members of simple_state<>
> > subclasses. If
> > you apply the pattern outlined in the FAQ item, none of these classes
> > are
> > visible to FSM clients. Looking at
> >
> > http://www.boost.org/doc/libs/1_35_0/libs/statechart/doc/faq.html#HideInnerWorkings
>
> Is it possible to apply this apporoach to the asynchronous_state_machine?

Yes, but not in exactly the same way.

> For some reasone, trying to do so in my program causes compiler error:
> "use of undefined type 'Active'". Probably, I've done something wrong,
> but I'd like to know if it should work theoretically, before I turn my
> code
> upside down :).

In your asynchronous_state_machine<> subclass hpp file add the following
line :

  private:
    // ...
    virtual void initiate_impl();

In your asynchronous_state_machine<> subclass cpp file add the following
lines:

    void YourClassName::initiate_impl()
    {
      machine_base::initiate();
    }

Please let me know whether that works for you.

Thanks & Regards,

-- 
Andreas Huber
When replying by private email, please remove the words spam and trap
from the address shown in the header.

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net