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 
16 namespace armarx::armem::client
17 {
18  using QueryBuilder = query::Builder;
19 
20  /**
21  * @brief A query for parts of a memory.
22  */
23  struct QueryInput
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
armarx::armem::client::fromIce
void fromIce(const armem::query::data::Input &ice, QueryInput &input)
Definition: Query.cpp:53
armarx::armem::client::QueryResult::memory
wm::Memory memory
The slice of the memory that matched the query.
Definition: Query.h:58
armarx::armem::client::QueryBuilder
query::Builder QueryBuilder
Definition: forward_declarations.h:19
armarx::armem::client
This file is part of ArmarX.
Definition: forward_declarations.h:7
armarx::armem::client::QueryResult
Result of a QueryInput.
Definition: Query.h:50
armarx::armem::client::QueryInput::dataMode
armem::query::DataMode dataMode
Whether entity instance data (i.e., their payload) should be transferred.
Definition: Query.h:32
armarx::armem::client::QueryInput::fromIce
static QueryInput fromIce(const armem::query::data::Input &ice)
Definition: Query.cpp:15
armarx::armem::server::wm::Memory
Definition: memory_definitions.h:136
armarx::armem::client::query
Definition: forward_declarations.h:7
armarx::armem::query::DataMode
DataMode
Definition: DataMode.h:7
armarx::armem::client::QueryInput
A query for parts of a memory.
Definition: Query.h:23
armarx::aron::input
ReaderT::InputType & input
Definition: rw.h:19
armarx::armem::client::QueryInput::memoryQueries
armem::query::data::MemoryQuerySeq memoryQueries
The queries.
Definition: Query.h:28
armarx::armem::detail::SuccessHeader
Definition: SuccessHeader.h:13
SuccessHeader.h
memory_definitions.h
armarx::armem::client::QueryResult::toIce
armem::query::data::Result toIce() const
Definition: Query.cpp:30
armarx::armem::client::QueryResult::operator<<
friend std::ostream & operator<<(std::ostream &os, const QueryResult &rhs)
Definition: Query.cpp:35
armarx::armem::client::QueryResult::fromIce
static QueryResult fromIce(const armem::query::data::Result &ice)
Definition: Query.cpp:25
armarx::armem::client::QueryInput::toIce
armem::query::data::Input toIce() const
Definition: Query.cpp:20
armarx::armem::client::toIce
void toIce(armem::query::data::Input &ice, const QueryInput &input)
Definition: Query.cpp:47
DataMode.h
ice_conversions.h
QueryTarget.h