|
Boost Users : |
From: Jan Eickmann (je_at_[hidden])
Date: 2005-02-16 09:49:38
Hi,
I'm trying to get templated states to work with boost::fsm. Background
is that I want to create an OptionsDialog I can show from different screens.
So for now this works:
template<class ParentState>
class OptionsDialog : public boost::fsm::simple_state<
OptionsDialog<ParentState>, ParentState,
boost::mpl::list<
boost::fsm::transition<EvOptionsExit, ParentState>,
boost::fsm::custom_reaction<EvOptionsSound>,
boost::fsm::custom_reaction<EvOptionsSoundExit>
> >
{
//...
};
This works perfectly so far.
Now, what I want to do is have inside of the OptionsDialog substates
(one for the sound-panel, one for video, etc.).
This is my attempt so far:
template <class Parent> class InnerInitial;
template<class ParentState>
class OptionsDialog : public boost::fsm::simple_state<
OptionsDialog<ParentState>, ParentState,
boost::mpl::list<
boost::fsm::transition<EvOptionsExit, ParentState>,
boost::fsm::custom_reaction<EvOptionsSound>,
boost::fsm::custom_reaction<EvOptionsSoundExit>
> >,
InnerInitial< OptionsDialog<ParentState>
{
//...
};
template <class Parent> class InnerInitial : public
fsm::simple_state<InnerInitial<Parent>, Parent>
{
};
When trying to compile this (and of course using the OptionsDialog as a
substate somewhere) I get the following compiler errors (sorry, I know
it's long, but I couldn't make any sense of it so I don't know whats
important). Could anyone shed some light on this?
Thanks a lot,
Jan Eickmann
f:\xenocide\devpack.net2003\dependencies\include\boost\fsm\simple_state.hpp(191)
: error C2039: 'inner_context_type' : is not a member of
'Xenocide::Client::UI::Common::OptionsDialog<ParentState>'
with
[
ParentState=Xenocide::Client::UI::Geoscape::PlanetviewState
]
f:\xenocide\xenocide\src\client\ui\optionsdialog\optionsdialog.h(175) :
see reference to class template instantiation
'boost::fsm::simple_state<MostDerived,Context>' being compiled
with
[
MostDerived=Xenocide::Client::UI::Common::InnerInitial<Xenocide::Client::UI::Common::OptionsDialog<Xenocide::Client::UI::Geoscape::PlanetviewState>>,
Context=Xenocide::Client::UI::Common::OptionsDialog<Xenocide::Client::UI::Geoscape::PlanetviewState>
]
f:\xenocide\devpack.net2003\dependencies\include\boost\mpl\aux_\has_tag.hpp(20)
: see reference to class template instantiation
'Xenocide::Client::UI::Common::InnerInitial<Parent>' being compiled
with
[
Parent=Xenocide::Client::UI::Common::OptionsDialog<Xenocide::Client::UI::Geoscape::PlanetviewState>
]
f:\xenocide\devpack.net2003\dependencies\include\boost\mpl\sequence_tag.hpp(112)
: see reference to class template instantiation
'boost::mpl::aux::has_tag<T>' being compiled
with
[
T=Xenocide::Client::UI::Common::InnerInitial<Xenocide::Client::UI::Common::OptionsDialog<Xenocide::Client::UI::Geoscape::PlanetviewState>>
]
f:\xenocide\devpack.net2003\dependencies\include\boost\mpl\begin_end.hpp(33)
: see reference to class template instantiation
'boost::mpl::sequence_tag<Sequence>' being compiled
with
[
Sequence=Xenocide::Client::UI::Common::InnerInitial<Xenocide::Client::UI::Common::OptionsDialog<Xenocide::Client::UI::Geoscape::PlanetviewState>>
]
f:\xenocide\devpack.net2003\dependencies\include\boost\mpl\is_sequence.hpp(94)
: see reference to class template instantiation
'boost::mpl::begin<Sequence>' being compiled
with
[
Sequence=Xenocide::Client::UI::Common::InnerInitial<Xenocide::Client::UI::Common::OptionsDialog<Xenocide::Client::UI::Geoscape::PlanetviewState>>
]
f:\xenocide\devpack.net2003\dependencies\include\boost\mpl\if.hpp(63) :
see reference to class template instantiation
'boost::mpl::is_sequence<T>' being compiled
with
[
T=Xenocide::Client::UI::Common::InnerInitial<Xenocide::Client::UI::Common::OptionsDialog<Xenocide::Client::UI::Geoscape::PlanetviewState>>
]
f:\xenocide\devpack.net2003\dependencies\include\boost\mpl\eval_if.hpp(40)
: see reference to class template instantiation
'boost::mpl::if_<T1,T2,T3>' being compiled
with
[
T1=boost::mpl::is_sequence<Xenocide::Client::UI::Common::InnerInitial<Xenocide::Client::UI::Common::OptionsDialog<Xenocide::Client::UI::Geoscape::PlanetviewState>>>,
T2=boost::mpl::identity<Xenocide::Client::UI::Common::InnerInitial<Xenocide::Client::UI::Common::OptionsDialog<Xenocide::Client::UI::Geoscape::PlanetviewState>>>,
T3=boost::mpl::identity<boost::mpl::list<Xenocide::Client::UI::Common::InnerInitial<Xenocide::Client::UI::Common::OptionsDialog<Xenocide::Client::UI::Geoscape::PlanetviewState>>>>
]
f:\xenocide\devpack.net2003\dependencies\include\boost\fsm\simple_state.hpp(71)
: see reference to class template instantiation
'boost::mpl::eval_if<C,F1,F2>' being compiled
with
[
C=boost::mpl::is_sequence<Xenocide::Client::UI::Common::InnerInitial<Xenocide::Client::UI::Common::OptionsDialog<Xenocide::Client::UI::Geoscape::PlanetviewState>>>,
F1=boost::mpl::identity<Xenocide::Client::UI::Common::InnerInitial<Xenocide::Client::UI::Common::OptionsDialog<Xenocide::Client::UI::Geoscape::PlanetviewState>>>,
F2=boost::mpl::identity<boost::mpl::list<Xenocide::Client::UI::Common::InnerInitial<Xenocide::Client::UI::Common::OptionsDialog<Xenocide::Client::UI::Geoscape::PlanetviewState>>>>
]
f:\xenocide\devpack.net2003\dependencies\include\boost\fsm\simple_state.hpp(82)
: see reference to class template instantiation
'boost::fsm::detail::make_list<T>' being compiled
with
[
T=Xenocide::Client::UI::Common::InnerInitial<Xenocide::Client::UI::Common::OptionsDialog<Xenocide::Client::UI::Geoscape::PlanetviewState>>
]
f:\xenocide\devpack.net2003\dependencies\include\boost\fsm\simple_state.hpp(191)
: see reference to class template instantiation
'boost::fsm::detail::simple_state_base_type<MostDerived,Context,InnerInitial>'
being compiled
with
[
MostDerived=Xenocide::Client::UI::Common::OptionsDialog<Xenocide::Client::UI::Geoscape::PlanetviewState>,
Context=boost::fsm::simple_state<Xenocide::Client::UI::Geoscape::PlanetviewState,Xenocide::Client::UI::RunningGameState,boost::mpl::list<boost::fsm::custom_reaction<Xenocide::Client::UI::Geoscape::EvXNet>,boost::fsm::custom_reaction<Xenocide::Client::UI::Geoscape::EvOptions>,boost::fsm::custom_reaction<Xenocide::Client::UI::Common::EvOptionsAbandonGame>>,Xenocide::Client::UI::Geoscape::PlanetviewNoOpInnerInitial,has_no_history>::inner_context_type,
InnerInitial=Xenocide::Client::UI::Common::InnerInitial<Xenocide::Client::UI::Common::OptionsDialog<Xenocide::Client::UI::Geoscape::PlanetviewState>>
]
f:\xenocide\xenocide\src\client\ui\optionsdialog\optionsdialog.h(57) :
see reference to class template instantiation
'boost::fsm::simple_state<MostDerived,Context,Reactions,InnerInitial>'
being compiled
with
[
MostDerived=Xenocide::Client::UI::Common::OptionsDialog<Xenocide::Client::UI::Geoscape::PlanetviewState>,
Context=Xenocide::Client::UI::Geoscape::PlanetviewState,
Reactions=boost::mpl::list<boost::fsm::transition<Xenocide::Client::UI::Common::EvOptionsExit,Xenocide::Client::UI::Geoscape::PlanetviewState>,boost::fsm::custom_reaction<Xenocide::Client::UI::Common::EvOptionsSound>,boost::fsm::custom_reaction<Xenocide::Client::UI::Common::EvOptionsSoundExit>>,
InnerInitial=Xenocide::Client::UI::Common::InnerInitial<Xenocide::Client::UI::Common::OptionsDialog<Xenocide::Client::UI::Geoscape::PlanetviewState>>
]
f:\xenocide\devpack.net2003\dependencies\include\boost\fsm\simple_state.hpp(693)
: see reference to class template instantiation
'Xenocide::Client::UI::Common::OptionsDialog<ParentState>' being compiled
with
[
ParentState=Xenocide::Client::UI::Geoscape::PlanetviewState
]
f:\xenocide\devpack.net2003\dependencies\include\boost\fsm\simple_state.hpp(303)
: see reference to function template instantiation 'boost::fsm::result
boost::fsm::simple_state<MostDerived,Context,Reactions,InnerInitial,historyMode>::transit_impl<DestinationState,MostDerived,boost::fsm::detail::no_transition_function>(const
TransitionAction &)' being compiled
with
[
MostDerived=Xenocide::Client::UI::Geoscape::PlanetviewState,
Context=Xenocide::Client::UI::RunningGameState,
Reactions=boost::mpl::list<boost::fsm::custom_reaction<Xenocide::Client::UI::Geoscape::EvXNet>,boost::fsm::custom_reaction<Xenocide::Client::UI::Geoscape::EvOptions>,boost::fsm::custom_reaction<Xenocide::Client::UI::Common::EvOptionsAbandonGame>>,
InnerInitial=Xenocide::Client::UI::Geoscape::PlanetviewNoOpInnerInitial,
historyMode=has_no_history,
DestinationState=Xenocide::Client::UI::Common::OptionsDialog<Xenocide::Client::UI::Geoscape::PlanetviewState>,
TransitionAction=boost::fsm::detail::no_transition_function
]
f:\xenocide\xenocide\src\client\ui\planetview\planetview.cpp(371) : see
reference to function template instantiation 'boost::fsm::result
boost::fsm::simple_state<MostDerived,Context,Reactions,InnerInitial,historyMode>::transit<Xenocide::Client::UI::Common::OptionsDialog<ParentState>>(void)'
being compiled
with
[
MostDerived=Xenocide::Client::UI::Geoscape::PlanetviewState,
Context=Xenocide::Client::UI::RunningGameState,
Reactions=boost::mpl::list<boost::fsm::custom_reaction<Xenocide::Client::UI::Geoscape::EvXNet>,boost::fsm::custom_reaction<Xenocide::Client::UI::Geoscape::EvOptions>,boost::fsm::custom_reaction<Xenocide::Client::UI::Common::EvOptionsAbandonGame>>,
InnerInitial=Xenocide::Client::UI::Geoscape::PlanetviewNoOpInnerInitial,
historyMode=has_no_history,
ParentState=Xenocide::Client::UI::Geoscape::PlanetviewState
]
f:\xenocide\devpack.net2003\dependencies\include\boost\fsm\simple_state.hpp(191)
: error C2146: syntax error : missing ',' before identifier
'inner_context_type'
f:\xenocide\devpack.net2003\dependencies\include\boost\fsm\simple_state.hpp(191)
: error C2065: 'inner_context_type' : undeclared identifier
f:\xenocide\devpack.net2003\dependencies\include\boost\fsm\simple_state.hpp(191)
: error C2976: 'boost::fsm::detail::simple_state_base_type' : too few
template arguments
f:\xenocide\devpack.net2003\dependencies\include\boost\fsm\simple_state.hpp(99)
: see declaration of 'boost::fsm::detail::simple_state_base_type'
f:\xenocide\devpack.net2003\dependencies\include\boost\fsm\simple_state.hpp(191)
: error C2955: 'boost::fsm::detail::simple_state_base_type' : use of
class template requires template argument list
f:\xenocide\devpack.net2003\dependencies\include\boost\fsm\simple_state.hpp(99)
: see declaration of 'boost::fsm::detail::simple_state_base_type'
f:\xenocide\devpack.net2003\dependencies\include\boost\fsm\simple_state.hpp(191)
: error C2955: 'boost::fsm::detail::simple_state_base_type' : use of
class template requires template argument list
f:\xenocide\devpack.net2003\dependencies\include\boost\fsm\simple_state.hpp(99)
: see declaration of 'boost::fsm::detail::simple_state_base_type'
f:\xenocide\devpack.net2003\dependencies\include\boost\fsm\simple_state.hpp(192)
: fatal error C1903: unable to recover from previous error(s); stopping
compilation
xnet.cpp
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