Plugin.h
Go to the documentation of this file.
1 #pragma once
2 
4 
5 #include <RobotAPI/interface/armem/client/MemoryListenerInterface.h>
6 #include <RobotAPI/interface/armem/mns/MemoryNameSystemInterface.h>
9 
10 namespace armarx
11 {
12  class Component;
13 }
14 
16 {
17  class Plugin;
18 }
19 
21 {
22 
24  {
25  public:
26  Plugin(ManagedIceObject& parent, std::string prefix);
27  virtual ~Plugin() override;
28 
29 
30  virtual void postCreatePropertyDefinitions(PropertyDefinitionsPtr& properties) override;
31 
32  virtual void preOnInitComponent() override;
33  virtual void postOnInitComponent() override;
34  virtual void postOnConnectComponent() override;
35  virtual void preOnDisconnectComponent() override;
36 
37 
38  public:
39  /// Set the name of the wm and the ltm
40  void setMemoryName(const std::string& memoryName);
41 
42 
43  protected:
44  /**
45  * @brief Register the parent component in the MNS.
46  *
47  * Called before onConnect() if MNS is enabled.
48  */
49  mns::dto::RegisterServerResult registerServer(armarx::Component& parent);
50 
51  /**
52  * @brief Remove the parent component from the MNS.
53  *
54  * Called before onDisconnect() if MNS is enabled.
55  */
56  mns::dto::RemoveServerResult removeServer();
57 
58 
59  public:
60  // Working Memory
61 
62  /// The actual memory.
64 
65  /// Helps connecting `memory` to ice. Used to handle Ice callbacks.
67 
68 
69  // Working Memory Updates (publishing)
70 
71  /// Available at onInit().
72  std::string memoryTopicName;
73  /// Available after onConnect().
74  client::MemoryListenerInterfacePrx memoryTopic;
75 
76 
77  // Long-Term Memory
78 
79  /// A manager class for the ltm. It internally holds a normal wm instance as a cache.
81 
82 
83  private:
84  client::plugins::Plugin* clientPlugin = nullptr;
85 
86  std::atomic_bool initialized = false;
87  std::atomic_bool connected = false;
88  std::atomic_bool statistics_saved = false;
89  };
90 } // namespace armarx::armem::server::plugins
91 
92 namespace armarx::armem::server
93 {
94  using plugins::Plugin;
95 }
armarx::armem::server::plugins::Plugin::postOnConnectComponent
virtual void postOnConnectComponent() override
Definition: Plugin.cpp:79
armarx::armem::server::plugins::Plugin::iceAdapter
MemoryToIceAdapter iceAdapter
Helps connecting memory to ice. Used to handle Ice callbacks.
Definition: Plugin.h:66
armarx::ManagedIceObjectPlugin::prefix
const std::string & prefix() const
Definition: ManagedIceObjectPlugin.cpp:63
armarx::ManagedIceObjectPlugin::parent
ManagedIceObject & parent()
Definition: ManagedIceObjectPlugin.cpp:69
armarx::armem::server::MemoryToIceAdapter
Helps connecting a Memory server to the Ice interface.
Definition: MemoryToIceAdapter.h:19
armarx::armem::server::plugins::Plugin::~Plugin
virtual ~Plugin() override
armarx::armem::server::ltm::Memory
A memory storing data on the hard drive and in mongodb (needs 'armarx memory start' to start the mong...
Definition: Memory.h:19
memory_definitions.h
armarx::armem::server::wm::Memory
Definition: memory_definitions.h:136
armarx::armem::server::plugins::Plugin::registerServer
mns::dto::RegisterServerResult registerServer(armarx::Component &parent)
Register the parent component in the MNS.
Definition: Plugin.cpp:172
armarx::ComponentPlugin
Definition: ComponentPlugin.h:38
armarx::armem::server::plugins::Plugin::longtermMemory
server::ltm::Memory longtermMemory
A manager class for the ltm. It internally holds a normal wm instance as a cache.
Definition: Plugin.h:80
armarx::armem::server::plugins::Plugin::Plugin
Plugin(ManagedIceObject &parent, std::string prefix)
Definition: Plugin.cpp:18
armarx::armem::server::plugins::Plugin::memoryTopicName
std::string memoryTopicName
Available at onInit().
Definition: Plugin.h:72
MemoryToIceAdapter.h
armarx::Component
Baseclass for all ArmarX ManagedIceObjects requiring properties.
Definition: Component.h:95
armarx::armem::server
Definition: GraspMemory.cpp:19
armarx::armem::server::plugins::Plugin::postCreatePropertyDefinitions
virtual void postCreatePropertyDefinitions(PropertyDefinitionsPtr &properties) override
Definition: Plugin.cpp:28
armarx::ManagedIceObject
The ManagedIceObject is the base class for all ArmarX objects.
Definition: ManagedIceObject.h:163
armarx::armem::laser_scans::constants::memoryName
const std::string memoryName
Definition: constants.h:28
armarx::armem::server::plugins::Plugin::setMemoryName
void setMemoryName(const std::string &memoryName)
Set the name of the wm and the ltm.
Definition: Plugin.cpp:160
IceUtil::Handle< class PropertyDefinitionContainer >
armarx::armem::server::plugins::Plugin::postOnInitComponent
virtual void postOnInitComponent() override
Definition: Plugin.cpp:59
armarx::armem::client::plugins
This file is part of ArmarX.
Definition: forward_declarations.h:24
armarx::armem::server::plugins::Plugin::preOnDisconnectComponent
virtual void preOnDisconnectComponent() override
Definition: Plugin.cpp:97
armarx::armem::server::plugins::Plugin::memoryTopic
client::MemoryListenerInterfacePrx memoryTopic
Available after onConnect().
Definition: Plugin.h:74
plugins::Plugin
ComponentPlugin.h
armarx::armem::server::plugins::Plugin::preOnInitComponent
virtual void preOnInitComponent() override
Definition: Plugin.cpp:50
armarx::armem::server::plugins::Plugin::workingMemory
server::wm::Memory workingMemory
The actual memory.
Definition: Plugin.h:63
armarx::armem::server::plugins
Definition: Plugin.cpp:13
armarx::armem::server::plugins::Plugin
Definition: Plugin.h:23
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
armarx::armem::client::plugins::Plugin
A component plugin offering client-side access to to the working memory system by providing a Memory ...
Definition: Plugin.h:20
armarx::armem::server::plugins::Plugin::removeServer
mns::dto::RemoveServerResult removeServer()
Remove the parent component from the MNS.
Definition: Plugin.cpp:204