Utopia 2
Framework for studying models of complex & adaptive systems.
Loading...
Searching...
No Matches
Public Types | Static Public Attributes | List of all members
Utopia::EntityTraits< StateType, update_mode, use_def_state_constr, EntityTags, CustomLinkContainers > Struct Template Reference

The entity traits struct gathers types to be used for specializing an entity. More...

#include <entity.hh>

Public Types

using State = StateType
 Type of the entitys' state container.
 
using Tags = EntityTags
 Custom entity tags.
 
template<class EntityContainerType >
using CustomLinks = CustomLinkContainers< EntityContainerType >
 Template template parameter to specify type of custom links.
 

Static Public Attributes

static constexpr Update mode = update_mode
 Whether the entitys should be synchronously updated.
 
static constexpr bool use_default_state_constructor = use_def_state_constr
 Whether to use the default constructor for constructing a entity state.
 

Detailed Description

template<typename StateType, Update update_mode, bool use_def_state_constr = false, typename EntityTags = EmptyTag, template< class > class CustomLinkContainers = NoCustomLinks>
struct Utopia::EntityTraits< StateType, update_mode, use_def_state_constr, EntityTags, CustomLinkContainers >

The entity traits struct gathers types to be used for specializing an entity.

Template Parameters
StateTypeType of the entitys' state container
update_modeThe update mode of the entities. Use Update::manual for choosing the update mode flexibly when calling apply_rule.
use_def_state_constrWhether to use the default constructor to construct the entity's state. If false (default), a constructor with DataIO::Config& as argument has to be implemented for StateType.
TagsCustom entity tags
CustomLinkContainersTemplate template parameter to specify the types of custom links. This construct is specialized with the actual type of the entity container by the EntityManager, so there's no need to know the entity container type beforehand. To define your own custom links, pass a template to a struct whose members are containers of the objects you want to link to.

Member Typedef Documentation

◆ CustomLinks

template<typename StateType , Update update_mode, bool use_def_state_constr = false, typename EntityTags = EmptyTag, template< class > class CustomLinkContainers = NoCustomLinks>
using Utopia::EntityTraits< StateType, update_mode, use_def_state_constr, EntityTags, CustomLinkContainers >::CustomLinks = CustomLinkContainers<EntityContainerType>

Template template parameter to specify type of custom links.

◆ State

template<typename StateType , Update update_mode, bool use_def_state_constr = false, typename EntityTags = EmptyTag, template< class > class CustomLinkContainers = NoCustomLinks>
using Utopia::EntityTraits< StateType, update_mode, use_def_state_constr, EntityTags, CustomLinkContainers >::State = StateType

Type of the entitys' state container.

◆ Tags

template<typename StateType , Update update_mode, bool use_def_state_constr = false, typename EntityTags = EmptyTag, template< class > class CustomLinkContainers = NoCustomLinks>
using Utopia::EntityTraits< StateType, update_mode, use_def_state_constr, EntityTags, CustomLinkContainers >::Tags = EntityTags

Custom entity tags.

Member Data Documentation

◆ mode

template<typename StateType , Update update_mode, bool use_def_state_constr = false, typename EntityTags = EmptyTag, template< class > class CustomLinkContainers = NoCustomLinks>
constexpr Update Utopia::EntityTraits< StateType, update_mode, use_def_state_constr, EntityTags, CustomLinkContainers >::mode = update_mode
staticconstexpr

Whether the entitys should be synchronously updated.

◆ use_default_state_constructor

template<typename StateType , Update update_mode, bool use_def_state_constr = false, typename EntityTags = EmptyTag, template< class > class CustomLinkContainers = NoCustomLinks>
constexpr bool Utopia::EntityTraits< StateType, update_mode, use_def_state_constr, EntityTags, CustomLinkContainers >::use_default_state_constructor = use_def_state_constr
staticconstexpr

Whether to use the default constructor for constructing a entity state.


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