Query.h
Go to the documentation of this file.
1#pragma once
2
3#include <RobotAPI/interface/armem/query.h>
9
11{
12 // #include <RobotAPI/libraries/armem/client/query/Builder.h>
13 class Builder;
14} // namespace armarx::armem::client::query
15
17{
19
20 /**
21 * @brief A query for parts of a memory.
22 */
24 {
25 /**
26 * @brief The queries.
27 */
28 armem::query::data::MemoryQuerySeq memoryQueries;
29 /**
30 * @brief Whether entity instance data (i.e., their payload) should be transferred.
31 */
33
34 static QueryInput fromIce(const armem::query::data::Input& ice);
35 armem::query::data::Input toIce() const;
36 };
37
38 /**
39 * @brief Result of a `QueryInput`.
40 *
41 * If `success` is false, an error occurred during the query. In this case, `errorMessage` can
42 * contain more information.
43 *
44 * @note An empty result is valid, i.e. successful. In other words, an empty result is not a
45 * failure. To check whether any entity snapshot matched the query, use `memory.hasSnapshots()`
46 * or `memory.hasInstances()`.
47 *
48 * @see wm::Memory::hasInstances(), wm::Memory::hasSnapshots()
49 */
51 {
52 /**
53 * @brief The slice of the memory that matched the query.
54 *
55 * To check whether the memory contains any snapshots or instances, use
56 * `memory.hasSnapshots()` or `memory.hasInstances()`.
57 */
59
60
61 static QueryResult fromIce(const armem::query::data::Result& ice);
62 armem::query::data::Result toIce() const;
63
64 friend std::ostream& operator<<(std::ostream& os, const QueryResult& rhs);
65 };
66
67 void toIce(armem::query::data::Input& ice, const QueryInput& input);
68 void fromIce(const armem::query::data::Input& ice, QueryInput& input);
69
70 void toIce(armem::query::data::Result& ice, const QueryResult& result);
71 void fromIce(const armem::query::data::Result& ice, QueryResult& result);
72
73} // namespace armarx::armem::client
The query::Builder class provides a fluent-style specification of hierarchical queries.
Definition Builder.h:22
This file is part of ArmarX.
void fromIce(const armem::query::data::Input &ice, QueryInput &input)
Definition Query.cpp:56
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::DataMode dataMode
Whether entity instance data (i.e., their payload) should be transferred.
Definition Query.h:32
static QueryInput fromIce(const armem::query::data::Input &ice)
Definition Query.cpp:14
armem::query::data::Input toIce() const
Definition Query.cpp:20
Result of a QueryInput.
Definition Query.h:51
friend std::ostream & operator<<(std::ostream &os, const QueryResult &rhs)
Definition Query.cpp:38
wm::Memory memory
The slice of the memory that matched the query.
Definition Query.h:58
static QueryResult fromIce(const armem::query::data::Result &ice)
Definition Query.cpp:26
armem::query::data::Result toIce() const
Definition Query.cpp:32