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