wm.h
Go to the documentation of this file.
1 #pragma once
2 
6 
7 #include "detail/MemoryQueryProcessorBase.h"
8 #include "detail/CoreSegmentQueryProcessorBase.h"
9 #include "detail/ProviderSegmentQueryProcessorBase.h"
10 #include "detail/EntityQueryProcessorBase.h"
11 
13 {
14 
16  {
17  public:
18 
20 
21 
22  protected:
23 
25 
26  };
27 
28 
29 
30  template <class SourceEntityT>
32  public EntityQueryProcessorBase<SourceEntityT, armem::wm::Entity>,
33  public HasDataMode
34  {
35  protected:
36 
39 
40 
41  public:
42 
45  {}
46 
47  using Base::process;
48 
49  protected:
50 
51  void addResultSnapshot(armem::wm::Entity& result, const typename SourceEntityT::EntitySnapshotT& snapshot) const
52  {
53  bool withData = (dataMode == armem::query::DataMode::WithData);
54  if (withData)
55  {
56  Base::addResultSnapshot(result, snapshot);
57  }
58  else
59  {
60  // 1. access real data
61  snapshot.forEachInstance([](const server::wm::EntityInstance& i)
62  {
63  i.metadata().access();
64  });
65 
66  // 2. create copy and remove data from copy
68  copy.forEachInstance([](server::wm::EntityInstance & i)
69  {
70  i.data() = nullptr;
71  });
72  result.addSnapshot(std::move(copy));
73  }
74  }
75 
76  };
77 }
78 
79 
81 {
82 
84 
86  public detail::ProviderSegmentQueryProcessorBase<armem::wm::ProviderSegment, armem::wm::ProviderSegment, EntityQueryProcessor>,
87  public detail::HasDataMode
88  {
89  protected:
90 
94 
95 
96  public:
97 
99 
100  using Base::process;
101  };
102 
103 
105  public detail::CoreSegmentQueryProcessorBase <armem::wm::CoreSegment, armem::wm::CoreSegment, ProviderSegmentQueryProcessor>,
106  public detail::HasDataMode
107  {
108  protected:
109 
113 
114 
115  public:
116 
118 
119  using Base::process;
120 
121  };
122 
123 
125  public detail::MemoryQueryProcessorBase<armem::wm::Memory, armem::wm::Memory, CoreSegmentQueryProcessor>,
126  public detail::HasDataMode
127  {
128  protected:
129 
133 
134 
135  public:
136 
138 
139  using Base::process;
140 
141  };
142 
143 }
144 
145 
147 {
148 
150 
151 
153  public wm::detail::ProviderSegmentQueryProcessorBase<server::wm::ProviderSegment, armem::wm::ProviderSegment, EntityQueryProcessor>,
155  {
156  protected:
157 
161 
162  public:
163 
165 
166  };
167 
168 
170  public wm::detail::CoreSegmentQueryProcessorBase <server::wm::CoreSegment, armem::wm::CoreSegment, ProviderSegmentQueryProcessor>,
172  {
173  protected:
174 
178 
179 
180  public:
181 
183 
184  using Base::process;
185 
186  /// Locks the core segment, then delegates back to `CoreSegmentQueryProcessorBase`.
187  void process(
188  armem::wm::CoreSegment& result,
189  const armem::query::data::CoreSegmentQuery& query,
190  const CoreSegment& coreSegment) const override;
191 
192  };
193 
194 
196  public wm::detail::MemoryQueryProcessorBase<server::wm::Memory, armem::wm::Memory, CoreSegmentQueryProcessor>,
198  {
199  protected:
200 
204 
205  public:
206 
208 
209  using Base::process;
210  };
211 
212 }
armarx::armem::server::query_proc::wm::detail::ProviderSegmentQueryProcessorBase
Definition: ProviderSegmentQueryProcessorBase.h:10
armarx::armem::wm::ProviderSegment
Client-side working memory provider segment.
Definition: memory_definitions.h:105
armarx::armem::server::query_proc::wm::detail::EntityQueryProcessor
Definition: wm.h:31
armarx::armem::wm::EntityInstance
Client-side working entity instance.
Definition: memory_definitions.h:32
armarx::armem::server::query_proc::base::ProviderSegmentQueryProcessorBase< armem::wm::ProviderSegment, armem::wm::ProviderSegment, EntityQueryProcessor >::process
virtual void process(ResultProviderSegmentT &result, const armem::query::data::ProviderSegmentQuery &query, const ProviderSegmentT &providerSegment) const override
Definition: ProviderSegmentQueryProcessorBase.h:46
armarx::armem::query::DataMode::WithData
@ WithData
Get structure and ARON data.
armarx::armem::server::query_proc::wm::detail::MemoryQueryProcessorBase
Definition: MemoryQueryProcessorBase.h:10
armarx::armem::server::query_proc::wm_server::CoreSegmentQueryProcessor
Definition: wm.h:169
armarx::armem::server::query_proc::wm_server::MemoryQueryProcessor
Definition: wm.h:195
armarx::armem::server::query_proc::base::EntityQueryProcessorBase< SourceEntityT, armem::wm::Entity >::process
virtual void process(ResultEntityT &result, const armem::query::data::EntityQuery &query, const EntityT &entity) const override
Definition: EntityQueryProcessorBase.h:45
armarx::armem::server::wm::Entity
Definition: memory_definitions.h:30
armarx::armem::base::EntityBase::addSnapshot
EntitySnapshotT & addSnapshot(const Time &timestamp)
Add a snapshot at the given time.
Definition: EntityBase.h:629
armarx::armem::server::query_proc::wm_server::CoreSegmentQueryProcessor::process
void process(armem::wm::CoreSegment &result, const armem::query::data::CoreSegmentQuery &query, const CoreSegment &coreSegment) const override
Locks the core segment, then delegates back to CoreSegmentQueryProcessorBase.
Definition: wm.cpp:55
memory_definitions.h
armarx::armem::server::query_proc::wm::detail::EntityQueryProcessorBase< SourceEntityT, armem::wm::Entity >::addResultSnapshot
void addResultSnapshot(ResultEntityT &result, const EntitySnapshotT &snapshot) const override
Definition: EntityQueryProcessorBase.h:34
armarx::armem::server::wm::Memory
Definition: memory_definitions.h:136
armarx::armem::server::query_proc::wm::CoreSegmentQueryProcessor
Definition: wm.h:104
armarx::armem::server::query_proc::base::MemoryQueryProcessorBase< armem::wm::Memory, armem::wm::Memory, CoreSegmentQueryProcessor >::process
ResultMemoryT process(const armem::query::data::Input &input, const MemoryT &memory) const
Definition: MemoryQueryProcessorBase.h:43
armarx::armem::query::DataMode
DataMode
Definition: DataMode.h:7
copy
Use of this software is granted under one of the following two to be chosen freely by the user Boost Software License Version Marcin Kalicinski Permission is hereby free of to any person or organization obtaining a copy of the software and accompanying documentation covered by this and transmit the and to prepare derivative works of the and to permit third parties to whom the Software is furnished to do all subject to the including the above license this restriction and the following must be included in all copies of the in whole or in and all derivative works of the unless such copies or derivative works are solely in the form of machine executable object code generated by a source language processor THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF FITNESS FOR A PARTICULAR TITLE AND NON INFRINGEMENT IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN TORT OR ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE The MIT Marcin Kalicinski Permission is hereby free of to any person obtaining a copy of this software and associated documentation to deal in the Software without including without limitation the rights to copy
Definition: license.txt:39
armarx::armem::server::query_proc::wm_server::CoreSegmentQueryProcessor::CoreSegmentQueryProcessor
CoreSegmentQueryProcessor(armem::query::DataMode dataMode=armem::query::DataMode::WithData)
Definition: wm.cpp:48
armarx::armem::server::query_proc::wm_server::ProviderSegmentQueryProcessor::ProviderSegmentQueryProcessor
ProviderSegmentQueryProcessor(armem::query::DataMode dataMode=armem::query::DataMode::WithData)
Definition: wm.cpp:42
armarx::armem::wm::CoreSegment
Client-side working memory core segment.
Definition: memory_definitions.h:119
armarx::armem::server::query_proc::wm::detail::EntityQueryProcessor::addResultSnapshot
void addResultSnapshot(armem::wm::Entity &result, const typename SourceEntityT::EntitySnapshotT &snapshot) const
Definition: wm.h:51
armarx::armem::wm::Memory
Client-side working memory.
Definition: memory_definitions.h:133
armarx::armem::server::query_proc::wm_server::MemoryQueryProcessor::MemoryQueryProcessor
MemoryQueryProcessor(armem::query::DataMode dataMode=armem::query::DataMode::WithData)
Definition: wm.cpp:67
armarx::armem::server::query_proc::wm::detail::CoreSegmentQueryProcessorBase
Handles memory queries.
Definition: CoreSegmentQueryProcessorBase.h:13
armarx::armem::wm::EntitySnapshot
Client-side working memory entity snapshot.
Definition: memory_definitions.h:80
armarx::armem::server::query_proc::wm::CoreSegmentQueryProcessor::CoreSegmentQueryProcessor
CoreSegmentQueryProcessor(armem::query::DataMode dataMode=armem::query::DataMode::WithData)
Definition: wm.cpp:26
armarx::armem::server::wm::ProviderSegment
Definition: memory_definitions.h:60
armarx::armem::server::query_proc::wm::ProviderSegmentQueryProcessor
Definition: wm.h:85
memory_definitions.h
armarx::armem::server::query_proc::wm::ProviderSegmentQueryProcessor::ProviderSegmentQueryProcessor
ProviderSegmentQueryProcessor(armem::query::DataMode dataMode=armem::query::DataMode::WithData)
Definition: wm.cpp:19
armarx::armem::server::query_proc::wm::detail::EntityQueryProcessorBase
Definition: EntityQueryProcessorBase.h:11
armarx::armem::server::query_proc::wm_server::ProviderSegmentQueryProcessor
Definition: wm.h:152
armarx::armem::server::wm::CoreSegment
base::CoreSegmentBase
Definition: memory_definitions.h:86
armarx::armem::server::query_proc::wm_server
Definition: wm.cpp:40
armarx::armem::server::query_proc::wm::detail::HasDataMode::dataMode
armem::query::DataMode dataMode
Definition: wm.h:24
armarx::armem::server::query_proc::wm
Definition: CoreSegmentQueryProcessorBase.cpp:3
armarx::armem::server::query_proc::wm::detail::EntityQueryProcessor::EntityQueryProcessor
EntityQueryProcessor(armem::query::DataMode dataMode=armem::query::DataMode::WithData)
Definition: wm.h:43
armarx::armem::server::query_proc::base::CoreSegmentQueryProcessorBase< armem::wm::CoreSegment, armem::wm::CoreSegment, ProviderSegmentQueryProcessor >::process
virtual void process(ResultCoreSegmentT &result, const armem::query::data::CoreSegmentQuery &query, const CoreSegmentT &coreSegment) const override
Definition: CoreSegmentQueryProcessorBase.h:48
armarx::armem::server::query_proc::wm::MemoryQueryProcessor::MemoryQueryProcessor
MemoryQueryProcessor(armem::query::DataMode dataMode=armem::query::DataMode::WithData)
Definition: wm.cpp:32
armarx::armem::wm::Entity
Client-side working memory entity.
Definition: memory_definitions.h:93
armarx::armem::base::EntityInstanceBase::metadata
MetadataT & metadata()
Definition: EntityInstanceBase.h:117
armarx::armem::base::EntityInstanceBase::data
const DataT & data() const
Definition: EntityInstanceBase.h:129
armarx::armem::server::query_proc::wm::detail
Definition: CoreSegmentQueryProcessorBase.cpp:3
armarx::armem::server::query_proc::wm::MemoryQueryProcessor
Definition: wm.h:124
armarx::armem::server::query_proc::wm::detail::HasDataMode::HasDataMode
HasDataMode(armem::query::DataMode dataMode)
Definition: wm.cpp:9
armarx::armem::server::query_proc::wm::detail::HasDataMode
Definition: wm.h:15
DataMode.h