memory_definitions.h
Go to the documentation of this file.
1 #pragma once
2 
10 
12 
13 namespace armarx::armem::wm
14 {
15  /**
16  * @brief Client-side working memory entity instance metadata.
17  */
19  /**
20  * @brief Client-side working memory entity instance data (payload).
21  */
23  /**
24  * @brief Pointer type of EntityInstanceData.
25  */
27 
28  /**
29  * @brief Client-side working entity instance.
30  * @see base::EntityInstanceBase
31  */
33  public base::EntityInstanceBase<EntityInstanceDataPtr, EntityInstanceMetadata>
34  {
36 
37  public:
39 
40  /**
41  * @brief Fill `*this` with the update's values.
42  * @param update The update.
43  * @param index The instances index.
44  */
45  void update(const EntityUpdate& update);
46 
47  bool equalsDeep(const EntityInstance& other) const;
48  };
49 
50  /**
51  * @brief Entity instance with a concrete ARON DTO type as data.
52  *
53  * This is the return type of EntityInstance::withDataAs<AronDtoT>().
54  *
55  * Usage example:
56  * @code
57  * #include <RobotAPI/libraries/aron/common/aron/time.aron.generated.h>
58  *
59  * armarx::arondto::Duration duration;
60  * duration.microSeconds = 1000;
61  *
62  * armarx::armem::wm::EntityInstance instance;
63  * instance.data() = duration.toAron();
64  *
65  * const armarx::armem::wm::EntityInstanceBase<armarx::arondto::Duration> cast =
66  * instance.withDataAs<armarx::arondto::Duration>();
67  *
68  * const armarx::arondto::Duration& durationOut = cast.data();
69  *
70  * assert(durationOut.microseconds == 1000);
71  * @endcode
72  */
73  template <class AronDtoT>
75 
76  /**
77  * @brief Client-side working memory entity snapshot.
78  * @see base::EntitySnapshotBase
79  */
81  public base::EntitySnapshotBase<EntityInstance, EntitySnapshot>,
82  public detail::FindInstanceDataMixinForSnapshot<EntitySnapshot>
83 
84  {
85  public:
87  };
88 
89  /**
90  * @brief Client-side working memory entity.
91  * @see base::EntityBase
92  */
93  class Entity :
94  public base::EntityBase<EntitySnapshot, Entity>,
96  {
97  public:
99  };
100 
101  /**
102  * @brief Client-side working memory provider segment.
103  * @see base::ProviderSegmentBase
104  */
106  public base::ProviderSegmentBase<Entity, ProviderSegment>,
107  public detail::FindInstanceDataMixin<ProviderSegment>
108  {
110 
111  public:
113  };
114 
115  /**
116  * @brief Client-side working memory core segment.
117  * @see base::CoreSegmentBase
118  */
119  class CoreSegment :
120  public base::CoreSegmentBase<ProviderSegment, CoreSegment>,
121  public detail::FindInstanceDataMixin<CoreSegment>
122  {
124 
125  public:
126  using Base::CoreSegmentBase;
127  };
128 
129  /**
130  * @brief Client-side working memory.
131  * @see base::MemoryBase
132  */
133  class Memory :
134  public base::MemoryBase<CoreSegment, Memory>,
135  public detail::FindInstanceDataMixin<Memory>
136  {
138 
139  public:
140  using Base::MemoryBase;
141  };
142 
143 } // namespace armarx::armem::wm
armarx::armem::base::ProviderSegmentBase
Data of a provider segment containing multiple entities.
Definition: ProviderSegmentBase.h:22
armarx::armem::base::CoreSegmentBase< ProviderSegment, CoreSegment >::CoreSegmentBase
CoreSegmentBase()
Definition: CoreSegmentBase.h:68
EntitySnapshotBase.h
armarx::armem::base::MemoryBase< CoreSegment, Memory >::MemoryBase
MemoryBase()
Definition: MemoryBase.h:67
armarx::armem::wm::ProviderSegment
Client-side working memory provider segment.
Definition: memory_definitions.h:105
MemoryBase.h
armarx::armem::wm::EntityInstance
Client-side working entity instance.
Definition: memory_definitions.h:32
armarx::armem::base::EntitySnapshotBase
Data of an entity at one point in time.
Definition: EntitySnapshotBase.h:24
EntityInstanceBase.h
armarx::armem::wm::detail::FindInstanceDataMixin
Definition: data_lookup_mixins.h:81
armarx::armem::base::EntityBase
An entity over a period of time.
Definition: EntityBase.h:43
armarx::armem::wm
Definition: MemoryNameSystem.h:46
armarx::armem::base::CoreSegmentBase
Data of a core segment containing multiple provider segments.
Definition: CoreSegmentBase.h:22
ProviderSegmentBase.h
armarx::armem::wm::CoreSegment
Client-side working memory core segment.
Definition: memory_definitions.h:119
armarx::armem::wm::Memory
Client-side working memory.
Definition: memory_definitions.h:133
EntityBase.h
armarx::armem::EntityUpdate
An update of an entity for a specific point in time.
Definition: Commit.h:27
armarx::armem::wm::EntityInstance::equalsDeep
bool equalsDeep(const EntityInstance &other) const
Definition: memory_definitions.cpp:16
forward_declarations.h
armarx::armem::wm::detail::FindInstanceDataMixinForEntity
Definition: data_lookup_mixins.h:58
armarx::armem::base::MemoryBase
Data of a memory consisting of multiple core segments.
Definition: MemoryBase.h:19
armarx::armem::wm::EntitySnapshot
Client-side working memory entity snapshot.
Definition: memory_definitions.h:80
armarx::armem::base::EntityInstanceBase< EntityInstanceDataPtr, EntityInstanceMetadata >::EntityInstanceBase
EntityInstanceBase()
Definition: EntityInstanceBase.h:88
armarx::armem::base::EntityInstanceBase
Data of a single entity instance.
Definition: EntityInstanceBase.h:80
armarx::aron::data::DictPtr
std::shared_ptr< Dict > DictPtr
Definition: Dict.h:41
armarx::armem::base::ProviderSegmentBase< Entity, ProviderSegment >::ProviderSegmentBase
ProviderSegmentBase()
Definition: ProviderSegmentBase.h:60
armarx::armem::base::EntityInstanceMetadata
Metadata of an entity instance.
Definition: EntityInstanceBase.h:34
CoreSegmentBase.h
data_lookup_mixins.h
armarx::armem::wm::Entity
Client-side working memory entity.
Definition: memory_definitions.h:93
armarx::armem::server::wm::EntityInstanceMetadata
base::EntityInstanceMetadata EntityInstanceMetadata
Definition: memory_definitions.h:21
armarx::armem::wm::EntityInstance::update
void update(const EntityUpdate &update)
Fill *this with the update's values.
Definition: memory_definitions.cpp:30
armarx::armem::wm::detail::FindInstanceDataMixinForSnapshot
Definition: data_lookup_mixins.h:35
armarx::armem::wm::EntityInstanceDataPtr
armarx::aron::data::DictPtr EntityInstanceDataPtr
Pointer type of EntityInstanceData.
Definition: memory_definitions.h:26
armarx::aron::data::Dict
Definition: Dict.h:44