MemoryToIceAdapter.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <RobotAPI/interface/armem/client/MemoryListenerInterface.h>
4 #include <RobotAPI/interface/armem/server/MemoryInterface.h>
9 
10 namespace armarx::armem::server
11 {
12 
13  /**
14  * @brief Helps connecting a Memory server to the Ice interface.
15  *
16  * This involves conversion of ice types to C++ types as well as
17  * catchin exceptions and converting them to error messages
18  */
20  {
21  public:
22  /// Construct an MemoryToIceAdapter from an existing Memory.
25 
26  void setMemoryListener(client::MemoryListenerInterfacePrx memoryListenerTopic);
27 
28  // WRITING
29  data::AddSegmentResult addSegment(const data::AddSegmentInput& input,
30  bool addCoreSegments = false);
31 
32  data::AddSegmentsResult addSegments(const data::AddSegmentsInput& input,
33  bool addCoreSegments = false);
34 
35 
36  data::CommitResult commit(const data::Commit& commitIce, Time timeArrived);
37  data::CommitResult commit(const data::Commit& commitIce);
39  data::CommitResult commitLocking(const data::Commit& commitIce, Time timeArrived);
40  data::CommitResult commitLocking(const data::Commit& commitIce);
42 
43 
44  // READING
45  query::data::Result query(const armem::query::data::Input& input);
47  armem::structure::data::GetServerStructureResult getServerStructure();
48 
49  // LTM LOADING AND REPLAYING
51 
52  // LTM STORING AND RECORDING
53  dto::DirectlyStoreResult directlyStore(const dto::DirectlyStoreInput& directlStoreInput);
54  dto::StartRecordResult startRecord(const dto::StartRecordInput& startRecordInput);
55  dto::StopRecordResult stopRecord();
56  dto::RecordStatusResult getRecordStatus();
57 
58  // PREDICTION
59  prediction::data::PredictionResultSeq
60  predict(prediction::data::PredictionRequestSeq requests);
61 
62  prediction::data::EngineSupportMap getAvailableEngines();
63 
64  public:
67 
68  client::MemoryListenerInterfacePrx memoryListenerTopic;
69 
70 
71  private:
72  armem::CommitResult _commit(const armem::Commit& commit, bool locking);
73  };
74 
75 
76 } // namespace armarx::armem::server
armarx::armem::server::MemoryToIceAdapter::workingMemory
server::wm::Memory * workingMemory
Definition: MemoryToIceAdapter.h:65
armarx::armem::Commit
A bundle of updates to be sent to the memory.
Definition: Commit.h:89
armarx::armem::server::MemoryToIceAdapter
Helps connecting a Memory server to the Ice interface.
Definition: MemoryToIceAdapter.h:19
armarx::armem::server::MemoryToIceAdapter::longtermMemory
server::ltm::Memory * longtermMemory
Definition: MemoryToIceAdapter.h:66
armarx::armem::server::MemoryToIceAdapter::startRecord
dto::StartRecordResult startRecord(const dto::StartRecordInput &startRecordInput)
Definition: MemoryToIceAdapter.cpp:438
armarx::armem::server::MemoryToIceAdapter::memoryListenerTopic
client::MemoryListenerInterfacePrx memoryListenerTopic
Definition: MemoryToIceAdapter.h:68
armarx::armem::client::QueryResult
Result of a QueryInput.
Definition: Query.h:50
Query.h
armarx::armem::server::MemoryToIceAdapter::predict
prediction::data::PredictionResultSeq predict(prediction::data::PredictionRequestSeq requests)
Definition: MemoryToIceAdapter.cpp:512
armarx::armem::server::MemoryToIceAdapter::getServerStructure
armem::structure::data::GetServerStructureResult getServerStructure()
Definition: MemoryToIceAdapter.cpp:357
armarx::armem::server::ltm::Memory
A memory storing data on the hard drive and in mongodb (needs 'armarx memory start' to start the mong...
Definition: Memory.h:19
memory_definitions.h
armarx::armem::server::MemoryToIceAdapter::reloadFromLTM
armem::CommitResult reloadFromLTM()
Definition: MemoryToIceAdapter.cpp:388
armarx::armem::server::MemoryToIceAdapter::setMemoryListener
void setMemoryListener(client::MemoryListenerInterfacePrx memoryListenerTopic)
Definition: MemoryToIceAdapter.cpp:34
armarx::armem::server::wm::Memory
Definition: memory_definitions.h:136
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::CommitResult
Result of a Commit.
Definition: Commit.h:110
armarx::armem::server::MemoryToIceAdapter::getRecordStatus
dto::RecordStatusResult getRecordStatus()
Definition: MemoryToIceAdapter.cpp:480
armarx::armem::server::MemoryToIceAdapter::getAvailableEngines
prediction::data::EngineSupportMap getAvailableEngines()
Definition: MemoryToIceAdapter.cpp:520
memory_definitions.h
armarx::armem::server::MemoryToIceAdapter::stopRecord
dto::StopRecordResult stopRecord()
Definition: MemoryToIceAdapter.cpp:452
armarx::armem::server
Definition: GraspMemory.cpp:19
armarx::armem::server::MemoryToIceAdapter::directlyStore
dto::DirectlyStoreResult directlyStore(const dto::DirectlyStoreInput &directlStoreInput)
Definition: MemoryToIceAdapter.cpp:423
Memory.h
armarx::core::time::DateTime
Represents a point in time.
Definition: DateTime.h:24
armarx::armem::server::MemoryToIceAdapter::addSegment
data::AddSegmentResult addSegment(const data::AddSegmentInput &input, bool addCoreSegments=false)
Definition: MemoryToIceAdapter.cpp:41
armarx::armem::server::MemoryToIceAdapter::addSegments
data::AddSegmentsResult addSegments(const data::AddSegmentsInput &input, bool addCoreSegments=false)
Definition: MemoryToIceAdapter.cpp:101
armarx::armem::server::MemoryToIceAdapter::MemoryToIceAdapter
MemoryToIceAdapter(server::wm::Memory *workingMemory=nullptr, server::ltm::Memory *longtermMemory=nullptr)
Construct an MemoryToIceAdapter from an existing Memory.
Definition: MemoryToIceAdapter.cpp:27
armarx::armem::server::MemoryToIceAdapter::commitLocking
data::CommitResult commitLocking(const data::Commit &commitIce, Time timeArrived)
Definition: MemoryToIceAdapter.cpp:166
armarx::armem::server::MemoryToIceAdapter::commit
data::CommitResult commit(const data::Commit &commitIce, Time timeArrived)
Definition: MemoryToIceAdapter.cpp:115
armarx::armem::server::MemoryToIceAdapter::query
query::data::Result query(const armem::query::data::Input &input)
Definition: MemoryToIceAdapter.cpp:291