38 template <
class StateType>
78 template <
class StateType>
81 static_assert(std::is_base_of_v<StateTemplate, StateType>,
82 "The template parameter of StateTemplate, must be a class that derives from "
88 if (className.size() > 1)
90 className = className.substr(0, className.size() - 1);
96 template <
class StateType>
102 if (stateName.empty())
104 if (ptr->stateClassName.empty())
106 throw LocalException(
107 "StateName and StateClassName are empty - cannot create state instance");
110 stateName = ptr->stateClassName;
113 ptr->setTag(stateName);
114 ptr->stateName = stateName;
118 template <
class StateType>
122 StatePtr result =
new StateType(*
dynamic_cast<const StateType*
>(
this));
~StateTemplate() override
static IceInternal::Handle< StateType > createInstance(std::string stateName="")
Creates a new state instance of the type of the template parameter.
StateBasePtr clone() const override
Creates a copy of this state.
void setStateClassNameFromTypeName(const std::string &typeName)
This file offers overloads of toIce() and fromIce() functions for STL container types.
std::string GetTypeString(const std::type_info &tinf, bool withoutNamespaceSpecifier=false)
IceInternal::Handle< State > StatePtr
IceInternal::Handle< StateBase > StateBasePtr