SpecializedCoreSegment.cpp
Go to the documentation of this file.
2 
5 
8 
9 
11 {
12 
15  const std::string& defaultCoreSegmentName,
16  aron::type::ObjectPtr coreSegmentAronType,
17  int defaultMaxHistorySize,
18  const std::vector<PredictionEngine>& predictionEngines) :
19  Base(iceMemory),
20  aronType(coreSegmentAronType),
21  predictionEngines(predictionEngines),
22  properties({defaultCoreSegmentName, defaultMaxHistorySize})
23  {
24  Logging::setTag("armarx::armem::SpecializedCoreSegment");
25  }
26 
27 
29  {
30  }
31 
32 
35  const std::string& prefix)
36  {
38 
39  defs->optional(properties.segmentName,
40  prefix + "seg.CoreSegmentName",
41  "Name of the " + properties.segmentName + " core segment.");
42 
43  defs->optional(properties.maxHistorySize,
44  prefix + "seg.CoreMaxHistorySize",
45  "Maximal size of the " + properties.segmentName + " entity histories (-1 for infinite).");
46  }
47 
48 
50  {
52  Logging::setTag(properties.segmentName + " Core Segment");
53 
55  {
57  }
58  else
59  {
60  ARMARX_INFO << "Adding core segment '" << properties.segmentName << "'";
62 
66  }
67  }
68 
69  void SpecializedCoreSegment::setDefaultCoreSegmentName(const std::string& coreSegmentName)
70  {
71  this->properties.segmentName = coreSegmentName;
72  }
73 
74 
76  {
77  this->properties.maxHistorySize = maxHistorySize;
78  }
79 
80 
82  {
83  this->aronType = aronType;
84  }
85 
86  void
88  const std::vector<PredictionEngine>& predictionEngines)
89  {
90  this->predictionEngines = predictionEngines;
91  }
92 
94  {
96  return *segmentPtr;
97  }
98 
99 
101  {
103  return *segmentPtr;
104  }
105 }
armarx::armem::server::MemoryToIceAdapter::workingMemory
server::wm::Memory * workingMemory
Definition: MemoryToIceAdapter.h:64
armarx::armem::server::segment::SpecializedCoreSegment::SpecializedCoreSegment
SpecializedCoreSegment(MemoryToIceAdapter &iceMemory, const std::string &defaultCoreSegmentName="", aron::type::ObjectPtr coreSegmentAronType=nullptr, int defaultMaxHistorySize=-1, const std::vector< PredictionEngine > &predictionEngines={})
Definition: SpecializedCoreSegment.cpp:13
armarx::armem::server::segment::SpecializedCoreSegment::Properties::segmentName
std::string segmentName
Definition: SpecializedCoreSegment.h:61
armarx::armem::server::wm::detail::MaxHistorySizeParent::setMaxHistorySize
void setMaxHistorySize(long maxSize)
Sets the maximum history size of entities in this container.
Definition: MaxHistorySize.h:46
armarx::armem::server::MemoryToIceAdapter
Helps connecting a Memory server to the Ice interface.
Definition: MemoryToIceAdapter.h:19
armarx::armem::base::MemoryBase::getCoreSegment
CoreSegmentT & getCoreSegment(const std::string &name)
Definition: MemoryBase.h:132
ARMARX_CHECK_NOT_NULL
#define ARMARX_CHECK_NOT_NULL(ptr)
This macro evaluates whether ptr is not null and if it turns out to be false it will throw an Express...
Definition: ExpressionException.h:206
armarx::armem::base::detail::AronTyped::aronType
aron::type::ObjectPtr & aronType()
Definition: AronTyped.cpp:18
armarx::armem::server::segment::SpecializedCoreSegment::setAronType
void setAronType(aron::type::ObjectPtr aronType)
Definition: SpecializedCoreSegment.cpp:81
armarx::armem::base::detail::Predictive::setPredictionEngines
void setPredictionEngines(const std::vector< PredictionEngine > &engines)
Definition: Predictive.h:58
armarx::armem::base::MemoryBase::hasCoreSegment
bool hasCoreSegment(const std::string &name) const
Definition: MemoryBase.h:105
Object.h
armarx::armem::server::segment::detail::SegmentBase< server::wm::CoreSegment >::segmentPtr
server::wm::CoreSegment * segmentPtr
Definition: SpecializedSegment.h:54
armarx::armem::server::segment::SpecializedCoreSegment::predictionEngines
std::vector< PredictionEngine > predictionEngines
Definition: SpecializedCoreSegment.h:57
armarx::armem::server::segment::SpecializedCoreSegment::getCoreSegment
wm::CoreSegment & getCoreSegment()
Definition: SpecializedCoreSegment.cpp:93
armarx::armem::server::segment::detail::SegmentBase< server::wm::CoreSegment >
armarx::armem::server::segment::SpecializedCoreSegment::init
virtual void init() override
Definition: SpecializedCoreSegment.cpp:49
armarx::armem::base::MemoryBase::addCoreSegment
CoreSegmentT & addCoreSegment(const std::string &name, aron::type::ObjectPtr coreSegmentType=nullptr, const std::vector< PredictionEngine > &predictionEngines={})
Add an empty core segment with the given name, type and prediction engines.
Definition: MemoryBase.h:259
armarx::armem::server::segment::SpecializedCoreSegment::setDefaultCoreSegmentName
void setDefaultCoreSegmentName(const std::string &coreSegmentName)
Definition: SpecializedCoreSegment.cpp:69
PluginAll.h
MemoryToIceAdapter.h
armarx::armem::server::segment
Definition: SpecializedSegment.cpp:3
armarx::armem::server::wm::CoreSegment
base::CoreSegmentBase
Definition: memory_definitions.h:86
armarx::armem::server::segment::SpecializedCoreSegment::Properties::maxHistorySize
int64_t maxHistorySize
Definition: SpecializedCoreSegment.h:62
armarx::armem::server::segment::detail::SegmentBase< server::wm::CoreSegment >::iceMemory
MemoryToIceAdapter & iceMemory
Definition: SpecializedSegment.h:60
armarx::armem::server::segment::SpecializedCoreSegment::setDefaultMaxHistorySize
void setDefaultMaxHistorySize(int64_t maxHistorySize)
Definition: SpecializedCoreSegment.cpp:75
ARMARX_INFO
#define ARMARX_INFO
Definition: Logging.h:174
PropertyDefinitionContainer.h
IceUtil::Handle< class PropertyDefinitionContainer >
armarx::aron::type::ObjectPtr
std::shared_ptr< Object > ObjectPtr
Definition: Object.h:36
armarx::armem::server::segment::SpecializedCoreSegment::setPredictionEngines
void setPredictionEngines(const std::vector< PredictionEngine > &predictionEngines)
Definition: SpecializedCoreSegment.cpp:87
armarx::Logging::setTag
void setTag(const LogTag &tag)
Definition: Logging.cpp:55
armarx::armem::server::segment::SpecializedCoreSegment::~SpecializedCoreSegment
virtual ~SpecializedCoreSegment() override
Definition: SpecializedCoreSegment.cpp:28
armarx::armem::server::segment::SpecializedCoreSegment::aronType
aron::type::ObjectPtr aronType
Definition: SpecializedCoreSegment.h:56
armarx::armem::server::segment::SpecializedCoreSegment::properties
Properties properties
Definition: SpecializedCoreSegment.h:64
SpecializedCoreSegment.h
armarx::armem::server::segment::SpecializedCoreSegment::defineProperties
virtual void defineProperties(armarx::PropertyDefinitionsPtr defs, const std::string &prefix="") override
Definition: SpecializedCoreSegment.cpp:33