All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
kanzi::StateManager Class Reference

State manager for managing states of nodes or application. More...

#include <kanzi/state_manager/state_manager.hpp>

Inheritance diagram for kanzi::StateManager:
kanzi::Resource kanzi::Object

Classes

class  EnteredStateMessageArguments
 Represents message arguments of EnteredState message of state manager. More...
 
class  GoToNextDefinedStateMessageArguments
 Represents message arguments of GoToNextDefinedState message of state manager. More...
 
class  GoToPreviousDefinedStateMessageArguments
 Represents message arguments of GoToPreviousDefinedState message of state manager. More...
 
class  GoToStateMessageArguments
 Represents message arguments of GoToState message of state manager. More...
 
class  LeftStateMessageArguments
 Represents message arguments of LeftState message of state manager. More...
 
class  State
 
class  StateGroup
 
class  StateGroupRuntime
 State group runtime. More...
 
class  StateManagerNotificationMessageArguments
 Represents message arguments of EnteredState message of state manager. More...
 
class  StateObject
 
class  StateObjectRuntime
 State object runtime. More...
 
class  StateRuntime
 State runtime. More...
 
class  StateTransition
 
class  StateTransitionAnimation
 
class  TransitionFinishedMessageArguments
 Represents message arguments of TransitionFinished message of state manager. More...
 
class  TransitionStartedMessageArguments
 Represents message arguments of TransitionStarted message of state manager. More...
 

Public Types

enum  AnimationMode {
  AnimationModeCustom, AnimationModeLinear, AnimationModeSmoothStep, AnimationModeStep,
  AnimationModeSmootherStep, AnimationModeBack, AnimationModeBounce, AnimationModeCircle,
  AnimationModeCubic, AnimationModeElastic, AnimationModeExponential, AnimationModePower,
  AnimationModeQuadratic, AnimationModeQuartic, AnimationModeQuintic, AnimationModeSine
}
 State manager animation mode. More...
 
enum  TransitionReturnTimeType { TransitionReturnTimeElapsed, TransitionReturnTimeFull }
 State manager transition return time calculation type. More...
 
typedef shared_ptr
< StateManagerRuntime > 
StateManagerRuntimeSharedPtr
 
typedef weak_ptr
< StateManagerRuntime > 
StateManagerRuntimeWeakPtr
 
typedef shared_ptr< StateGroupStateGroupSharedPtr
 
typedef vector
< StateGroupSharedPtr
StateGroupContainer
 
typedef
StateGroupContainer::const_iterator 
StateGroupIterator
 
typedef shared_ptr< StateStateSharedPtr
 
typedef vector< StateSharedPtrStateContainer
 
typedef
StateContainer::const_iterator 
StateIterator
 
typedef shared_ptr
< StateTransition
StateTransitionSharedPtr
 
typedef vector
< StateTransitionSharedPtr
StateTransitionContainer
 
typedef
StateTransitionContainer::const_iterator 
StateTransitionIterator
 
typedef shared_ptr
< StateTransitionAnimation
StateTransitionAnimationSharedPtr
 
typedef vector
< StateTransitionAnimationSharedPtr
StateTransitionAnimationContainer
 
typedef
StateTransitionAnimationContainer::const_iterator 
StateTransitionAnimationIterator
 
typedef shared_ptr< StateObjectStateObjectSharedPtr
 
typedef vector
< StateObjectSharedPtr
StateObjectContainer
 
typedef
StateObjectContainer::const_iterator 
StateObjectIterator
 

Public Member Functions

void addStateGroup (const StateGroupSharedPtr &stateGroup)
 Add new state group to state manager. More...
 
StateGroupIterator beginStateGroups () const
 Returns an iterator to start of the state group container. More...
 
StateGroupIterator endStateGroups () const
 Returns an iterator to end of the state group container. More...
 
StateManagerRuntimeSharedPtr attach (Node *objectNode)
 Attach a state manager. More...
 
