MemoryItem.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <map>
4 #include <mutex>
5 #include <optional>
6 #include <string>
7 
9 
11 {
12  /// @brief Interface functions for the longterm memory classes
13  class MemoryItem
14  {
15  public:
16  MemoryItem(const std::string& exportName, const MemoryID&); // only used by memory
17  MemoryItem(const std::string& exportName,
18  const MemoryID&,
19  const std::shared_ptr<Processors>&); // used by all other segments
20  virtual ~MemoryItem() = default;
21 
22  void setExportName(const std::string& n);
23  void setMemoryID(const MemoryID&);
24  void setMemoryName(const std::string& memoryName);
25 
26  virtual std::string getExportName() const
27  {
28  return exportName;
29  }
30 
31 
32  MemoryID
33  getMemoryID() const
34  {
35  return id();
36  }
37 
38  // aliases
39  MemoryID id() const;
40  std::string name() const;
41 
42  protected:
43  virtual void
44  _setExportName(const std::string&)
45  {
46  }
47 
48  virtual void
50  {
51  }
52 
53  protected:
54  std::shared_ptr<Processors> processors;
55 
56  private:
57  std::string exportName = "MemoryExportMI";
58  MemoryID _id;
59  };
60 } // namespace armarx::armem::server::ltm::detail
armarx::armem::server::ltm::detail
Definition: CoreSegmentBase.cpp:3
armarx::armem::server::ltm::detail::MemoryItem::getMemoryID
MemoryID getMemoryID() const
Definition: MemoryItem.h:33
armarx::armem::server::ltm::detail::MemoryItem::processors
std::shared_ptr< Processors > processors
Definition: MemoryItem.h:54
armarx::armem::server::ltm::detail::MemoryItem::MemoryItem
MemoryItem(const std::string &exportName, const MemoryID &)
Definition: MemoryItem.cpp:10
Processors.h
armarx::armem::MemoryID
A memory ID.
Definition: MemoryID.h:47
armarx::armem::server::ltm::detail::MemoryItem::setMemoryID
void setMemoryID(const MemoryID &)
Definition: MemoryItem.cpp:30
armarx::armem::server::ltm::detail::MemoryItem::setMemoryName
void setMemoryName(const std::string &memoryName)
Definition: MemoryItem.cpp:49
armarx::armem::server::ltm::detail::MemoryItem::getExportName
virtual std::string getExportName() const
Definition: MemoryItem.h:26
armarx::armem::server::ltm::detail::MemoryItem::~MemoryItem
virtual ~MemoryItem()=default
armarx::armem::server::ltm::detail::MemoryItem::id
MemoryID id() const
Definition: MemoryItem.cpp:37
armarx::armem::laser_scans::constants::memoryName
const std::string memoryName
Definition: constants.h:28
armarx::armem::server::ltm::detail::MemoryItem::setExportName
void setExportName(const std::string &n)
Definition: MemoryItem.cpp:23
armarx::armem::server::ltm::detail::MemoryItem::_setMemoryID
virtual void _setMemoryID(const MemoryID &)
Definition: MemoryItem.h:49
armarx::armem::server::ltm::detail::MemoryItem::_setExportName
virtual void _setExportName(const std::string &)
Definition: MemoryItem.h:44
armarx::armem::server::ltm::detail::MemoryItem
Interface functions for the longterm memory classes.
Definition: MemoryItem.h:13
armarx::armem::server::ltm::detail::MemoryItem::name
std::string name() const
Definition: MemoryItem.cpp:43