Plugin.cpp
Go to the documentation of this file.
1#include "Plugin.h"
2
6
10
12{
13
15 {
16 }
17
19 {
20 }
21
22 void
24 {
25 if (not properties->hasDefinition(makePropertyName(PROPERTY_MNS_NAME_NAME)))
26 {
27 properties->defineOptionalProperty<std::string>(
28 makePropertyName(PROPERTY_MNS_NAME_NAME),
29 memoryNameSystemName,
30 "Name of the Memory Name System (MNS) component.");
31 }
32 if (not properties->hasDefinition(makePropertyName(PROPERTY_MNS_ENABLED_NAME)))
33 {
34 properties->defineOptionalProperty<bool>(
35 makePropertyName(PROPERTY_MNS_ENABLED_NAME),
36 memoryNameSystemEnabled,
37 "Whether to use (and depend on) the Memory Name System (MNS)."
38 "\nSet to false to use this memory as a stand-alone.");
39 }
40 }
41
42 void
44 {
45 parent<Component>().getProperty(memoryNameSystemName,
46 makePropertyName(PROPERTY_MNS_NAME_NAME));
47 parent<Component>().getProperty(memoryNameSystemEnabled,
48 makePropertyName(PROPERTY_MNS_ENABLED_NAME));
49
51 {
53 }
54 }
55
56 void
58 {
60 {
61 ARMARX_DEBUG << "Creating MemoryNameSystem client with owning component '"
62 << parent().getName() << "'.";
63 memoryNameSystem.initialize(getMemoryNameSystemProxy(), &parent());
64 }
65 }
66
67 bool
69 {
70 return memoryNameSystemEnabled;
71 }
72
73 std::string
75 {
76 return memoryNameSystemName;
77 }
78
79 mns::MemoryNameSystemInterfacePrx
81 {
83 ? parent<ManagedIceObject>().getProxy<mns::MemoryNameSystemInterfacePrx>(
85 : nullptr;
86 }
87
90 {
91 return memoryNameSystem;
92 }
93
94 const MemoryNameSystem&
96 {
97 return memoryNameSystem;
98 }
99
100} // namespace armarx::armem::client::plugins
std::string makePropertyName(const std::string &name)
bool usingProxy(const std::string &name, const std::string &endpoints="")
Registers a proxy for retrieval after initialization and adds it to the dependency list.
std::string getName() const
Retrieve name of object.
Ice::ObjectPrx getProxy(long timeoutMs=0, bool waitForScheduler=true) const
Returns the proxy of this object (optionally it waits for the proxy)
The memory name system (MNS) client.
std::string getMemoryNameSystemName()
Get the name of the MNS component.
Definition Plugin.cpp:74
void postCreatePropertyDefinitions(PropertyDefinitionsPtr &properties) override
Definition Plugin.cpp:23
mns::MemoryNameSystemInterfacePrx getMemoryNameSystemProxy()
Get the MNS proxy.
Definition Plugin.cpp:80
bool isMemoryNameSystemEnabled()
Indicate whether the Memory Name System (MNS) is enabled.
Definition Plugin.cpp:68
MemoryNameSystem & getMemoryNameSystemClient()
Get the MNS client.
Definition Plugin.cpp:89
Plugin(ManagedIceObject &parent, std::string pre)
Definition Plugin.cpp:14
#define ARMARX_DEBUG
The logging level for output that is only interesting while debugging.
Definition Logging.h:184
This file is part of ArmarX.
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.