void loadFromKZB (KzcInputStream *inputStream, const KzuBinaryFileInfo *file)
 Load a state manager from kzb. More...
 
- Public Member Functions inherited from kanzi::Resource
KzcMemoryManagergetMemoryManager () const
 
 Resource (Domain *domain, string_view name)
 
virtual ~Resource ()
 
virtual void loadFromKZB (const KzuResourceLoaderThreadContext *threadContext, KzcInputStream *inputStream, const KzuBinaryFileInfo *file)
 Function for loading the resource from .KZB. More...
 
virtual void finishLoadingOverride (const KzuResourceLoaderThreadContext *threadContext)
 Function for finishing the loading of the resource. More...
 
virtual void unloadOverride ()
 Unload function for resource. More...
 
virtual kzUint getCPUMemoryUsage () const
 Function for getting the memory usage of a resource. More...
 
void setKZB (const KzuBinaryDirectory *binaryDirectory, kzString path)
 
void setLoaded ()
 
kzString getName () const
 Accessor. More...
 
void load ()
 
void unload ()
 
bool isLoaded () const
 
void kzuResourceLoad_private (const KzuResourceLoaderThreadContext *threadContext)
 Private function for kzuResourceLoad() with specified thread context. More...
 
void kzuResourceFinishLoading_private (const KzuResourceLoaderThreadContext *threadContext)
 Private function for finishing the loading of the resource. More...
 
KzuResourceLoadingStrategy getLoadingStrategy () const
 
void setLoadingStrategy (KzuResourceLoadingStrategy loadingStrategy)
 
bool getKeepAlive () const
 Tells if the resource has keep alive flag set. More...
 
void setKeepAlive (bool keepAlive)
 Sets the keep alive flag. More...
 
- Public Member Functions inherited from kanzi::Object
 Object (Domain *domain)
 
virtual ~Object ()
 
DomaingetDomain () const
 Returns the domain the object belongs to. More...
 
KzuPropertyManager * getPropertyManager () const
 Returns the property manager of the object. More...
 
KzuTaskSchedulergetTaskScheduler () const
 Returns the task scheduler of the object. More...
 
KzuMessageDispatchergetMessageDispatcher () const
 Returns the message dispatcher of the object. More...
 
ResourceManagergetResourceManager () const
 Returns the resource manager of the object. More...
 
virtual const MetaclassgetDynamicMetaclass () const
 Returns the metaclass of the dynamic type of the object. More...
 
bool isTypeOf (const Metaclass *objectType) const
 Determines if the type of this object is the given type or derived from it. More...
 
template<typename DataType >
void setProperty (const PropertyType< DataType > &propertyType, typename PropertyType< DataType >::DataType value)
 Sets the local value of a property. More...
 
void setProperty (const PropertyType< ResourceID > &propertyType, ResourceSharedPtr value)
 Sets the local value of a resource id property with a resource pointer. More...
 
template<typename DataType >
DataType getProperty (const PropertyType< DataType > &propertyType) const
 Returns the current value of a property. More...
 
template<typename DataType >
bool getProperty (const PropertyType< DataType > &propertyType, typename PropertyType< DataType >::DataType &value) const
 Evaluates the property value in the same way as the overload above but does not default to the value in property metadata if there are no inputs to the property value. More...
 
template<typename DataType >
void setAbstractProperty (AbstractPropertyType abstractPropertyType, typename PropertyType< DataType >::DataType value)
 
void setAbstractProperty (AbstractPropertyType abstractPropertyType, ResourceSharedPtr value)
 
template<typename DataType >
DataType getAbstractProperty (AbstractPropertyType abstractPropertyType) const
 
template<typename DataType >
bool getAbstractProperty (AbstractPropertyType abstractPropertyType, typename PropertyType< DataType >::DataType &value) const
 
bool hasValue (AbstractPropertyType propertyType) const
 Evaluates whether there are any inputs into the property value. More...
 
