Boost logo

Boost Users :

Subject: Re: [Boost-users] [statechart] : choice_point example no worky
From: Noah Roberts (roberts.noah_at_[hidden])
Date: 2010-07-13 19:06:29


In article <MPG.26a67c94f6d5c21098968b_at_[hidden]>,
roberts.noah_at_[hidden] says...

OK, I fixed it...or so it seems. I did it by turning this:

> // universal choice point base class template
> template< class MostDerived, class Context >
> struct choice_point : sc::state< MostDerived, Context,
> sc::custom_reaction< make_choice > >
> {
> typedef sc::state< MostDerived, Context,
> sc::custom_reaction< make_choice > > base_type;
> typedef typename base_type::my_context my_context;
> typedef choice_point my_base;
>
> choice_point( my_context ctx ) : base_type( ctx )
> {
> this->post_event( boost::intrusive_ptr< make_choice >(
> new make_choice() ) );
> }
> };

to this:

// universal choice point base class template
template< class MostDerived, class Context >
struct choice_point : sc::state< MostDerived, Context >
{
  typedef sc::state< MostDerived, Context > base_type;
  typedef typename base_type::my_context my_context;
  typedef choice_point my_base;

  typedef sc::custom_reaction<make_choice> reactions;

  choice_point( my_context ctx ) : base_type( ctx )
  {
    this->post_event( boost::intrusive_ptr< make_choice >(
      new make_choice() ) );
  }
};

It seems to do the trick. If it's the right way to do it I'd suggest
updating the documentation.

-- 
http://crazyeddiecpp.blogspot.com/

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