|
Boost Users : |
From: Igor R (boost.lists_at_[hidden])
Date: 2008-07-21 06:49:56
> (4) finally, I templated the state<> version, , which has problems.
>
> [NOTE: I've referenced line # 3773 below, to sync with output]
>
> struct NDIREV_17 {};
>
> template< typename I >
> struct Start;
>
> template< typename I >
> struct Inst : public sc::state_machine< Inst<I>, Start<I> > {};[ line# 3773 ]
>
> template< typename I >
> struct Start : public sc::state< Start<I>, Inst<I> > {
> Start<I>(my_context ctx ) : my_base( ctx ) {}
> };
>
Did you try this way:
template<typename I> struct Inst : public sc::state_machine<Inst<I>,
mpl::list<Start<I> > >
> // same 'main'
>
>
>
>
>
> //************************************************************************
> (5) ATTEMPTS TO FIX:
>
> a) look @ code in state.hpp ( shown below ) and attempt to replace
> "my_context" & "my_base" with direct substitutions of "simple_state" and
> this->set_context.... no luck.
>
>
>
> REQUEST FOR HELP:
> Could someone who has successfully templated both the machine<> and the state<>
> classes possibly give me a hint as to what I might be able to do to fix this bug?
>
> Thank you for your time and effort;
>
> Tony Turner
> acturner01_at_[hidden]
>
>
>
>
>
>
>
>
>
> //************************************************************************
> (6) state.hpp fragment
>
> // here is 'state<> fragment from state.hpp
>
> template< class MostDerived,
> class Context,
> class InnerInitial = mpl::list<>,
> history_mode historyMode = has_no_history >
> class state : public simple_state<
> MostDerived, Context, InnerInitial, historyMode >
> {
> typedef simple_state< MostDerived, Context, InnerInitial, historyMode >
> base_type;
>
> protected:
> //////////////////////////////////////////////////////////////////////////
> struct my_context
> {
> my_context( typename base_type::context_ptr_type pContext ) :
> pContext_( pContext )
> {
> }
>
> typename base_type::context_ptr_type pContext_;
> };
>
> typedef state my_base;
>
> state( my_context ctx )
> {
> this->set_context( ctx.pContext_ );
> }
>
> ~state() {}
>
> ------------------------------------------------------------
> ------------------------------------------------------------
>
> Resulting Error msg:
>
> Device.hpp:3774:
> error: expected `)' before 'ctx'
> In file included from src/bin/UnitTestDevice.cpp:25:
> Device.hpp:3774:
> error: expected `)' before 'ctx'
> /usr/include/boost/statechart/state.hpp: In static member function 'static
> typename boost::statechart::simple_state<MostDerived, Context, InnerInitial,
> historyMode>::inner_context_ptr_type boost::statechart::state<MostDerived,
> Context, InnerInitial, historyMode>::shallow_construct(const typename
> boost::statechart::simple_state<MostDerived, Context, InnerInitial,
> historyMode>::context_ptr_type&, typename
> boost::statechart::simple_state<MostDerived, Context, InnerInitial,
> historyMode>::outermost_context_base_type&) [with MostDerived =
> MNavAnts::Start1<MNavAnts::NDIREV_99>, Context =
> MNavAnts::Inst1<MNavAnts::NDIREV_99>, InnerInitial = boost::mpl::list<mpl_::na,
> mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na,
> mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na,
> mpl_::na, mpl_::na, mpl_::na>, boost::statechart::history_mode historyMode =
> has_no_history]':
> /usr/include/boost/statechart/state.hpp:79: instantiated from 'static void
> boost::statechart::state<MostDerived, Context, InnerInitial,
> historyMode>::deep_construct(const typename
> boost::statechart::simple_state<MostDerived, Context, InnerInitial,
> historyMode>::context_ptr_type&, typename
> boost::statechart::simple_state<MostDerived, Context, InnerInitial,
> historyMode>::outermost_context_base_type&) [with MostDerived =
> MNavAnts::Start1<MNavAnts::NDIREV_99>, Context =
> MNavAnts::Inst1<MNavAnts::NDIREV_99>, InnerInitial = boost::mpl::list<mpl_::na,
> mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na,
> mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na,
> mpl_::na, mpl_::na, mpl_::na>, boost::statechart::history_mode historyMode =
> has_no_history]'
> /usr/include/boost/statechart/state.hpp:70: instantiated from 'static void
> boost::statechart::state<MostDerived, Context, InnerInitial,
> historyMode>::initial_deep_construct(typename
> boost::statechart::simple_state<MostDerived, Context, InnerInitial,
> historyMode>::outermost_context_base_type&) [with MostDerived =
> MNavAnts::Start1<MNavAnts::NDIREV_99>, Context =
> MNavAnts::Inst1<MNavAnts::NDIREV_99>, InnerInitial = boost::mpl::list<mpl_::na,
> mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na,
> mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na,
> mpl_::na, mpl_::na, mpl_::na>, boost::statechart::history_mode historyMode =
> has_no_history]'
> /usr/include/boost/statechart/state_machine.hpp:701: instantiated from 'void
> boost::statechart::state_machine<MostDerived, InitialState, Allocator,
> ExceptionTranslator>::initial_construct() [with MostDerived =
> MNavAnts::Inst1<MNavAnts::NDIREV_99>, InitialState =
> MNavAnts::Start1<MNavAnts::NDIREV_99>, Allocator = std::allocator<void>,
> ExceptionTranslator = boost::statechart::null_exception_translator]'
> /usr/include/boost/statechart/state_machine.hpp:716: instantiated from
> 'boost::statechart::result boost::statechart::state_machine<MostDerived,
> InitialState, Allocator,
> ExceptionTranslator>::initial_construct_function::operator()() [with MostDerived
> = MNavAnts::Inst1<MNavAnts::NDIREV_99>, InitialState =
> MNavAnts::Start1<MNavAnts::NDIREV_99>, Allocator = std::allocator<void>,
> ExceptionTranslator = boost::statechart::null_exception_translator]'
> /usr/include/boost/statechart/null_exception_translator.hpp:33: instantiated
> from 'boost::statechart::result
> boost::statechart::null_exception_translator::operator()(Action,
> ExceptionEventHandler) [with Action =
> boost::statechart::state_machine<MNavAnts::Inst1<MNavAnts::NDIREV_99>,
> MNavAnts::Start1<MNavAnts::NDIREV_99>, std::allocator<void>,
> boost::statechart::null_exception_translator>::initial_construct_function,
> ExceptionEventHandler =
> boost::statechart::state_machine<MNavAnts::Inst1<MNavAnts::NDIREV_99>,
> MNavAnts::Start1<MNavAnts::NDIREV_99>, std::allocator<void>,
> boost::statechart::null_exception_translator>::exception_event_handler]'
> /usr/include/boost/statechart/state_machine.hpp:253: instantiated from 'void
> boost::statechart::state_machine<MostDerived, InitialState, Allocator,
> ExceptionTranslator>::initiate() [with MostDerived =
> MNavAnts::Inst1<MNavAnts::NDIREV_99>, InitialState =
> MNavAnts::Start1<MNavAnts::NDIREV_99>, Allocator = std::allocator<void>,
> ExceptionTranslator = boost::statechart::null_exception_translator]'
> src/bin/UnitTestDevice.cpp:870: instantiated from here
> /usr/include/boost/statechart/state.hpp:89: error: no matching function for call
> to
> 'MNavAnts::Start1<MNavAnts::NDIREV_99>::Start1(
> boost::statechart::state<MNavAnts::Start1<MNavAnts::NDIREV_99>,
> MNavAnts::Inst1<MNavAnts::NDIREV_99>, boost::mpl::list<mpl_::na, mpl_::na,
> mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na,
> mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na,
> mpl_::na, mpl_::na>, has_no_history>::my_context)'
> Device.hpp:3773:
> note: candidates are: MNavAnts::Start1<MNavAnts::NDIREV_99>::Start1()
> Device.hpp:3773:
> note: MNavAnts::Start1<MNavAnts::NDIREV_99>::Start1(const
> MNavAnts::Start1<MNavAnts::NDIREV_99>&)
> /usr/include/boost/statechart/state.hpp: In static member function 'static
> typename boost::statechart::simple_state<MostDerived, Context, InnerInitial,
> historyMode>::inner_context_ptr_type boost::statechart::state<MostDerived,
> Context, InnerInitial, historyMode>::shallow_construct(const typename
> boost::statechart::simple_state<MostDerived, Context, InnerInitial,
> historyMode>::context_ptr_type&, typename
> boost::statechart::simple_state<MostDerived, Context, InnerInitial,
> historyMode>::outermost_context_base_type&) [with MostDerived =
> MNavAnts::Start1<MNavAnts::NDIREV_99>, Context =
> MNavAnts::Inst1<MNavAnts::NDIREV_99>, InnerInitial = boost::mpl::list<mpl_::na,
> mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na,
> mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na,
> mpl_::na, mpl_::na, mpl_::na>, boost::statechart::history_mode historyMode =
> has_no_history]':
> /usr/include/boost/statechart/state.hpp:79: instantiated from 'static void
> boost::statechart::state<MostDerived, Context, InnerInitial,
> historyMode>::deep_construct(const typename
> boost::statechart::simple_state<MostDerived, Context, InnerInitial,
> historyMode>::context_ptr_type&, typename
> boost::statechart::simple_state<MostDerived, Context, InnerInitial,
> historyMode>::outermost_context_base_type&) [with MostDerived =
> MNavAnts::Start1<MNavAnts::NDIREV_99>, Context =
> MNavAnts::Inst1<MNavAnts::NDIREV_99>, InnerInitial = boost::mpl::list<mpl_::na,
> mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na,
> mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na,
> mpl_::na, mpl_::na, mpl_::na>, boost::statechart::history_mode historyMode =
> has_no_history]'
> /usr/include/boost/statechart/state.hpp:70: instantiated from 'static void
> boost::statechart::state<MostDerived, Context, InnerInitial,
> historyMode>::initial_deep_construct(typename
> boost::statechart::simple_state<MostDerived, Context, InnerInitial,
> historyMode>::outermost_context_base_type&) [with MostDerived =
> MNavAnts::Start1<MNavAnts::NDIREV_99>, Context =
> MNavAnts::Inst1<MNavAnts::NDIREV_99>, InnerInitial = boost::mpl::list<mpl_::na,
> mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na,
> mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na,
> mpl_::na, mpl_::na, mpl_::na>, boost::statechart::history_mode historyMode =
> has_no_history]'
> /usr/include/boost/statechart/state_machine.hpp:701: instantiated from 'void
> boost::statechart::state_machine<MostDerived, InitialState, Allocator,
> ExceptionTranslator>::initial_construct() [with MostDerived =
> MNavAnts::Inst1<MNavAnts::NDIREV_99>, InitialState =
> MNavAnts::Start1<MNavAnts::NDIREV_99>, Allocator = std::allocator<void>,
> ExceptionTranslator = boost::statechart::null_exception_translator]'
> /usr/include/boost/statechart/state_machine.hpp:716: instantiated from
> 'boost::statechart::result boost::statechart::state_machine<MostDerived,
> InitialState, Allocator,
> ExceptionTranslator>::initial_construct_function::operator()() [with MostDerived
> = MNavAnts::Inst1<MNavAnts::NDIREV_99>, InitialState =
> MNavAnts::Start1<MNavAnts::NDIREV_99>, Allocator = std::allocator<void>,
> ExceptionTranslator = boost::statechart::null_exception_translator]'
> /usr/include/boost/statechart/null_exception_translator.hpp:33: instantiated
> from 'boost::statechart::result
> boost::statechart::null_exception_translator::operator()(Action,
> ExceptionEventHandler) [with Action =
> boost::statechart::state_machine<MNavAnts::Inst1<MNavAnts::NDIREV_99>,
> MNavAnts::Start1<MNavAnts::NDIREV_99>, std::allocator<void>,
> boost::statechart::null_exception_translator>::initial_construct_function,
> ExceptionEventHandler =
> boost::statechart::state_machine<MNavAnts::Inst1<MNavAnts::NDIREV_99>,
> MNavAnts::Start1<MNavAnts::NDIREV_99>, std::allocator<void>,
> boost::statechart::null_exception_translator>::exception_event_handler]'
> /usr/include/boost/statechart/state_machine.hpp:253: instantiated from 'void
> boost::statechart::state_machine<MostDerived, InitialState, Allocator,
> ExceptionTranslator>::initiate() [with MostDerived =
> MNavAnts::Inst1<MNavAnts::NDIREV_99>, InitialState =
> MNavAnts::Start1<MNavAnts::NDIREV_99>, Allocator = std::allocator<void>,
> ExceptionTranslator = boost::statechart::null_exception_translator]'
> src/bin/UnitTestDevice.cpp:870: instantiated from here
> /usr/include/boost/statechart/state.hpp:89: error: no matching function for call
> to
> 'MNavAnts::Start1<MNavAnts::NDIREV_99>::Start1(
> boost::statechart::state<MNavAnts::Start1<MNavAnts::NDIREV_99>,
> MNavAnts::Inst1<MNavAnts::NDIREV_99>, boost::mpl::list<mpl_::na, mpl_::na,
> mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na,
> mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na,
> mpl_::na, mpl_::na>, has_no_history>::my_context)'
> Device.hpp:3773:
> note: candidates are: MNavAnts::Start1<MNavAnts::NDIREV_99>::Start1()
> Device.hpp:3773:
> note: MNavAnts::Start1<MNavAnts::NDIREV_99>::Start1(const
> MNavAnts::Start1<MNavAnts::NDIREV_99>&)
>
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>
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