bool hasLocalValue (AbstractPropertyType propertyType) const
 Evaluates whether there is a local value set for the property. More...
 
void removeLocalValue (AbstractPropertyType propertyType)
 Removes the local value associated with the property. More...
 
void copyLocalValues (const Object &other)
 Copies all local values from another object. More...
 
virtual void onPropertyChanged (AbstractPropertyType propertyType, KzuPropertyNotificationReason reason)
 Virtual function to handle property change notifications. More...
 
AppliedStyleEntryapplyObjectStyle (kanzi::StyleSharedPtr style)
 Applies a style to an object. More...
 
void unapplyObjectStyle (AppliedStyleEntry *appliedStyleEntry)
 
void applyObjectStyles ()
 Apply all styles for an object node. More...
 
void unapplyObjectStyles ()
 Unapplies and removes all applied styles. More...
 

Static Public Member Functions

static StateManagerSharedPtr create (Domain *domain, string_view name)
 Create a state manager. More...
 
static StateManagercreateEmpty (Domain *domain, string_view name)
 Create an empty state manager. More...
 
static void detach (const StateManagerRuntimeSharedPtr &stateManagerRuntime)
 Detach a state manager. More...
 
static void goToStateAsync (Node *objectNode, const StateSharedPtr &state, bool immediate)
 Attempt to go to a state. More...
 
static void goToState (Node *objectNode, string_view stateName, bool immediate)
 Attempt to go to a state. More...
 
static StateSharedPtr loadStateFromKZB (KzcInputStream *inputStream, Domain *domain, const KzuBinaryFileInfo *file, bool hasControlType)
 
static StateObjectSharedPtr loadStateObjectFromKZB (KzcInputStream *inputStream, Domain *domain, const KzuBinaryFileInfo *file)
 
static StateTransitionSharedPtr loadTransitionFromKZB (KzcInputStream *inputStream, Domain *domain, const KzuBinaryFileInfo *file)
 
static
StateTransitionAnimationSharedPtr 
loadTransitionAnimationFromKZB (KzcInputStream *inputStream, Domain *domain, const KzuBinaryFileInfo *file)
 
- Static Public Member Functions inherited from kanzi::Object
static const MetaclassgetStaticMetaclass ()
 Returns the metaclass of Object class. More...
 
static
PropertyTypeEditorInfoSharedPtr 
makeEditorInfo ()
 Default implementation that returns empty editor info. More...
 

Static Public Attributes

static MessageType
< GoToStateMessageArguments
GoToStateMessage
 
static MessageType
< GoToNextDefinedStateMessageArguments
GoToNextDefinedStateMessage
 
static MessageType
< GoToPreviousDefinedStateMessageArguments
GoToPreviousDefinedStateMessage
 
static MessageType
< EnteredStateMessageArguments
EnteredStateMessage
 
static MessageType
< LeftStateMessageArguments
LeftStateMessage
 
static MessageType
< TransitionStartedMessageArguments
TransitionStartedMessage
 
static MessageType
< TransitionFinishedMessageArguments
TransitionFinishedMessage
 

Protected Types

typedef shared_ptr
< StateGroupRuntime
StateGroupRuntimeSharedPtr
 
typedef shared_ptr< StateRuntimeStateRuntimeSharedPtr
 
typedef shared_ptr
< StateObjectRuntime
StateObjectRuntimeSharedPtr
 
typedef vector
< StateGroupRuntimeSharedPtr
StateGroupRuntimeContainer
 
typedef
StateGroupRuntimeContainer::const_iterator 
StateGroupRuntimeIterator
 
typedef vector
< StateRuntimeSharedPtr
StateRuntimeContainer
 
typedef
StateRuntimeContainer::const_iterator 
StateRuntimeIterator
 
typedef vector
< StateObjectRuntimeSharedPtr
StateObjectRuntimeContainer
 
typedef
StateObjectRuntimeContainer::iterator 
StateObjectRuntimeIterator
 
