Skip to content
Snippets Groups Projects
Commit d88c0e7d authored by Rainer Kartmann's avatar Rainer Kartmann
Browse files

Merge branch 'feature/memory-find-latest-instance' into feature/memory-entity-instance-with-arondto

parents 8db21b21 4cd199ed
No related branches found
No related tags found
No related merge requests found
......@@ -142,7 +142,7 @@ set(HEADERS
ArVizStorage.h
)
armarx_add_component_executable("${SOURCES}" "${HEADERS}")
armarx_add_component_executable("${SOURCES};${HEADERS}" "${HEADERS}")
add_subdirectory(Example)
......
#pragma once
// RobotAPI
#include <RobotAPI/interface/armem/query.h>
#include <RobotAPI/libraries/armem/core/wm/ice_conversions.h>
#include <RobotAPI/libraries/armem/core/SuccessHeader.h>
#include <RobotAPI/libraries/armem/core/query/DataMode.h>
#include <RobotAPI/libraries/armem/core/query/QueryTarget.h>
#include <RobotAPI/libraries/armem/core/wm/ice_conversions.h>
#include <RobotAPI/libraries/armem/core/wm/memory_definitions.h>
namespace armarx::armem::client::query
{
// #include <RobotAPI/libraries/armem/client/query/Builder.h>
class Builder;
}
} // namespace armarx::armem::client::query
namespace armarx::armem::client
{
using QueryBuilder = query::Builder;
/**
* @brief An update of an entity for a specific point in time.
* @brief A query for parts of a memory.
*/
struct QueryInput
{
/**
* @brief The queries.
*/
armem::query::data::MemoryQuerySeq memoryQueries;
/**
* @brief Whether entity instance data (i.e., their payload) should be transferred.
*/
armem::query::DataMode dataMode;
static QueryInput fromIce(const armem::query::data::Input& ice);
armem::query::data::Input toIce() const;
};
/**
* @brief Result of an `EntityUpdate`.
* @brief Result of a `QueryInput`.
*
* If `success` is false, an error occurred during the query. In this case, `errorMessage` can
* contain more information.
*
* @note An empty result is valid, i.e. successful. In other words, an empty result is not a
* failure. To check whether any entity snapshot matched the query, use `memory.hasSnapshots()`
* or `memory.hasInstances()`.
*
* @see wm::Memory::hasInstances(), wm::Memory::hasSnapshots()
*/
struct QueryResult : public detail::SuccessHeader
{
/**
* @brief The slice of the memory that matched the query.
*
* To check whether the memory contains any snapshots or instances, use
* `memory.hasSnapshots()` or `memory.hasInstances()`.
*/
wm::Memory memory;
......@@ -48,11 +64,10 @@ namespace armarx::armem::client
friend std::ostream& operator<<(std::ostream& os, const QueryResult& rhs);
};
void toIce(armem::query::data::Input& ice, const QueryInput& input);
void fromIce(const armem::query::data::Input& ice, QueryInput& input);
void toIce(armem::query::data::Result& ice, const QueryResult& result);
void fromIce(const armem::query::data::Result& ice, QueryResult& result);
}
} // namespace armarx::armem::client
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment