ReadWritePluginUser.cpp
Go to the documentation of this file.
1 #include "ReadWritePluginUser.h"
2 
5 
9 
10 #include "Plugin.h"
11 
13 {
14 
16  {
17  addPlugin(plugin);
18  }
19 
21  {
22  }
23 
24  void
26  {
27  plugin->setMemoryName(memoryName);
28  }
29 
30  // WRITING
31  data::AddSegmentsResult
32  ReadWritePluginUser::addSegments(const data::AddSegmentsInput& input, const Ice::Current&)
33  {
35  bool addCoreSegmentOnUsage = false;
36  return addSegments(input, addCoreSegmentOnUsage);
37  }
38 
39  data::AddSegmentsResult
40  ReadWritePluginUser::addSegments(const data::AddSegmentsInput& input, bool addCoreSegments)
41  {
43  data::AddSegmentsResult result = iceAdapter().addSegments(input, addCoreSegments);
44  return result;
45  }
46 
47  data::CommitResult
48  ReadWritePluginUser::commit(const data::Commit& commitIce, const Ice::Current&)
49  {
51  return iceAdapter().commitLocking(commitIce);
52  }
53 
54  // READING
55  armem::query::data::Result
56  ReadWritePluginUser::query(const armem::query::data::Input& input, const Ice::Current&)
57  {
59  return iceAdapter().query(input);
60  }
61 
62  structure::data::GetServerStructureResult
64  {
66  return iceAdapter().getServerStructure();
67  }
68 
69  // LTM STORING AND RECORDING
70  dto::DirectlyStoreResult
71  ReadWritePluginUser::directlyStore(const dto::DirectlyStoreInput& input, const Ice::Current&)
72  {
74  return iceAdapter().directlyStore(input);
75  }
76 
77  dto::StartRecordResult
78  ReadWritePluginUser::startRecord(const dto::StartRecordInput& startRecordInput,
79  const Ice::Current&)
80  {
82  return iceAdapter().startRecord(startRecordInput);
83  }
84 
85  dto::StopRecordResult
86  ReadWritePluginUser::stopRecord(const Ice::Current&)
87  {
89  return iceAdapter().stopRecord();
90  }
91 
92  dto::RecordStatusResult
94  {
96  return iceAdapter().getRecordStatus();
97  }
98 
99  Plugin&
101  {
102  return *plugin;
103  }
104 
105  wm::Memory&
107  {
108  return plugin->workingMemory;
109  }
110 
113  {
114  return plugin->iceAdapter;
115  }
116 
117  ltm::Memory&
119  {
120  return plugin->longtermMemory;
121  }
122 
123  // ACTIONS
124  armem::actions::GetActionsOutputSeq
125  ReadWritePluginUser::getActions(const armem::actions::GetActionsInputSeq& inputs,
126  const ::Ice::Current& /*unused*/)
127  {
128  return getActions(inputs);
129  }
130 
131  armem::actions::GetActionsOutputSeq
132  ReadWritePluginUser::getActions(const armem::actions::GetActionsInputSeq& inputs)
133  {
134  (void)inputs;
135  return {};
136  }
137 
138  armem::actions::ExecuteActionOutputSeq
139  ReadWritePluginUser::executeActions(const armem::actions::ExecuteActionInputSeq& inputs,
140  const ::Ice::Current& /*unused*/)
141  {
142  return executeActions(inputs);
143  }
144 
145  armem::actions::ExecuteActionOutputSeq
146  ReadWritePluginUser::executeActions(const armem::actions::ExecuteActionInputSeq& inputs)
147  {
148  return {};
149  }
150 
151  // PREDICTIONS
152  armem::prediction::data::PredictionResultSeq
153  ReadWritePluginUser::predict(const armem::prediction::data::PredictionRequestSeq& requests)
154  {
155  return iceAdapter().predict(requests);
156  }
157 
158  armem::prediction::data::EngineSupportMap
160  {
161  return iceAdapter().getAvailableEngines();
162  }
163 
164  armem::prediction::data::PredictionResultSeq
165  ReadWritePluginUser::predict(const armem::prediction::data::PredictionRequestSeq& requests,
166  const ::Ice::Current& /*unused*/)
167  {
168  return predict(requests);
169  }
170 
171  armem::prediction::data::EngineSupportMap
172  ReadWritePluginUser::getAvailableEngines(const ::Ice::Current& /*unused*/)
173  {
174  return getAvailableEngines();
175  }
176 
179  {
181  return armem::CommitResult();
182  }
183 
184 } // namespace armarx::armem::server::plugins
armarx::armem::server::plugins::ReadWritePluginUser::predict
virtual armem::prediction::data::PredictionResultSeq predict(const armem::prediction::data::PredictionRequestSeq &requests)
Definition: ReadWritePluginUser.cpp:153
armarx::armem::server::plugins::ReadWritePluginUser::directlyStore
virtual dto::DirectlyStoreResult directlyStore(const dto::DirectlyStoreInput &, const Ice::Current &=Ice::emptyCurrent) override
Definition: ReadWritePluginUser.cpp:71
armarx::armem::server::plugins::Plugin::iceAdapter
MemoryToIceAdapter iceAdapter
Helps connecting memory to ice. Used to handle Ice callbacks.
Definition: Plugin.h:66
armarx::armem::server::plugins::ReadWritePluginUser::query
virtual armem::query::data::Result query(const armem::query::data::Input &input, const Ice::Current &=Ice::emptyCurrent) override
Definition: ReadWritePluginUser.cpp:56
armarx::armem::server::MemoryToIceAdapter
Helps connecting a Memory server to the Ice interface.
Definition: MemoryToIceAdapter.h:19
armarx::armem::server::plugins::ReadWritePluginUser::getServerStructure
virtual armem::structure::data::GetServerStructureResult getServerStructure(const Ice::Current &=Ice::emptyCurrent) override
Definition: ReadWritePluginUser.cpp:63
armarx::armem::server::plugins::ReadWritePluginUser::ReadWritePluginUser
ReadWritePluginUser()
Definition: ReadWritePluginUser.cpp:15
armarx::armem::server::MemoryToIceAdapter::startRecord
dto::StartRecordResult startRecord(const dto::StartRecordInput &startRecordInput)
Definition: MemoryToIceAdapter.cpp:438
ReadWritePluginUser.h
Prediction.h
armarx::armem::server::plugins::ReadWritePluginUser::stopRecord
virtual dto::StopRecordResult stopRecord(const Ice::Current &=Ice::emptyCurrent) override
Definition: ReadWritePluginUser.cpp:86
armarx::armem::server::plugins::ReadWritePluginUser::setMemoryName
void setMemoryName(const std::string &memoryName)
Definition: ReadWritePluginUser.cpp:25
armarx::ManagedIceObject::addPlugin
PluginT * addPlugin(const std::string prefix="", ParamsT &&...params)
Definition: ManagedIceObject.h:182
armarx::armem::server::plugins::ReadWritePluginUser::getActions
virtual armem::actions::GetActionsOutputSeq getActions(const armem::actions::GetActionsInputSeq &inputs)
Definition: ReadWritePluginUser.cpp:132
armarx::armem::server::plugins::ReadWritePluginUser::workingMemory
server::wm::Memory & workingMemory()
Definition: ReadWritePluginUser.cpp:106
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::plugins::ReadWritePluginUser::getAvailableEngines
virtual armem::prediction::data::EngineSupportMap getAvailableEngines()
Definition: ReadWritePluginUser.cpp:159
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
armarx::armem::server::MemoryToIceAdapter::reloadFromLTM
armem::CommitResult reloadFromLTM()
Definition: MemoryToIceAdapter.cpp:388
ARMARX_TRACE
#define ARMARX_TRACE
Definition: trace.h:69
armarx::armem::server::wm::Memory
Definition: memory_definitions.h:136
armarx::armem::server::plugins::ReadWritePluginUser::addSegments
virtual data::AddSegmentsResult addSegments(const data::AddSegmentsInput &input, const Ice::Current &=Ice::emptyCurrent) override
Definition: ReadWritePluginUser.cpp:32
Plugin.h
armarx::armem::server::plugins::Plugin::longtermMemory
server::ltm::Memory longtermMemory
A manager class for the ltm. It internally holds a normal wm instance as a cache.
Definition: Plugin.h:80
armarx::aron::input
ReaderT::InputType & input
Definition: rw.h:19
error.h
armarx::armem::CommitResult
Result of a Commit.
Definition: Commit.h:110
armarx::armem::server::plugins::ReadWritePluginUser::iceAdapter
MemoryToIceAdapter & iceAdapter()
Definition: ReadWritePluginUser.cpp:112
armarx::armem::server::MemoryToIceAdapter::getRecordStatus
dto::RecordStatusResult getRecordStatus()
Definition: MemoryToIceAdapter.cpp:480
armarx::armem::server::plugins::ReadWritePluginUser::memoryServerPlugin
Plugin & memoryServerPlugin()
Definition: ReadWritePluginUser.cpp:100
MemoryToIceAdapter.h
armarx::armem::server::MemoryToIceAdapter::getAvailableEngines
prediction::data::EngineSupportMap getAvailableEngines()
Definition: MemoryToIceAdapter.cpp:520
Component.h
armarx::armem::server::MemoryToIceAdapter::stopRecord
dto::StopRecordResult stopRecord()
Definition: MemoryToIceAdapter.cpp:452
armarx::armem::server::plugins::ReadWritePluginUser::~ReadWritePluginUser
virtual ~ReadWritePluginUser() override
Definition: ReadWritePluginUser.cpp:20
armarx::armem::server::MemoryToIceAdapter::directlyStore
dto::DirectlyStoreResult directlyStore(const dto::DirectlyStoreInput &directlStoreInput)
Definition: MemoryToIceAdapter.cpp:423
armarx::armem::server::plugins::ReadWritePluginUser::commit
virtual data::CommitResult commit(const data::Commit &commit, const Ice::Current &=Ice::emptyCurrent) override
Definition: ReadWritePluginUser.cpp:48
ExpressionException.h
armarx::armem::server::plugins::ReadWritePluginUser::reloadFromLTM
armem::CommitResult reloadFromLTM()
Definition: ReadWritePluginUser.cpp:178
armarx::armem::server::plugins::ReadWritePluginUser::executeActions
virtual armem::actions::ExecuteActionOutputSeq executeActions(const armem::actions::ExecuteActionInputSeq &inputs)
Definition: ReadWritePluginUser.cpp:146
armarx::armem::laser_scans::constants::memoryName
const std::string memoryName
Definition: constants.h:28
armarx::armem::server::plugins::Plugin::setMemoryName
void setMemoryName(const std::string &memoryName)
Set the name of the wm and the ltm.
Definition: Plugin.cpp:160
armarx::armem::server::MemoryToIceAdapter::addSegments
data::AddSegmentsResult addSegments(const data::AddSegmentsInput &input, bool addCoreSegments=false)
Definition: MemoryToIceAdapter.cpp:101
armarx::armem::server::plugins::ReadWritePluginUser::longtermMemory
server::ltm::Memory & longtermMemory()
Definition: ReadWritePluginUser.cpp:118
armarx::armem::server::plugins::Plugin::workingMemory
server::wm::Memory workingMemory
The actual memory.
Definition: Plugin.h:63
armarx::armem::server::plugins
Definition: Plugin.cpp:13
armarx::armem::server::plugins::ReadWritePluginUser::startRecord
virtual dto::StartRecordResult startRecord(const dto::StartRecordInput &startRecordInput, const Ice::Current &=Ice::emptyCurrent) override
Definition: ReadWritePluginUser.cpp:78
armarx::armem::server::plugins::Plugin
Definition: Plugin.h:23
armarx::armem::server::MemoryToIceAdapter::commitLocking
data::CommitResult commitLocking(const data::Commit &commitIce, Time timeArrived)
Definition: MemoryToIceAdapter.cpp:166
armarx::armem::server::MemoryToIceAdapter::query
query::data::Result query(const armem::query::data::Input &input)
Definition: MemoryToIceAdapter.cpp:291
armarx::armem::server::plugins::ReadWritePluginUser::getRecordStatus
virtual dto::RecordStatusResult getRecordStatus(const Ice::Current &=Ice::emptyCurrent) override
Definition: ReadWritePluginUser.cpp:93