- Protected Types inherited from kanzi::Object
typedef vector
< AppliedStyleEntry * > 
AppliedStyleContainer
 Applied style container. More...
 

Protected Member Functions

 StateManager (Domain *domain, string_view name)
 
void cleanup ()
 Cleanup state manager internals. More...
 
- Protected Member Functions inherited from kanzi::Resource
KzuResourceLoadState getLoadState ()
 Access. More...
 
- Protected Member Functions inherited from kanzi::Object
void initialize ()
 
void onCopy (const Object &other)
 

Static Protected Member Functions

static
PropertyTypeEditorInfoSharedPtr 
makeEditorInfo ()
 
static kzsError stateGroupRuntimePropertyChangeCallback (const void *currentObject, const KzuPropertyType *propertyType, KzuPropertyNotificationReason reason, void *userData)
 Property change callback for state group. More...
 
static void goToStateHandler (StateManagerRuntime &stateManagerRuntime, GoToStateMessageArguments &goToStateMessage)
 Go to state message handler. More...
 
static void goToNextDefinedState (StateManagerRuntime &stateManagerRuntime, GoToNextDefinedStateMessageArguments &goToNextDefinedStateMessage)
 Go to next defined state message handler. More...
 
static void goToPreviousDefinedState (StateManagerRuntime &stateManagerRuntime, GoToPreviousDefinedStateMessageArguments &goToNextDefinedStateMessage)
 Go to previous defined state message handler. More...
 

Protected Attributes

StateGroupContainer m_groups
 
- Protected Attributes inherited from kanzi::Object
AppliedStyleContainer m_appliedStyles
 Listing of applied styles applied to this object. More...
 

Detailed Description

State manager for managing states of nodes or application.

Member Typedef Documentation

typedef shared_ptr<StateManagerRuntime> kanzi::StateManager::StateManagerRuntimeSharedPtr
typedef weak_ptr<StateManagerRuntime> kanzi::StateManager::StateManagerRuntimeWeakPtr
typedef StateGroupContainer::const_iterator kanzi::StateManager::StateGroupIterator
typedef StateContainer::const_iterator kanzi::StateManager::StateIterator
typedef StateTransitionContainer::const_iterator kanzi::StateManager::StateTransitionIterator
typedef StateTransitionAnimationContainer::const_iterator kanzi::StateManager::StateTransitionAnimationIterator
typedef StateObjectContainer::const_iterator kanzi::StateManager::StateObjectIterator
typedef StateGroupRuntimeContainer::const_iterator kanzi::StateManager::StateGroupRuntimeIterator
protected
typedef StateRuntimeContainer::const_iterator kanzi::StateManager::StateRuntimeIterator
protected
typedef StateObjectRuntimeContainer::iterator kanzi::StateManager::StateObjectRuntimeIterator
protected

Member Enumeration Documentation

State manager animation mode.

Enumerator
AnimationModeCustom 
AnimationModeLinear 
AnimationModeSmoothStep 
AnimationModeStep 
AnimationModeSmootherStep 
AnimationModeBack 
AnimationModeBounce 
AnimationModeCircle 
AnimationModeCubic 
AnimationModeElastic 
AnimationModeExponential 
AnimationModePower 
AnimationModeQuadratic 
AnimationModeQuartic 
AnimationModeQuintic 
AnimationModeSine 

State manager transition return time calculation type.

Enumerator
TransitionReturnTimeElapsed 

Play only elapsed time.

TransitionReturnTimeFull 

Always play full time.

Constructor & Destructor Documentation

kanzi::StateManager::StateManager ( Domain domain,
string_view  name 
)
inlineexplicitprotected

Member Function Documentation

static StateManagerSharedPtr kanzi::StateManager::create ( Domain domain,
string_view  name 
)
static

Create a state manager.

static StateManager* kanzi::StateManager::createEmpty ( Domain domain,
string_view  name 
)
static

Create an empty state manager.

void kanzi::StateManager::addStateGroup ( const StateGroupSharedPtr stateGroup)

