SpecializedCoreSegment.h
Go to the documentation of this file.
1 #pragma once
2 
5 
7 
10 
11 #include <string>
12 
14 
16 {
17  /**
18  * @brief A base class for core segments
19  */
20  class SpecializedCoreSegment : public detail::SegmentBase<server::wm::CoreSegment>
21  {
23 
24  public:
25 
28  const std::string& defaultCoreSegmentName = "",
29  aron::type::ObjectPtr coreSegmentAronType = nullptr,
30  int defaultMaxHistorySize = 10,
31  const std::vector<PredictionEngine>& predictionEngines = {});
32 
33  virtual ~SpecializedCoreSegment() override;
34 
35  virtual void defineProperties(armarx::PropertyDefinitionsPtr defs, const std::string& prefix = "") override;
36  virtual void init() override;
37 
38  template <class FunctionT>
39  auto doLocked(FunctionT&& function) const
40  {
41  return segmentPtr->doLocked(function);
42  }
43 
44  void setDefaultCoreSegmentName(const std::string& coreSegmentName);
45  void setDefaultMaxHistorySize(int64_t maxHistorySize);
47  void
48  setPredictionEngines(const std::vector<PredictionEngine>& predictionEngines);
49 
51  const wm::CoreSegment& getCoreSegment() const;
52 
53 
54  public:
55 
57  std::vector<PredictionEngine> predictionEngines;
58 
59  struct Properties
60  {
61  std::string segmentName;
62  int64_t maxHistorySize;
63  };
65 
66  };
67 }
armarx::armem::server::segment::SpecializedCoreSegment::Properties::segmentName
std::string segmentName
Definition: SpecializedCoreSegment.h:61
armarx::armem::server::segment::SpecializedCoreSegment
A base class for core segments.
Definition: SpecializedCoreSegment.h:20
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:13
armarx::armem::server::segment::SpecializedCoreSegment::setAronType
void setAronType(aron::type::ObjectPtr aronType)
Definition: SpecializedCoreSegment.cpp:81
memory_definitions.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
SpecializedSegment.h
armarx::armem::server::segment::detail::SegmentBase
A base class for memory servers to manage their segments.
Definition: SpecializedSegment.h:24
armarx::armem::server::segment::SpecializedCoreSegment::init
virtual void init() override
Definition: SpecializedCoreSegment.cpp:49
armarx::armem::server::segment::SpecializedCoreSegment::doLocked
auto doLocked(FunctionT &&function) const
Definition: SpecializedCoreSegment.h:39
armarx::armem::server::segment::SpecializedCoreSegment::setDefaultCoreSegmentName
void setDefaultCoreSegmentName(const std::string &coreSegmentName)
Definition: SpecializedCoreSegment.cpp:69
armarx::armem::server::segment::SpecializedCoreSegment::Properties
Definition: SpecializedCoreSegment.h:59
armarx::armem::server::wm::CoreSegment::doLocked
auto doLocked(FunctionT &&function) const
Definition: memory_definitions.h:120
forward_declarations.h
armarx::armem::server::segment
Definition: constants.h:1
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
forward_declarations.h
IceUtil::Handle< class PropertyDefinitionContainer >
forward_declarations.h
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
Logging.h
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
armarx::armem::server::segment::SpecializedCoreSegment::defineProperties
virtual void defineProperties(armarx::PropertyDefinitionsPtr defs, const std::string &prefix="") override
Definition: SpecializedCoreSegment.cpp:33