|
Reads data from a memory server. More...
#include <RobotAPI/libraries/armem/client/Reader.h>
Public Member Functions | |
server::dto::DirectlyStoreResult | directlyStore (const server::dto::DirectlyStoreInput &input) const |
QueryResult | getAll (armem::query::DataMode dataMode=armem::query::DataMode::WithData) const |
Get the whole memory content. More... | |
QueryResult | getAllLatestSnapshots (armem::query::DataMode dataMode=armem::query::DataMode::WithData) const |
Get all latest snapshots in the memory. More... | |
std::map< MemoryID, std::vector< PredictionEngine > > | getAvailablePredictionEngines () const |
Get the list of prediction engines supported by the memory. More... | |
std::optional< wm::EntitySnapshot > | getLatestSnapshotIn (const MemoryID &id, armem::query::DataMode dataMode=armem::query::DataMode::WithData) const |
Get the latest snapshot under the given memory ID. More... | |
std::optional< wm::EntitySnapshot > | getLatestSnapshotOf (const std::vector< MemoryID > &snapshotIDs) const |
Query the given snapshot and return the latest existing snapshot. More... | |
QueryResult | getLatestSnapshotsIn (const MemoryID &id, armem::query::DataMode dataMode=armem::query::DataMode::WithData) const |
Get the latest snapshots under the given memory ID. More... | |
operator bool () const | |
std::vector< PredictionResult > | predict (const std::vector< PredictionRequest > &requests) const |
Get a prediction for the state of multiple entity instances in the future. More... | |
QueryResult | query (armem::query::data::MemoryQueryPtr query, armem::client::MemoryNameSystem &mns, int recursionDepth=-1) const |
QueryResult | query (armem::query::data::MemoryQueryPtr query, armem::query::DataMode dataMode=armem::query::DataMode::WithData) const |
armem::query::data::Result | query (const armem::query::data::Input &input) const |
armem::query::data::Result | query (const armem::query::data::Input &input, armem::client::MemoryNameSystem &mns, int recursionDepth=-1) const |
QueryResult | query (const armem::query::data::MemoryQuerySeq &queries, armem::client::MemoryNameSystem &mns, int recursionDepth=-1) const |
QueryResult | query (const armem::query::data::MemoryQuerySeq &queries, armem::query::DataMode dataMode=armem::query::DataMode::WithData) const |
QueryResult | query (const QueryBuilder &queryBuilder) const |
QueryResult | query (const QueryBuilder &queryBuilder, armem::client::MemoryNameSystem &mns, int recursionDepth=-1) const |
QueryResult | query (const QueryInput &input) const |
Perform a query. More... | |
QueryResult | query (const QueryInput &input, armem::client::MemoryNameSystem &mns, int recursionDepth=-1) const |
Perform a query with recursive memory link resolution. More... | |
QueryResult | queryMemoryIDs (const std::vector< MemoryID > &ids, armem::query::DataMode dataMode=armem::query::DataMode::WithData) const |
Query a specific set of memory IDs. More... | |
Reader (const Reader &)=default | |
Construct a memory reader. More... | |
Reader (server::ReadingMemoryInterfacePrx readingMemory=nullptr, server::PredictingMemoryInterfacePrx predictingMemory=nullptr) | |
void | setPredictingMemory (server::PredictingMemoryInterfacePrx predictingMemory) |
void | setReadingMemory (server::ReadingMemoryInterfacePrx readingMemory) |
void | startRecording () const |
void | stopRecording () const |
Public Attributes | |
server::PredictingMemoryInterfacePrx | predictionPrx |
server::ReadingMemoryInterfacePrx | readingPrx |
Reader | ( | server::ReadingMemoryInterfacePrx | readingMemory = nullptr , |
server::PredictingMemoryInterfacePrx | predictingMemory = nullptr |
||
) |
Definition at line 25 of file Reader.cpp.
server::dto::DirectlyStoreResult directlyStore | ( | const server::dto::DirectlyStoreInput & | input | ) | const |
Definition at line 420 of file Reader.cpp.
QueryResult getAll | ( | armem::query::DataMode | dataMode = armem::query::DataMode::WithData | ) | const |
Get the whole memory content.
dataMode | With or without data. |
Definition at line 409 of file Reader.cpp.
QueryResult getAllLatestSnapshots | ( | armem::query::DataMode | dataMode = armem::query::DataMode::WithData | ) | const |
Get all latest snapshots in the memory.
dataMode | With or without data. |
Definition at line 398 of file Reader.cpp.
std::map< MemoryID, std::vector< PredictionEngine > > getAvailablePredictionEngines | ( | ) | const |
Get the list of prediction engines supported by the memory.
The predictionPrx
must not be null when calling this function.
Definition at line 526 of file Reader.cpp.
std::optional< wm::EntitySnapshot > getLatestSnapshotIn | ( | const MemoryID & | id, |
armem::query::DataMode | dataMode = armem::query::DataMode::WithData |
||
) | const |
Get the latest snapshot under the given memory ID.
id | A memory, core segment, provider segment or entity ID. |
dataMode | With or without data. |
Definition at line 370 of file Reader.cpp.
std::optional< wm::EntitySnapshot > getLatestSnapshotOf | ( | const std::vector< MemoryID > & | snapshotIDs | ) | const |
Query the given snapshot and return the latest existing snapshot.
snapshotIDs | The snapshot (or entity) IDs. |
Definition at line 313 of file Reader.cpp.
QueryResult getLatestSnapshotsIn | ( | const MemoryID & | id, |
armem::query::DataMode | dataMode = armem::query::DataMode::WithData |
||
) | const |
Get the latest snapshots under the given memory ID.
id | A memory, core segment, provider segment or entity ID. |
dataMode | With or without data. |
Definition at line 343 of file Reader.cpp.
std::vector< PredictionResult > predict | ( | const std::vector< PredictionRequest > & | requests | ) | const |
Get a prediction for the state of multiple entity instances in the future.
The timestamp to predict the entities' state at is given via the snapshot given in the MemoryID.
The predictionPrx
must not be null when calling this function.
requests | a list of requests for entity instance predictions |
Definition at line 482 of file Reader.cpp.
QueryResult query | ( | armem::query::data::MemoryQueryPtr | query, |
armem::client::MemoryNameSystem & | mns, | ||
int | recursionDepth = -1 |
||
) | const |
Definition at line 137 of file Reader.cpp.
QueryResult query | ( | armem::query::data::MemoryQueryPtr | query, |
armem::query::DataMode | dataMode = armem::query::DataMode::WithData |
||
) | const |
armem::query::data::Result query | ( | const armem::query::data::Input & | input | ) | const |
Definition at line 40 of file Reader.cpp.
armem::query::data::Result query | ( | const armem::query::data::Input & | input, |
armem::client::MemoryNameSystem & | mns, | ||
int | recursionDepth = -1 |
||
) | const |
Definition at line 100 of file Reader.cpp.
QueryResult query | ( | const armem::query::data::MemoryQuerySeq & | queries, |
armem::client::MemoryNameSystem & | mns, | ||
int | recursionDepth = -1 |
||
) | const |
Definition at line 145 of file Reader.cpp.
QueryResult query | ( | const armem::query::data::MemoryQuerySeq & | queries, |
armem::query::DataMode | dataMode = armem::query::DataMode::WithData |
||
) | const |
QueryResult query | ( | const QueryBuilder & | queryBuilder | ) | const |
QueryResult query | ( | const QueryBuilder & | queryBuilder, |
armem::client::MemoryNameSystem & | mns, | ||
int | recursionDepth = -1 |
||
) | const |
Definition at line 155 of file Reader.cpp.
QueryResult query | ( | const QueryInput & | input | ) | const |
Perform a query.
Definition at line 33 of file Reader.cpp.
QueryResult query | ( | const QueryInput & | input, |
armem::client::MemoryNameSystem & | mns, | ||
int | recursionDepth = -1 |
||
) | const |
Perform a query with recursive memory link resolution.
Resolves the links in the query result using the given MemoryNameSystem and inserts the data into the MemoryLink objects' data fields. If the inserted data also contains links, those will be resolved as well up to and including the given recursion depth. Link cycles are detected; the first repeated memory ID will not be inserted into the data. Setting the recursion depth to -1
is equivalent to an infinite recursion depth.
Standalone MemoryID
subobjects are ignored; only MemoryIDs inside of MemoryLink subobjects are resolved. Empty or unresolvable MemoryIDs are ignored - this includes MemoryIDs whose Entity fields are not set. If the data associated with a MemoryID could not be retrieved or its type does not match the template type of the MemoryLink, it is ignored.
input | the query to perform |
mns | the MemoryNameSystem to use when resolving MemoryLinks |
recursionDepth | how many layers of MemoryLinks to resolve |
Definition at line 92 of file Reader.cpp.
QueryResult queryMemoryIDs | ( | const std::vector< MemoryID > & | ids, |
armem::query::DataMode | dataMode = armem::query::DataMode::WithData |
||
) | const |
Query a specific set of memory IDs.
Each ID can refer to an entity, a snapshot or an instance. When not referring to an entity instance, the latest snapshot and first instance will be queried, respectively.
All memory IDs must refer to the memory this reader is reading from. If an ID refers to another memory, the query will not find it and it will not be part of the result.
ids | The entity, snapshot or instance IDs. |
dataMode | Whether to include instance data or just meta data. |
Definition at line 290 of file Reader.cpp.
void setPredictingMemory | ( | server::PredictingMemoryInterfacePrx | predictingMemory | ) |
Definition at line 476 of file Reader.cpp.
void setReadingMemory | ( | server::ReadingMemoryInterfacePrx | readingMemory | ) |
Definition at line 470 of file Reader.cpp.
void startRecording | ( | ) | const |
Definition at line 434 of file Reader.cpp.
void stopRecording | ( | ) | const |
Definition at line 454 of file Reader.cpp.