[MSM] templated state machine generates many errors when a state is derived from msm::front::exit_pseudo_state<event>
I just wanted to check that there was not something obvious I am doing wrong here: relevant parts: the exit state (defined outside the state machine) struct QueryGood { QueryGood(query_complete const& r) : result(r.result) {} // note: universal converting constructor template<class T> QueryGood(const T&) {} pkt result; }; template<class Environment> struct dns_query_ : msm::front::state_machine_def<dns_query_<Environment>> { // error happens when I derive from exit_pseudo_state. deriving from msmf::state<> eliminates all errors struct Complete : msm::front::exit_pseudo_state<QueryGood> // msmf::state<> { ... }; ... // transition table: struct transition_table : mpl::vector< // Start Event Next Action Guard // +--------------+---------------------+--------------+---------------------+----------------------+ msmf::Row < NotStarted , RestartQuery , Querying , msmf::none , msmf::none >, msmf::Row < Complete , RestartQuery , Querying , msmf::none , msmf::none >, msmf::Row < Error , RestartQuery , Querying , msmf::none , msmf::none >, msmf::Row < Querying , query_timeout , Error , NotifyUpdate , IsCurrentEvent >, msmf::Row < Querying , RestartQuery , Querying , msmf::none , msmf::none >, msmf::Row < Querying , query_error , Error , NotifyUpdate , IsCurrentEvent >, msmf::Row < Querying , query_complete , Complete , NotifyUpdate , IsCurrentEvent > // +--------------+---------------------+--------------+---------------------+----------------------+ > {}; }; sample of errors: /Users/rhodges/secr/xcode-secr/target_local/include/boost/msm/back/metafunctions.hpp:578:79: error: no type named 'owner' in 'secr::wrapldns::dns_query_<query_host>::Complete' typename ::boost::mpl::not_<typename ::boost::is_same<typename State::owner, ~~~~~~~~~~~~~~~~^~~~~ In file included from /Users/rhodges/secr/secr/wrapldns/tests/test_query_algo.cpp:3: In file included from /Users/rhodges/secr/secr/wrapldns/include/secr/wrapldns/query_feed.hpp:5: In file included from /Users/rhodges/secr/secr/valuelib/debug/include/valuelib/debug/trace.hpp:23: In file included from /Users/rhodges/secr/xcode-secr/target_local/include/boost/log/trivial.hpp:21: In file included from /Users/rhodges/secr/xcode-secr/target_local/include/boost/log/keywords/severity.hpp:18: In file included from /Users/rhodges/secr/xcode-secr/target_local/include/boost/parameter/keyword.hpp:9: In file included from /Users/rhodges/secr/xcode-secr/target_local/include/boost/parameter/aux_/unwrap_cv_reference.hpp:12: /Users/rhodges/secr/xcode-secr/target_local/include/boost/mpl/eval_if.hpp:38:22: note: in instantiation of template class 'boost::msm::back::get_owner<secr::wrapldns::dns_query_<query_host>::Complete, boost::msm::back::state_machine<secr::wrapldns::dns_query_<query_host>, boost::parameter::void_, boost::parameter::void_, boost::parameter::void_, boost::parameter::void_> >' requested here typedef typename f_::type type; ^ In file included from /Users/rhodges/secr/secr/wrapldns/tests/test_query_algo.cpp:6: In file included from /Users/rhodges/secr/secr/wrapldns/src/sm/stale_timer.hpp:3: In file included from /Users/rhodges/secr/secr/wrapldns/src/sm/config.hpp:5: /Users/rhodges/secr/xcode-secr/target_local/include/boost/msm/back/state_machine.hpp:630:40: note: in instantiation of template class 'boost::mpl::eval_if<mpl_::bool_<true>, boost::msm::back::get_owner<secr::wrapldns::dns_query_<query_host>::Complete, boost::msm::back::state_machine<secr::wrapldns::dns_query_<query_host>, boost::parameter::void_, boost::parameter::void_, boost::parameter::void_, boost::parameter::void_> >, boost::mpl::identity<secr::wrapldns::dns_query_<query_host>::Complete> >' requested here typedef typename ::boost::mpl::eval_if< ^ In file included from /Users/rhodges/secr/secr/wrapldns/tests/test_query_algo.cpp:6: In file included from /Users/rhodges/secr/secr/wrapldns/src/sm/stale_timer.hpp:3: In file included from /Users/rhodges/secr/secr/wrapldns/src/sm/config.hpp:5: In file included from /Users/rhodges/secr/xcode-secr/target_local/include/boost/msm/back/state_machine.hpp:59: /Users/rhodges/secr/xcode-secr/target_local/include/boost/msm/back/metafunctions.hpp:85:22: note: in instantiation of template class 'boost::msm::back::state_machine<secr::wrapldns::dns_query_<query_host>, boost::parameter::void_, boost::parameter::void_, boost::parameter::void_, boost::parameter::void_>::_row_<boost::msm::front::Row<secr::wrapldns::dns_query_<query_host>::Complete, secr::wrapldns::RestartQuery, secr::wrapldns::dns_query_<query_host>::Querying, boost::msm::front::none, boost::msm::front::none> >' requested here typedef typename Transition::current_state_type type; ^ In file included from /Users/rhodges/secr/secr/wrapldns/tests/test_query_algo.cpp:3: In file included from /Users/rhodges/secr/secr/wrapldns/include/secr/wrapldns/query_feed.hpp:5: In file included from /Users/rhodges/secr/secr/valuelib/debug/include/valuelib/debug/trace.hpp:23: In file included from /Users/rhodges/secr/xcode-secr/target_local/include/boost/log/trivial.hpp:21: In file included from /Users/rhodges/secr/xcode-secr/target_local/include/boost/log/keywords/severity.hpp:18: In file included from /Users/rhodges/secr/xcode-secr/target_local/include/boost/parameter/keyword.hpp:10: In file included from /Users/rhodges/secr/xcode-secr/target_local/include/boost/parameter/aux_/tag.hpp:8: In file included from /Users/rhodges/secr/xcode-secr/target_local/include/boost/parameter/aux_/tagged_argument.hpp:10: In file included from /Users/rhodges/secr/xcode-secr/target_local/include/boost/parameter/aux_/arg_list.hpp:17: In file included from /Users/rhodges/secr/xcode-secr/target_local/include/boost/mpl/apply.hpp:25: In file included from /Users/rhodges/secr/xcode-secr/target_local/include/boost/mpl/lambda.hpp:22: In file included from /Users/rhodges/secr/xcode-secr/target_local/include/boost/mpl/aux_/full_lambda.hpp:25: In file included from /Users/rhodges/secr/xcode-secr/target_local/include/boost/mpl/quote.hpp:23: /Users/rhodges/secr/xcode-secr/target_local/include/boost/mpl/aux_/has_type.hpp:20:1: note: in instantiation of template class 'boost::msm::back::transition_source_type<boost::msm::back::state_machine<secr::wrapldns::dns_query_<query_host>, boost::parameter::void_, boost::parameter::void_, boost::parameter::void_, boost::parameter::void_>::_row_<boost::msm::front::Row<secr::wrapldns::dns_query_<query_host>::Complete, secr::wrapldns::RestartQuery, secr::wrapldns::dns_query_<query_host>::Querying, boost::msm::front::none, boost::msm::front::none> > >' requested here BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF(has_type, type, true) ^ In file included from /Users/rhodges/secr/secr/wrapldns/tests/test_query_algo.cpp:3: In file included from /Users/rhodges/secr/secr/wrapldns/include/secr/wrapldns/query_feed.hpp:5: In file included from /Users/rhodges/secr/secr/valuelib/debug/include/valuelib/debug/trace.hpp:23: In file included from /Users/rhodges/secr/xcode-secr/target_local/include/boost/log/trivial.hpp:21: In file included from /Users/rhodges/secr/xcode-secr/target_local/include/boost/log/keywords/severity.hpp:18: In file included from /Users/rhodges/secr/xcode-secr/target_local/include/boost/parameter/keyword.hpp:10: In file included from /Users/rhodges/secr/xcode-secr/target_local/include/boost/parameter/aux_/tag.hpp:8: In file included from /Users/rhodges/secr/xcode-secr/target_local/include/boost/parameter/aux_/tagged_argument.hpp:10: In file included from /Users/rhodges/secr/xcode-secr/target_local/include/boost/parameter/aux_/arg_list.hpp:10: In file included from /Users/rhodges/secr/xcode-secr/target_local/include/boost/parameter/aux_/result_of0.hpp:7: In file included from /Users/rhodges/secr/xcode-secr/target_local/include/boost/utility/result_of.hpp:21: /Users/rhodges/secr/xcode-secr/target_local/include/boost/mpl/has_xxx.hpp:245:65: note: expanded from macro 'BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF' , boost::mpl::aux::type_wrapper<BOOST_MSVC_TYPENAME U::name>* = 0 \ ^ In file included from /Users/rhodges/secr/secr/wrapldns/tests/test_query_algo.cpp:3: In file included from /Users/rhodges/secr/secr/wrapldns/include/secr/wrapldns/query_feed.hpp:5: In file included from /Users/rhodges/secr/secr/valuelib/debug/include/valuelib/debug/trace.hpp:23: In file included from /Users/rhodges/secr/xcode-secr/target_local/include/boost/log/trivial.hpp:21: In file included from /Users/rhodges/secr/xcode-secr/target_local/include/boost/log/keywords/severity.hpp:18: In file included from /Users/rhodges/secr/xcode-secr/target_local/include/boost/parameter/keyword.hpp:10: In file included from /Users/rhodges/secr/xcode-secr/target_local/include/boost/parameter/aux_/tag.hpp:8: In file included from /Users/rhodges/secr/xcode-secr/target_local/include/boost/parameter/aux_/tagged_argument.hpp:10: In file included from /Users/rhodges/secr/xcode-secr/target_local/include/boost/parameter/aux_/arg_list.hpp:17: In file included from /Users/rhodges/secr/xcode-secr/target_local/include/boost/mpl/apply.hpp:25: In file included from /Users/rhodges/secr/xcode-secr/target_local/include/boost/mpl/lambda.hpp:22: In file included from /Users/rhodges/secr/xcode-secr/target_local/include/boost/mpl/aux_/full_lambda.hpp:25: In file included from /Users/rhodges/secr/xcode-secr/target_local/include/boost/mpl/quote.hpp:23: /Users/rhodges/secr/xcode-secr/target_local/include/boost/mpl/aux_/has_type.hpp:20:1: note: while substituting deduced template arguments into function template 'test' [with U = boost::msm::back::transition_source_type<boost::msm::back::state_machine<secr::wrapldns::dns_query_<query_host>, boost::parameter::void_, boost::parameter::void_, boost::parameter::void_, boost::parameter::void_>::_row_<boost::msm::front::Row<secr::wrapldns::dns_query_<query_host>::Complete, secr::wrapldns::RestartQuery, secr::wrapldns::dns_query_<query_host>::Querying, boost::msm::front::none, boost::msm::front::none> > >] In file included from /Users/rhodges/secr/secr/wrapldns/tests/test_query_algo.cpp:3: In file included from /Users/rhodges/secr/secr/wrapldns/include/secr/wrapldns/query_feed.hpp:5: In file included from /Users/rhodges/secr/secr/valuelib/debug/include/valuelib/debug/trace.hpp:23: In file included from /Users/rhodges/secr/xcode-secr/target_local/include/boost/log/trivial.hpp:21: In file included from /Users/rhodges/secr/xcode-secr/target_local/include/boost/log/keywords/severity.hpp:18: In file included from /Users/rhodges/secr/xcode-secr/target_local/include/boost/parameter/keyword.hpp:10: In file included from /Users/rhodges/secr/xcode-secr/target_local/include/boost/parameter/aux_/tag.hpp:8: In file included from /Users/rhodges/secr/xcode-secr/target_local/include/boost/parameter/aux_/tagged_argument.hpp:10: In file included from /Users/rhodges/secr/xcode-secr/target_local/include/boost/parameter/aux_/arg_list.hpp:10: In file included from /Users/rhodges/secr/xcode-secr/target_local/include/boost/parameter/aux_/result_of0.hpp:7: In file included from /Users/rhodges/secr/xcode-secr/target_local/include/boost/utility/result_of.hpp:21: /Users/rhodges/secr/xcode-secr/target_local/include/boost/mpl/has_xxx.hpp:253:18: note: expanded from macro 'BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF' sizeof(gcc_3_2_wknd::test(static_cast<t_*>(0))) \ ^ In file included from /Users/rhodges/secr/secr/wrapldns/tests/test_query_algo.cpp:3: In file included from /Users/rhodges/secr/secr/wrapldns/include/secr/wrapldns/query_feed.hpp:5: In file included from /Users/rhodges/secr/secr/valuelib/debug/include/valuelib/debug/trace.hpp:23: In file included from /Users/rhodges/secr/xcode-secr/target_local/include/boost/log/trivial.hpp:21: In file included from /Users/rhodges/secr/xcode-secr/target_local/include/boost/log/keywords/severity.hpp:18: In file included from /Users/rhodges/secr/xcode-secr/target_local/include/boost/parameter/keyword.hpp:10: In file included from /Users/rhodges/secr/xcode-secr/target_local/include/boost/parameter/aux_/tag.hpp:8: In file included from /Users/rhodges/secr/xcode-secr/target_local/include/boost/parameter/aux_/tagged_argument.hpp:10: In file included from /Users/rhodges/secr/xcode-secr/target_local/include/boost/parameter/aux_/arg_list.hpp:17: In file included from /Users/rhodges/secr/xcode-secr/target_local/include/boost/mpl/apply.hpp:25: In file included from /Users/rhodges/secr/xcode-secr/target_local/include/boost/mpl/lambda.hpp:22: In file included from /Users/rhodges/secr/xcode-secr/target_local/include/boost/mpl/aux_/full_lambda.hpp:25: In file included from /Users/rhodges/secr/xcode-secr/target_local/include/boost/mpl/quote.hpp:45: In file included from /Users/rhodges/secr/xcode-secr/target_local/include/boost/mpl/aux_/include_preprocessed.hpp:37: /Users/rhodges/secr/xcode-secr/target_local/include/boost/mpl/aux_/preprocessed/gcc/quote.hpp:36:20: note: (skipping 36 contexts in backtrace; use -ftemplate-backtrace-limit=0 to see all) , aux::has_type< F<U1> >::value ^ In file included from /Users/rhodges/secr/secr/wrapldns/tests/test_query_algo.cpp:6: In file included from /Users/rhodges/secr/secr/wrapldns/src/sm/stale_timer.hpp:3: In file included from /Users/rhodges/secr/secr/wrapldns/src/sm/config.hpp:5: In file included from /Users/rhodges/secr/xcode-secr/target_local/include/boost/msm/back/state_machine.hpp:53: In file included from /Users/rhodges/secr/xcode-secr/target_local/include/boost/parameter.hpp:11: /Users/rhodges/secr/xcode-secr/target_local/include/boost/parameter/parameters.hpp:585:24: note: in instantiation of template class 'boost::parameter::aux::make_arg_list_aux<boost::parameter::aux::item<boost::parameter::required<boost::msm::back::tag::front_end, boost::parameter::aux::use_default>, secr::wrapldns::query_wrapper_<query_host>, boost::parameter::void_>, boost::parameter::aux::deduced_item<boost::parameter::optional<boost::parameter::deduced<boost::msm::back::tag::history_policy>, has_history_policy<mpl_::arg<-1>, mpl_::bool_<false> > >, boost::parameter::aux::deduced_item<boost::parameter::optional<boost::parameter::deduced<boost::msm::back::tag::compile_policy>, has_compile_policy<mpl_::arg<-1>, mpl_::bool_<false> > >, boost::parameter::aux::deduced_item<boost::parameter::optional<boost::parameter::deduced<boost::msm::back::tag::fsm_check_policy>, has_fsm_check<mpl_::arg<-1>, mpl_::bool_<false> > >, boost::parameter::aux::deduced_item<boost::parameter::optional<boost::parameter::deduced<boost::msm::back::tag::queue_container_policy>, has_queue_container_policy<mpl_::arg<-1>, mpl_::bool_<false> > >, boost::parameter::void_> > > >, boost::parameter::aux::tag_template_keyword_arg, mpl_::bool_<true>, boost::mpl::set0<mpl_::na>, boost::parameter::aux::empty_arg_list, boost::parameter::void_>' requested here typedef typename make_arg_list_aux< ^ /Users/rhodges/secr/xcode-secr/target_local/include/boost/parameter/parameters.hpp:817:31: note: in instantiation of template class 'boost::parameter::aux::make_arg_list<boost::parameter::aux::item<boost::parameter::required<boost::msm::back::tag::front_end, boost::parameter::aux::use_default>, secr::wrapldns::query_wrapper_<query_host>, boost::parameter::void_>, boost::parameter::aux::deduced_item<boost::parameter::optional<boost::parameter::deduced<boost::msm::back::tag::history_policy>, has_history_policy<mpl_::arg<-1>, mpl_::bool_<false> > >, boost::parameter::aux::deduced_item<boost::parameter::optional<boost::parameter::deduced<boost::msm::back::tag::compile_policy>, has_compile_policy<mpl_::arg<-1>, mpl_::bool_<false> > >, boost::parameter::aux::deduced_item<boost::parameter::optional<boost::parameter::deduced<boost::msm::back::tag::fsm_check_policy>, has_fsm_check<mpl_::arg<-1>, mpl_::bool_<false> > >, boost::parameter::aux::deduced_item<boost::parameter::optional<boost::parameter::deduced<boost::msm::back::tag::queue_container_policy>, has_queue_container_policy<mpl_::arg<-1>, mpl_::bool_<false> > >, boost::parameter::void_> > > >, boost::parameter::aux::tag_template_keyword_arg, mpl_::bool_<true> >' requested here typedef typename aux::make_arg_list< ^ In file included from /Users/rhodges/secr/secr/wrapldns/tests/test_query_algo.cpp:6: In file included from /Users/rhodges/secr/secr/wrapldns/src/sm/stale_timer.hpp:3: In file included from /Users/rhodges/secr/secr/wrapldns/src/sm/config.hpp:5: /Users/rhodges/secr/xcode-secr/target_local/include/boost/msm/back/state_machine.hpp:150:47: note: in instantiation of template class 'boost::parameter::parameters<boost::parameter::required<boost::msm::back::tag::front_end, boost::parameter::aux::use_default>, boost::parameter::optional<boost::parameter::deduced<boost::msm::back::tag::history_policy>, has_history_policy<mpl_::arg<-1>, mpl_::bool_<false> > >, boost::parameter::optional<boost::parameter::deduced<boost::msm::back::tag::compile_policy>, has_compile_policy<mpl_::arg<-1>, mpl_::bool_<false> > >, boost::parameter::optional<boost::parameter::deduced<boost::msm::back::tag::fsm_check_policy>, has_fsm_check<mpl_::arg<-1>, mpl_::bool_<false> > >, boost::parameter::optional<boost::parameter::deduced<boost::msm::back::tag::queue_container_policy>, has_queue_container_policy<mpl_::arg<-1>, mpl_::bool_<false> > >, boost::parameter::void_, boost::parameter::void_, boost::parameter::void_>::bind<secr::wrapldns::query_wrapper_<query_host>, boost::parameter::void_, boost::parameter::void_, boost::parameter::void_, boost::parameter::void_, boost::parameter::void_, boost::parameter::void_, boost::parameter::void_>' requested here typename state_machine_signature::bind<A0,A1,A2,A3,A4>::type, ::boost::msm::back::tag::front_end ^ /Users/rhodges/secr/secr/wrapldns/tests/test_query_algo.cpp:123:24: note: in instantiation of template class 'boost::msm::back::state_machine<secr::wrapldns::query_wrapper_<query_host>, boost::parameter::void_, boost::parameter::void_, boost::parameter::void_, boost::parameter::void_>' requested here state_machine_type _state_machine; ^ /Users/rhodges/secr/secr/wrapldns/tests/test_query_algo.cpp:362:3: note: in instantiation of template class 'has_state_machine<query_host, secr::wrapldns::query_wrapper>' requested here : has_state_machine<query_host, secr::wrapldns::query_wrapper> ^
I just wanted to check that there was not something obvious I am doing wrong here:
relevant parts:
the exit state (defined outside the state machine) struct QueryGood { QueryGood(query_complete const& r) : result(r.result) {} };
struct Complete : msm::front::exit_pseudo_state<QueryGood> // msmf::state<>
Hi, from a quick glance, it's hard to say because not all the relevant code (the outer fsm) is provided. What is QueryGood? The comment says it's a state. Then the error likely would be that the template argument of exit_pseudo_state should be an event, not a state. If it's an event, I'd need the relevant code, or better some code so I could run it through a compiler. Could be that the front-end as template class is a problem. Cheers, Christophe
participants (2)
-
christophe.j.henry@gmail.com
-
Richard Hodges