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

Add max history size

parent 7eb39779
No related branches found
No related tags found
1 merge request!292Resolve "Add Index memory for listing/searching/filtering Spatial and Named entities"
......@@ -42,6 +42,9 @@ namespace armarx
setMemoryName(armem::index::memoryID.memoryName);
defs->optional(properties.maxHistorySize, "p.maxHistorySize", "The maximum size of entity histories.")
.setMin(1);
return defs;
}
......@@ -56,10 +59,16 @@ namespace armarx
void
IndexMemory::onInitComponent()
{
workingMemory().addCoreSegment(armem::index::namedSegmentID.coreSegmentName,
armem::index::arondto::Named::ToAronType());
workingMemory().addCoreSegment(armem::index::spatialSegmentID.coreSegmentName,
armem::index::arondto::Spatial::ToAronType());
size_t maxHistorySize = static_cast<size_t>(std::max(1, properties.maxHistorySize));
workingMemory()
.addCoreSegment(armem::index::namedSegmentID.coreSegmentName,
armem::index::arondto::Named::ToAronType())
.setMaxHistorySize(maxHistorySize);
workingMemory()
.addCoreSegment(armem::index::spatialSegmentID.coreSegmentName,
armem::index::arondto::Spatial::ToAronType())
.setMaxHistorySize(maxHistorySize);
}
......
......@@ -70,6 +70,7 @@ namespace armarx
private:
struct Properties
{
int maxHistorySize = 1024;
};
Properties properties;
......
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