Utopia  2
Framework for studying models of complex & adaptive systems.
Public Types | Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
Utopia::StateContainer< StateType, Update::sync > Class Template Reference

State Container specialization for sync states. More...

#include <state.hh>

Public Types

using State = StateType
 Type of state. More...
 

Public Member Functions

 StateContainer (const State state)
 Construct state container with specific state. More...
 
Statestate_new ()
 Return reference to state cache. More...
 
const Statestate () const
 Return const reference to state. More...
 
void update () noexcept
 Overwrite state with state cache. More...
 

Static Public Member Functions

static constexpr bool is_sync ()
 Export implementation type. More...
 

Private Attributes

State _state
 
State _state_new
 

Detailed Description

template<typename StateType>
class Utopia::StateContainer< StateType, Update::sync >

State Container specialization for sync states.

Warning
Using this specialization is discouraged because it determines the type of update used in apply_rule(). See Rules on Entities for details.

Member Typedef Documentation

◆ State

template<typename StateType >
using Utopia::StateContainer< StateType, Update::sync >::State = StateType

Type of state.

Constructor & Destructor Documentation

◆ StateContainer()

template<typename StateType >
Utopia::StateContainer< StateType, Update::sync >::StateContainer ( const State  state)
inline

Construct state container with specific state.

Member Function Documentation

◆ is_sync()

template<typename StateType >
static constexpr bool Utopia::StateContainer< StateType, Update::sync >::is_sync ( )
inlinestaticconstexpr

Export implementation type.

◆ state()

template<typename StateType >
const State& Utopia::StateContainer< StateType, Update::sync >::state ( ) const
inline

Return const reference to state.

◆ state_new()

template<typename StateType >
State& Utopia::StateContainer< StateType, Update::sync >::state_new ( )
inline

Return reference to state cache.

◆ update()

template<typename StateType >
void Utopia::StateContainer< StateType, Update::sync >::update ( )
inlinenoexcept

Overwrite state with state cache.

Member Data Documentation

◆ _state

template<typename StateType >
State Utopia::StateContainer< StateType, Update::sync >::_state
private

◆ _state_new

template<typename StateType >
State Utopia::StateContainer< StateType, Update::sync >::_state_new
private

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