SpecializedCoreSegment.cpp
Go to the documentation of this file.
2 
5 
8 
10 {
11 
14  const std::string& defaultCoreSegmentName,
15  aron::type::ObjectPtr coreSegmentAronType,
16  int defaultMaxHistorySize,
17  const std::vector<PredictionEngine>& predictionEngines) :
18  Base(iceMemory),
19  aronType(coreSegmentAronType),
20  predictionEngines(predictionEngines),
21  properties({defaultCoreSegmentName, defaultMaxHistorySize})
22  {
23  Logging::setTag("armarx::armem::SpecializedCoreSegment");
24  }
25 
27  {
28  }
29 
30  void
32  const std::string& prefix)
33  {
35 
36  defs->optional(properties.segmentName,
37  prefix + "seg.CoreSegmentName",
38  "Name of the " + properties.segmentName + " core segment.");
39 
40  defs->optional(properties.maxHistorySize,
41  prefix + "seg.CoreMaxHistorySize",
42  "Maximal size of the " + properties.segmentName +
43  " entity histories (-1 for infinite).");
44  }
45 
46  void
48  {
50  Logging::setTag(properties.segmentName + " Core Segment");
51 
53  {
55  }
56  else
57  {
58  ARMARX_INFO << "Adding core segment '" << properties.segmentName << "'";
60 
64  }
65  }
66 
67  void
68  SpecializedCoreSegment::setDefaultCoreSegmentName(const std::string& coreSegmentName)
69  {
70  this->properties.segmentName = coreSegmentName;
71  }
72 
73  void
75  {
76  this->properties.maxHistorySize = maxHistorySize;
77  }
78 
79  void
81  {
82  this->aronType = aronType;
83  }
84 
85  void
87  const std::vector<PredictionEngine>& predictionEngines)
88  {
89  this->predictionEngines = predictionEngines;
90  }
91 
94  {
96  return *segmentPtr;
97  }
98 
99  const wm::CoreSegment&
101  {
103  return *segmentPtr;
104  }
105 } // namespace armarx::armem::server::segment
armarx::armem::server::MemoryToIceAdapter::workingMemory
server::wm::Memory * workingMemory
Definition: MemoryToIceAdapter.h:89
armarx::armem::server::segment::SpecializedCoreSegment::Properties::segmentName
std::string segmentName
Definition: SpecializedCoreSegment.h:58
armarx::armem::server::wm::detail::MaxHistorySizeParent::setMaxHistorySize
void setMaxHistorySize(long maxSize)
Sets the maximum history size of entities in this container.
Definition: MaxHistorySize.h:41
armarx::armem::server::MemoryToIceAdapter
Helps connecting a Memory server to the Ice interface.
Definition: MemoryToIceAdapter.h:19
armarx::armem::server::segment::SpecializedCoreSegment::SpecializedCoreSegment
SpecializedCoreSegment(MemoryToIceAdapter &iceMemory, const std::string &defaultCoreSegmentName="", aron::type::ObjectPtr coreSegmentAronType=nullptr, int defaultMaxHistorySize=10, const std::vector< PredictionEngine > &predictionEngines={})
Definition: SpecializedCoreSegment.cpp:12
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:19
armarx::armem::server::segment::SpecializedCoreSegment::setAronType
void setAronType(aron::type::ObjectPtr aronType)
Definition: SpecializedCoreSegment.cpp:80
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:53
armarx::armem::server::segment::SpecializedCoreSegment::predictionEngines
std::vector< PredictionEngine > predictionEngines
Definition: SpecializedCoreSegment.h:54
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:47
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:68
PluginAll.h
MemoryToIceAdapter.h
armarx::armem::server::segment
Definition: constants.h:1
armarx::armem::server::wm::CoreSegment
base::CoreSegmentBase
Definition: memory_definitions.h:75
armarx::armem::server::segment::SpecializedCoreSegment::Properties::maxHistorySize
int64_t maxHistorySize
Definition: SpecializedCoreSegment.h:59
armarx::armem::server::segment::detail::SegmentBase< server::wm::CoreSegment >::iceMemory
MemoryToIceAdapter & iceMemory
Definition: SpecializedSegment.h:58
armarx::armem::server::segment::SpecializedCoreSegment::setDefaultMaxHistorySize
void setDefaultMaxHistorySize(int64_t maxHistorySize)
Definition: SpecializedCoreSegment.cpp:74
ARMARX_INFO
#define ARMARX_INFO
Definition: Logging.h:181
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:86
armarx::Logging::setTag
void setTag(const LogTag &tag)
Definition: Logging.cpp:54
armarx::armem::server::segment::SpecializedCoreSegment::~SpecializedCoreSegment
virtual ~SpecializedCoreSegment() override
Definition: SpecializedCoreSegment.cpp:26
armarx::armem::server::segment::SpecializedCoreSegment::aronType
aron::type::ObjectPtr aronType
Definition: SpecializedCoreSegment.h:53
armarx::armem::server::segment::SpecializedCoreSegment::properties
Properties properties
Definition: SpecializedCoreSegment.h:62
SpecializedCoreSegment.h
armarx::armem::server::segment::SpecializedCoreSegment::defineProperties
virtual void defineProperties(armarx::PropertyDefinitionsPtr defs, const std::string &prefix="") override
Definition: SpecializedCoreSegment.cpp:31