Utopia 2
Framework for studying models of complex & adaptive systems.
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Private Attributes | List of all members
Utopia::GraphEntity< Traits > Class Template Reference

A graph entity is a slightly specialized state container. More...

#include <entity.hh>

Inheritance diagram for Utopia::GraphEntity< Traits >:
Inheritance graph
[legend]
Collaboration diagram for Utopia::GraphEntity< Traits >:
Collaboration graph
[legend]

Public Types

using Self = GraphEntity< Traits >
 The type of this GraphEntity.
 
using State = typename Traits::State
 The type of the state.
 
- Public Types inherited from Utopia::Entity< GraphEntity< Traits >, Traits >
using Traits = Traits
 The traits of this entity.
 
using Self = Entity< GraphEntity< Traits >, Traits >
 The type of this entity.
 
using State = typename Traits::State
 The type of the state of this entity.
 
using Tags = typename Traits::Tags
 The tags associated with this entity.
 
using CustomLinkContainers = typename Traits::template CustomLinks< EntityContainer< GraphEntity< Traits > > >
 A construct that has as members containers for custom-linked entities.
 

Public Member Functions

 GraphEntity ()
 Construct a graph entity with empty initial state.
 
 GraphEntity (const State &initial_state)
 Construct a graph entity with initial state.
 
 GraphEntity (const GraphEntity &ge)
 Copy-construct a graph entity.
 
GraphEntityoperator= (GraphEntity ge)
 Copy-assign a graph entity.
 
IndexType get_id_counter ()
 Get the id counter.
 
- Public Member Functions inherited from Utopia::Entity< GraphEntity< Traits >, Traits >
 Entity (const IndexType id, const State initial_state)
 Construct an entity.
 
const IndexTypeid () const
 Return const reference to entity ID.
 
CustomLinkContainerscustom_links ()
 Return reference to custom link containers.
 
const CustomLinkContainerscustom_links () const
 Return const reference to custom link containers.
 

Static Private Attributes

static IndexType id_counter = 0
 The id counter that counts how many graph entities exist.
 

Additional Inherited Members

- Static Public Attributes inherited from Utopia::Entity< GraphEntity< Traits >, Traits >
static constexpr Update mode
 Whether this entity is updated synchronously.
 

Detailed Description

template<typename Traits>
class Utopia::GraphEntity< Traits >

A graph entity is a slightly specialized state container.

It can be extended with the use of tags and can be associated with so-called "custom links". These specializations are carried into the graph entity by means of the GraphEntityTraits struct. A graph entity should be used as the base class for a Vertex and an Edge that is placed on a boost::graph graph object.

Template Parameters
TraitsValid Utopia::EntityTraits, describing the type of graph entity

Member Typedef Documentation

◆ Self

The type of this GraphEntity.

◆ State

template<typename Traits >
using Utopia::GraphEntity< Traits >::State = typename Traits::State

The type of the state.

Constructor & Destructor Documentation

◆ GraphEntity() [1/3]

template<typename Traits >
Utopia::GraphEntity< Traits >::GraphEntity ( )
inline

Construct a graph entity with empty initial state.

57 :
59 {};
typename Traits::State State
The type of the state.
Definition entity.hh:48
static IndexType id_counter
The id counter that counts how many graph entities exist.
Definition entity.hh:52
Container select_entities(const Manager &mngr, const DataIO::Config &sel_cfg)
Select entities according to parameters specified in a configuration.
Definition select.hh:213

◆ GraphEntity() [2/3]

template<typename Traits >
Utopia::GraphEntity< Traits >::GraphEntity ( const State initial_state)
inline

Construct a graph entity with initial state.

◆ GraphEntity() [3/3]

template<typename Traits >
Utopia::GraphEntity< Traits >::GraphEntity ( const GraphEntity< Traits > &  ge)
inline

Copy-construct a graph entity.

68 :
70 {};

Member Function Documentation

◆ get_id_counter()

template<typename Traits >
IndexType Utopia::GraphEntity< Traits >::get_id_counter ( )
inline

Get the id counter.

80 {
81 return id_counter;
82 }

◆ operator=()

Copy-assign a graph entity.

73 {
74 std::swap(this->state, ge.state);
75 std::swap(this->custom_links(), ge.custom_links());
76 return *this;
77 }
CustomLinkContainers & custom_links()
Return reference to custom link containers.
Definition entity.hh:139

Member Data Documentation

◆ id_counter

template<typename Traits >
IndexType Utopia::GraphEntity< Traits >::id_counter = 0
inlinestaticprivate

The id counter that counts how many graph entities exist.


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