Utopia  2
Framework for studying models of complex & adaptive systems.
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. More...
 
using Tags = EntityTags
 Custom entity tags. More...
 
template<class EntityContainerType >
using CustomLinks = CustomLinkContainers< EntityContainerType >
 Template template parameter to specify type of custom links. More...
 

Static Public Attributes

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

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>
template<class EntityContainerType >
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: