Builder.cpp
Go to the documentation of this file.
1#include "Builder.h"
2
4{
5
10
13 {
14 QueryInput input;
16 input.dataMode = dataMode;
17 return input;
18 }
19
20 armem::query::data::Input
22 {
23 return buildQueryInput().toIce();
24 }
25
26 armem::query::data::MemoryQuerySeq
28 {
29 armem::query::data::MemoryQuerySeq memoryQueries;
30 for (const CoreSegmentSelector& child : _children)
31 {
32 for (armem::query::data::MemoryQueryPtr& query : child.buildQueries())
33 {
34 toIce(query->target, queryTarget);
35 memoryQueries.push_back(query);
36 }
37 }
38 return memoryQueries;
39 }
40
43 {
44 return _addChild();
45 }
46
49 {
50 return _addChild(selector);
51 }
52
53 void
58
59 void
64
65 void
66 Builder::allInCoreSegment(const MemoryID& coreSegmentID)
67 {
69 .withName(coreSegmentID.coreSegmentName)
71 .all()
72 .entities()
73 .all()
74 .snapshots()
75 .all();
76 }
77
78 void
80 {
82 .withName(coreSegmentID.coreSegmentName)
84 .all()
85 .entities()
86 .all()
87 .snapshots()
88 .latest();
89 }
90
91 void
92 Builder::allInProviderSegment(const MemoryID& providerSegmentID)
93 {
95 .withName(providerSegmentID.coreSegmentName)
97 .withName(providerSegmentID.providerSegmentName)
98 .entities()
99 .all()
100 .snapshots()
101 .all();
102 }
103
104 void
106 {
108 .withName(providerSegmentID.coreSegmentName)
110 .withName(providerSegmentID.providerSegmentName)
111 .entities()
112 .all()
113 .snapshots()
114 .latest();
115 }
116
117 void
119 {
121 .withName(entityID.coreSegmentName)
124 .entities()
125 .withName(entityID.entityName)
126 .snapshots()
127 .all();
128 }
129
130 void
132 {
134 .withName(entityID.coreSegmentName)
137 .entities()
138 .withName(entityID.entityName)
139 .snapshots()
140 .latest();
141 }
142
143 void
145 {
147 .withName(snapshotID.coreSegmentName)
149 .withName(snapshotID.providerSegmentName)
150 .entities()
151 .withName(snapshotID.entityName)
152 .snapshots()
153 .atTime(snapshotID.timestamp);
154 }
155
156 void
157 Builder::multipleEntitySnapshots(const std::vector<MemoryID>& snapshotIDs)
158 {
159 for (const MemoryID& snapshotID : snapshotIDs)
160 {
161 singleEntitySnapshot(snapshotID);
162 }
163 }
164
165} // namespace armarx::armem::client::query
std::string coreSegmentName
Definition MemoryID.h:51
std::string entityName
Definition MemoryID.h:53
std::string providerSegmentName
Definition MemoryID.h:52
void allInCoreSegment(const MemoryID &coreSegmentID)
Get all snapshots from all entities in all provider segments in a core segment.
Definition Builder.cpp:66
void allLatestInProviderSegment(const MemoryID &providerSegmentID)
Get latest snapshots from all entities in a provider segment.
Definition Builder.cpp:105
void multipleEntitySnapshots(const std::vector< MemoryID > &snapshotIDs)
Definition Builder.cpp:157
void singleEntitySnapshot(const MemoryID &snapshotID)
Definition Builder.cpp:144
void latestEntitySnapshot(const MemoryID &entityID)
Definition Builder.cpp:131
armem::query::data::MemoryQuerySeq buildMemoryQueries() const
Definition Builder.cpp:27
void all()
Get all snapshots from all entities in all segments.
Definition Builder.cpp:54
armem::query::DataMode dataMode
Definition Builder.h:69
Builder(armem::query::DataMode dataMode=armem::query::DataMode::WithData, armem::query::QueryTarget target=armem::query::QueryTarget::WM)
Definition Builder.cpp:6
armem::query::data::Input buildQueryInputIce() const
Definition Builder.cpp:21
void allInProviderSegment(const MemoryID &providerSegmentID)
Get all snapshots from all entities in a provider segment.
Definition Builder.cpp:92
armem::query::QueryTarget queryTarget
Definition Builder.h:70
void allLatest()
Get all latest snapshots from entities in all segments.
Definition Builder.cpp:60
void allLatestInCoreSegment(const MemoryID &coreSegmentID)
Get latest snapshots from all entities in all provider segments in a core segment.
Definition Builder.cpp:79
void allEntitySnapshots(const MemoryID &entityID)
Definition Builder.cpp:118
CoreSegmentSelector & coreSegments()
Start specifying core segments.
Definition Builder.cpp:42
CoreSegmentSelector & withName(const std::string &name) override
ProviderSegmentSelector & providerSegments()
Start specifying provider segments.
EntitySelector & withName(const std::string &name) override
SnapshotSelector & snapshots()
Start specifying entity snapshots.
Definition selectors.cpp:92
ProviderSegmentSelector & withName(const std::string &name) override
EntitySelector & entities()
Start specifying entities.
ProviderSegmentSelector & all() override
SnapshotSelector & atTime(Time timestamp)
Definition selectors.cpp:38
void toIce(armem::query::data::Input &ice, const QueryInput &input)
Definition Query.cpp:49
A query for parts of a memory.
Definition Query.h:24
armem::query::data::MemoryQuerySeq memoryQueries
The queries.
Definition Query.h:28
armem::query::data::Input toIce() const
Definition Query.cpp:20