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,
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,
boost::fsm::custom_reaction<EvOptionsSound>,
boost::fsm::custom_reaction<EvOptionsSoundExit>
> >,
InnerInitial< OptionsDialog<ParentState>
{
//...
};
template <class Parent> class InnerInitial : public
fsm::simple_state
{
};
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' being compiled
with
[
MostDerived=Xenocide::Client::UI::Common::InnerInitialXenocide::Client::UI::Geoscape::PlanetviewState>,
Context=Xenocide::Client::UI::Common::OptionsDialogXenocide::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::OptionsDialogXenocide::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::InnerInitialXenocide::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::InnerInitialXenocide::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::InnerInitialXenocide::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::InnerInitialXenocide::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_' being compiled
with
[
T1=boost::mpl::is_sequenceXenocide::Client::UI::Geoscape::PlanetviewState>>,
T2=boost::mpl::identityXenocide::Client::UI::Geoscape::PlanetviewState>>,
T3=boost::mpl::identityXenocide::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' being compiled
with
[
C=boost::mpl::is_sequenceXenocide::Client::UI::Geoscape::PlanetviewState>>,
F1=boost::mpl::identityXenocide::Client::UI::Geoscape::PlanetviewState>>,
F2=boost::mpl::identityXenocide::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::InnerInitialXenocide::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'
being compiled
with
[
MostDerived=Xenocide::Client::UI::Common::OptionsDialogXenocide::Client::UI::Geoscape::PlanetviewState,
Context=boost::fsm::simple_stateXenocide::Client::UI::Geoscape::EvXNet,boost::fsm::custom_reactionXenocide::Client::UI::Geoscape::EvOptions,boost::fsm::custom_reactionXenocide::Client::UI::Common::EvOptionsAbandonGame>,Xenocide::Client::UI::Geoscape::PlanetviewNoOpInnerInitial,has_no_history>::inner_context_type,
InnerInitial=Xenocide::Client::UI::Common::InnerInitialXenocide::Client::UI::Geoscape::PlanetviewState>
]
f:\xenocide\xenocide\src\client\ui\optionsdialog\optionsdialog.h(57) :
see reference to class template instantiation
'boost::fsm::simple_state'
being compiled
with
[
MostDerived=Xenocide::Client::UI::Common::OptionsDialogXenocide::Client::UI::Geoscape::PlanetviewState,
Context=Xenocide::Client::UI::Geoscape::PlanetviewState,
Reactions=boost::mpl::listXenocide::Client::UI::Common::EvOptionsExit,Xenocide::Client::UI::Geoscape::...,boost::fsm::custom_reactionXenocide::Client::UI::Common::EvOptionsSound,boost::fsm::custom_reactionXenocide::Client::UI::Common::EvOptionsSoundExit>,
InnerInitial=Xenocide::Client::UI::Common::InnerInitialXenocide::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::transit_impl(const
TransitionAction &)' being compiled
with
[
MostDerived=Xenocide::Client::UI::Geoscape::PlanetviewState,
Context=Xenocide::Client::UI::RunningGameState,
Reactions=boost::mpl::listXenocide::Client::UI::Geoscape::EvXNet,boost::fsm::custom_reactionXenocide::Client::UI::Geoscape::EvOptions,boost::fsm::custom_reactionXenocide::Client::UI::Common::EvOptionsAbandonGame>,
InnerInitial=Xenocide::Client::UI::Geoscape::PlanetviewNoOpInnerInitial,
historyMode=has_no_history,
DestinationState=Xenocide::Client::UI::Common::OptionsDialogXenocide::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::transit(void)'
being compiled
with
[
MostDerived=Xenocide::Client::UI::Geoscape::PlanetviewState,
Context=Xenocide::Client::UI::RunningGameState,
Reactions=boost::mpl::listXenocide::Client::UI::Geoscape::EvXNet,boost::fsm::custom_reactionXenocide::Client::UI::Geoscape::EvOptions,boost::fsm::custom_reactionXenocide::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