Add new state group to state manager.

StateGroupIterator kanzi::StateManager::beginStateGroups ( ) const
inline

Returns an iterator to start of the state group container.

Returns
Iterator at the beginning of the container.
StateGroupIterator kanzi::StateManager::endStateGroups ( ) const
inline

Returns an iterator to end of the state group container.

Returns
Iterator at the end of the container.
StateManagerRuntimeSharedPtr kanzi::StateManager::attach ( Node objectNode)

Attach a state manager.

static void kanzi::StateManager::detach ( const StateManagerRuntimeSharedPtr stateManagerRuntime)
static

Detach a state manager.

static void kanzi::StateManager::goToStateAsync ( Node objectNode,
const StateSharedPtr state,
bool  immediate 
)
static

Attempt to go to a state.

static void kanzi::StateManager::goToState ( Node objectNode,
string_view  stateName,
bool  immediate 
)
static

Attempt to go to a state.

void kanzi::StateManager::loadFromKZB ( KzcInputStream inputStream,
const KzuBinaryFileInfo file 
)

Load a state manager from kzb.

static StateSharedPtr kanzi::StateManager::loadStateFromKZB ( KzcInputStream inputStream,
Domain domain,
const KzuBinaryFileInfo file,
bool  hasControlType 
)
static
static StateObjectSharedPtr kanzi::StateManager::loadStateObjectFromKZB ( KzcInputStream inputStream,
Domain domain,
const KzuBinaryFileInfo file 
)
static
static StateTransitionSharedPtr kanzi::StateManager::loadTransitionFromKZB ( KzcInputStream inputStream,
Domain domain,
const KzuBinaryFileInfo file 
)
static
static StateTransitionAnimationSharedPtr kanzi::StateManager::loadTransitionAnimationFromKZB ( KzcInputStream inputStream,
Domain domain,
const KzuBinaryFileInfo file 
)
static
static PropertyTypeEditorInfoSharedPtr kanzi::StateManager::makeEditorInfo ( )
staticprotected
void kanzi::StateManager::cleanup ( )
protected

Cleanup state manager internals.

static kzsError kanzi::StateManager::stateGroupRuntimePropertyChangeCallback ( const void *  currentObject,
const KzuPropertyType propertyType,
KzuPropertyNotificationReason  reason,
void *  userData 
)
staticprotected

Property change callback for state group.

static void kanzi::StateManager::goToStateHandler ( StateManagerRuntime &  stateManagerRuntime,
GoToStateMessageArguments goToStateMessage 
)
staticprotected

Go to state message handler.

static void kanzi::StateManager::goToNextDefinedState ( StateManagerRuntime &  stateManagerRuntime,
GoToNextDefinedStateMessageArguments goToNextDefinedStateMessage 
)
staticprotected

Go to next defined state message handler.

static void kanzi::StateManager::goToPreviousDefinedState ( StateManagerRuntime &  stateManagerRuntime,
GoToPreviousDefinedStateMessageArguments goToNextDefinedStateMessage 
)
staticprotected

Go to previous defined state message handler.

Member Data Documentation

MessageType<GoToStateMessageArguments> kanzi::StateManager::GoToStateMessage
static
MessageType<GoToNextDefinedStateMessageArguments> kanzi::StateManager::GoToNextDefinedStateMessage
static
MessageType<GoToPreviousDefinedStateMessageArguments> kanzi::StateManager::GoToPreviousDefinedStateMessage
static
MessageType<EnteredStateMessageArguments> kanzi::StateManager::EnteredStateMessage
static
MessageType<LeftStateMessageArguments> kanzi::StateManager::LeftStateMessage
static
MessageType<TransitionStartedMessageArguments> kanzi::StateManager::TransitionStartedMessage
static
MessageType<TransitionFinishedMessageArguments> kanzi::StateManager::TransitionFinishedMessage
static
StateGroupContainer kanzi::StateManager::m_groups
protected

The documentation for this class was generated from the following file: