|
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 on the WM. More... | |
QueryResult | query (const QueryInput &input, armem::client::MemoryNameSystem &mns, int recursionDepth=-1) const |
Perform a query with recursive memory link resolution. More... | |
armem::query::data::Result | queryLTM (const armem::query::data::Input &input, bool storeIntoWM=false) const |
Queries the linked ltms. More... | |
QueryResult | queryLTM (const QueryInput &input, bool storeIntoWM=false) const |
Queries the linked ltms. 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, server::ReadingLongTermMemoryInterfacePrx readingLtmMemory=nullptr) | |
void | setPredictingMemory (server::PredictingMemoryInterfacePrx predictingMemory) |
void | setReadingLtmMemory (server::ReadingLongTermMemoryInterfacePrx readingLtmMemory) |
void | setReadingMemory (server::ReadingMemoryInterfacePrx readingMemory) |
void | startRecording () const |
void | stopRecording () const |
Public Attributes | |
server::PredictingMemoryInterfacePrx | predictionPrx |
server::ReadingLongTermMemoryInterfacePrx | readingLtmPrx |
server::ReadingMemoryInterfacePrx | readingPrx |
Reader | ( | server::ReadingMemoryInterfacePrx | readingMemory = nullptr , |
server::PredictingMemoryInterfacePrx | predictingMemory = nullptr , |
||
server::ReadingLongTermMemoryInterfacePrx | readingLtmMemory = nullptr |
||
) |
Definition at line 25 of file Reader.cpp.
server::dto::DirectlyStoreResult directlyStore | ( | const server::dto::DirectlyStoreInput & | input | ) | const |
Definition at line 450 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 439 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 428 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 563 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 399 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 347 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 377 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 519 of file Reader.cpp.
QueryResult query | ( | armem::query::data::MemoryQueryPtr | query, |
armem::client::MemoryNameSystem & | mns, | ||
int | recursionDepth = -1 |
||
) | const |
Definition at line 172 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 75 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 135 of file Reader.cpp.
QueryResult query | ( | const armem::query::data::MemoryQuerySeq & | queries, |
armem::client::MemoryNameSystem & | mns, | ||
int | recursionDepth = -1 |
||
) | const |
Definition at line 180 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 190 of file Reader.cpp.
QueryResult query | ( | const QueryInput & | input | ) | const |
Perform a query on the WM.
Definition at line 69 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 127 of file Reader.cpp.
armem::query::data::Result queryLTM | ( | const armem::query::data::Input & | input, |
bool | storeIntoWM = false |
||
) | const |
Queries the linked ltms.
storeIntoWM | if true the ltm result is also commited to the wm en if recording mode is disabled |
Definition at line 39 of file Reader.cpp.
QueryResult queryLTM | ( | const QueryInput & | input, |
bool | storeIntoWM = false |
||
) | const |
Queries the linked ltms.
storeIntoWM | if true the ltm result is also commited to the wm en if recording mode is disabled |
Definition at line 33 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 324 of file Reader.cpp.
void setPredictingMemory | ( | server::PredictingMemoryInterfacePrx | predictingMemory | ) |
Definition at line 513 of file Reader.cpp.
void setReadingLtmMemory | ( | server::ReadingLongTermMemoryInterfacePrx | readingLtmMemory | ) |
void setReadingMemory | ( | server::ReadingMemoryInterfacePrx | readingMemory | ) |
Definition at line 507 of file Reader.cpp.
void startRecording | ( | ) | const |
Definition at line 467 of file Reader.cpp.
void stopRecording | ( | ) | const |
Definition at line 490 of file Reader.cpp.