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

Move conversions to memory/

parent 64ac446e
No related branches found
No related tags found
1 merge request!94ArMem Queries
......@@ -40,7 +40,6 @@ set(LIB_FILES
component/MemoryComponentPlugin.cpp
component/MemoryRemoteGui.cpp
query/ice_conversions.cpp
query/BaseQueryProcessor.cpp
query/EntityQueryProcessor.cpp
query/ProviderSegmentQueryProcessor.cpp
......@@ -81,7 +80,6 @@ set(LIB_HEADERS
component/MemoryRemoteGui.h
query.h
query/ice_conversions.h
query/BaseQueryProcessor.h
query/EntityQueryProcessor.h
query/ProviderSegmentQueryProcessor.h
......
......@@ -22,6 +22,53 @@ namespace armarx
}
void armem::toIce(data::EntityMetadata& ice, const EntityMetadata& metadata)
{
ice.confidence = metadata.confidence;
toIce(ice.timeArrivedMicroSeconds, metadata.timeArrived);
toIce(ice.timeCreatedMicroSeconds, metadata.timeCreated);
toIce(ice.timeSentMicroSeconds, metadata.timeSent);
}
void armem::toIce(data::EntityData& ice, const EntityData& data)
{
ice.data = data.data;
ice.index = data.index;
toIce(ice.metadata, data.metadata);
}
void armem::toIce(data::EntitySnapshot& ice, const EntitySnapshot& snapshot)
{
toIce(ice.timeMicroSeconds, snapshot.time);
toIce(ice.instances, snapshot.instances);
}
void armem::toIce(data::Entity& ice, const Entity& entity)
{
ice.name = entity.name;
toIce(ice.history, entity.history);
}
void armem::toIce(data::ProviderSegment& ice, const ProviderSegment& providerSegment)
{
ice.name = providerSegment.name;
toIce(ice.entities, providerSegment.entities);
}
void armem::toIce(data::CoreSegment& ice, const CoreSegment& coreSegment)
{
ice.name = coreSegment.name;
toIce(ice.providerSegments, coreSegment.providerSegments);
}
void armem::toIce(data::Memory& ice, const Memory& memory)
{
ice.name = memory.name;
toIce(ice.coreSegments, memory.coreSegments);
}
}
#pragma once
#include <RobotAPI/interface/armem/memory.h>
#include "../core/ice_conversions.h"
#include "InternalCommit.h"
#include "Memory.h"
namespace armarx::armem
......@@ -14,4 +16,16 @@ namespace armarx::armem
void fromIce(const data::EntityUpdate& ice, InternalEntityUpdate& update, Time timeArrived);
void toIce(data::EntityMetadata& ice, const EntityMetadata& metadata);
void toIce(data::EntityData& ice, const EntityData& data);
void toIce(data::EntitySnapshot& ice, const EntitySnapshot& snapshot);
void toIce(data::Entity& ice, const Entity& entity);
void toIce(data::ProviderSegment& ice, const ProviderSegment& providerSegment);
void toIce(data::CoreSegment& ice, const CoreSegment& coreSegment);
void toIce(data::Memory& ice, const Memory& memory);
}
......@@ -3,8 +3,8 @@
#include <RobotAPI/interface/armem/query.h>
#include "../memory/Memory.h"
#include "../memory/ice_conversions.h"
#include "ice_conversions.h"
#include "BaseQueryProcessor.h"
#include "ProviderSegmentQueryProcessor.h"
......
......@@ -3,8 +3,8 @@
#include <RobotAPI/interface/armem/query.h>
#include "../memory/Memory.h"
#include "../memory/ice_conversions.h"
#include "ice_conversions.h"
#include "BaseQueryProcessor.h"
......
......@@ -3,8 +3,8 @@
#include <RobotAPI/interface/armem/query.h>
#include "../memory/Memory.h"
#include "../memory/ice_conversions.h"
#include "ice_conversions.h"
#include "BaseQueryProcessor.h"
#include "CoreSegmentQueryProcessor.h"
......
......@@ -3,8 +3,8 @@
#include <RobotAPI/interface/armem/query.h>
#include "../memory/Memory.h"
#include "../memory/ice_conversions.h"
#include "ice_conversions.h"
#include "BaseQueryProcessor.h"
#include "EntityQueryProcessor.h"
......
#include "ice_conversions.h"
#include "../core/ice_conversions.h"
namespace armarx
{
void armem::toIce(data::EntityMetadata& ice, const EntityMetadata& metadata)
{
ice.confidence = metadata.confidence;
toIce(ice.timeArrivedMicroSeconds, metadata.timeArrived);
toIce(ice.timeCreatedMicroSeconds, metadata.timeCreated);
toIce(ice.timeSentMicroSeconds, metadata.timeSent);
}
void armem::toIce(data::EntityData& ice, const EntityData& data)
{
ice.data = data.data;
ice.index = data.index;
toIce(ice.metadata, data.metadata);
}
void armem::toIce(data::EntitySnapshot& ice, const EntitySnapshot& snapshot)
{
toIce(ice.timeMicroSeconds, snapshot.time);
toIce(ice.instances, snapshot.instances);
}
void armem::toIce(data::Entity& ice, const Entity& entity)
{
ice.name = entity.name;
toIce(ice.history, entity.history);
}
void armem::toIce(data::ProviderSegment& ice, const ProviderSegment& providerSegment)
{
ice.name = providerSegment.name;
toIce(ice.entities, providerSegment.entities);
}
void armem::toIce(data::CoreSegment& ice, const CoreSegment& coreSegment)
{
ice.name = coreSegment.name;
toIce(ice.providerSegments, coreSegment.providerSegments);
}
void armem::toIce(data::Memory& ice, const Memory& memory)
{
ice.name = memory.name;
toIce(ice.coreSegments, memory.coreSegments);
}
}
#pragma once
#include <RobotAPI/interface/armem/memory.h>
#include "../memory/Memory.h"
namespace armarx::armem
{
void toIce(data::EntityMetadata& ice, const EntityMetadata& metadata);
void toIce(data::EntityData& ice, const EntityData& data);
void toIce(data::EntitySnapshot& ice, const EntitySnapshot& snapshot);
void toIce(data::Entity& ice, const Entity& entity);
void toIce(data::ProviderSegment& ice, const ProviderSegment& providerSegment);
void toIce(data::CoreSegment& ice, const CoreSegment& coreSegment);
void toIce(data::Memory& ice, const Memory& memory);
}
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