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

Fix names in MemoryToIceAdapter

parent eef51d59
No related branches found
No related tags found
No related merge requests found
......@@ -12,7 +12,7 @@
namespace armarx::armem::server
{
MemoryToIceAdapter::MemoryToIceAdapter(wm::Memory* workingmemory, ltm::Memory* longtermmemory) : workingmemory(workingmemory), longtermmemory(longtermmemory)
MemoryToIceAdapter::MemoryToIceAdapter(wm::Memory* workingmemory, ltm::Memory* longtermmemory) : workingMemory(workingmemory), longtermMemory(longtermmemory)
{
}
......@@ -20,7 +20,7 @@ namespace armarx::armem::server
void
MemoryToIceAdapter::setMemoryListener(client::MemoryListenerInterfacePrx memoryListener)
{
this->memoryListener = memoryListener;
this->memoryListenerTopic = memoryListener;
}
......@@ -29,20 +29,20 @@ namespace armarx::armem::server
MemoryToIceAdapter::addSegment(const data::AddSegmentInput& input, bool addCoreSegments)
{
ARMARX_DEBUG << "Adding segment '" << input.coreSegmentName << "/" << input.providerSegmentName << "'.";
ARMARX_CHECK_NOT_NULL(workingmemory);
ARMARX_CHECK_NOT_NULL(workingMemory);
data::AddSegmentResult output;
armem::wm::CoreSegment* coreSegment = nullptr;
try
{
coreSegment = &workingmemory->getCoreSegment(input.coreSegmentName);
coreSegment = &workingMemory->getCoreSegment(input.coreSegmentName);
}
catch (const armem::error::MissingEntry& e)
{
if (addCoreSegments)
{
coreSegment = &workingmemory->addCoreSegment(input.coreSegmentName);
coreSegment = &workingMemory->addCoreSegment(input.coreSegmentName);
}
else
{
......@@ -71,7 +71,7 @@ namespace armarx::armem::server
}
armem::MemoryID segmentID;
segmentID.memoryName = workingmemory->name();
segmentID.memoryName = workingMemory->name();
segmentID.coreSegmentName = input.coreSegmentName;
segmentID.providerSegmentName = input.providerSegmentName;
......@@ -84,7 +84,7 @@ namespace armarx::armem::server
data::AddSegmentsResult
MemoryToIceAdapter::addSegments(const data::AddSegmentsInput& input, bool addCoreSegments)
{
ARMARX_CHECK_NOT_NULL(workingmemory);
ARMARX_CHECK_NOT_NULL(workingMemory);
data::AddSegmentsResult output;
for (const auto& i : input)
......@@ -97,7 +97,7 @@ namespace armarx::armem::server
data::CommitResult
MemoryToIceAdapter::commit(const data::Commit& commitIce, Time timeArrived)
{
ARMARX_CHECK_NOT_NULL(workingmemory);
ARMARX_CHECK_NOT_NULL(workingMemory);
armem::Commit commit;
armem::fromIce(commitIce, commit, timeArrived);
......@@ -121,7 +121,7 @@ namespace armarx::armem::server
MemoryToIceAdapter::commit(const armem::Commit& commit)
{
std::vector<data::MemoryID> updatedIDs;
const bool publishUpdates = memoryListener;
const bool publishUpdates = memoryListenerTopic;
CommitResult commitResult;
for (const EntityUpdate& update : commit.updates)
......@@ -129,7 +129,7 @@ namespace armarx::armem::server
EntityUpdateResult& result = commitResult.results.emplace_back();
try
{
MemoryID snapshotID = workingmemory->update(update);
MemoryID snapshotID = workingMemory->update(update);
result.success = true;
result.snapshotID = snapshotID;
......@@ -150,7 +150,7 @@ namespace armarx::armem::server
if (publishUpdates)
{
memoryListener->memoryUpdated(updatedIDs);
memoryListenerTopic->memoryUpdated(updatedIDs);
}
return commitResult;
......@@ -161,18 +161,18 @@ namespace armarx::armem::server
armem::query::data::Result
MemoryToIceAdapter::query(const armem::query::data::Input& input)
{
ARMARX_CHECK_NOT_NULL(workingmemory);
ARMARX_CHECK_NOT_NULL(workingMemory);
armem::wm::query_proc::MemoryQueryProcessor processor(
input.withData ? armem::DataMode::WithData
: armem::DataMode::NoData);
return processor.process(input, *workingmemory);
return processor.process(input, *workingMemory);
}
// LTM LOADING
query::data::Result MemoryToIceAdapter::load(const armem::query::data::Input& query)
{
ARMARX_CHECK_NOT_NULL(longtermmemory);
ARMARX_CHECK_NOT_NULL(longtermMemory);
query::data::Result output;
output.success = true;
......@@ -182,8 +182,8 @@ namespace armarx::armem::server
// LTM STORING
data::StoreResult MemoryToIceAdapter::store(const armem::data::StoreInput& input)
{
ARMARX_CHECK_NOT_NULL(workingmemory);
ARMARX_CHECK_NOT_NULL(longtermmemory);
ARMARX_CHECK_NOT_NULL(workingMemory);
ARMARX_CHECK_NOT_NULL(longtermMemory);
data::StoreResult output;
armem::query::data::Result queryResult = this->query(input.query);
......@@ -191,7 +191,7 @@ namespace armarx::armem::server
{
wm::Memory m;
fromIce(queryResult.memory, m);
longtermmemory->append(m);
longtermMemory->append(m);
}
else
{
......
......@@ -22,9 +22,9 @@ namespace armarx::armem::server
public:
/// Construct an MemoryToIceAdapter from an existing Memory.
MemoryToIceAdapter(wm::Memory* workingmemory = nullptr, ltm::Memory* longtermmemory = nullptr);
MemoryToIceAdapter(wm::Memory* workingMemory = nullptr, ltm::Memory* longtermMemory = nullptr);
void setMemoryListener(client::MemoryListenerInterfacePrx memoryListener);
void setMemoryListener(client::MemoryListenerInterfacePrx memoryListenerTopic);
// WRITING
......@@ -50,10 +50,10 @@ namespace armarx::armem::server
public:
wm::Memory* workingmemory;
ltm::Memory* longtermmemory;
wm::Memory* workingMemory;
ltm::Memory* longtermMemory;
client::MemoryListenerInterfacePrx memoryListener;
client::MemoryListenerInterfacePrx memoryListenerTopic;
};
......
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