Go to the documentation of this file.
30 const std::string
prefix =
"mem.";
40 if (not properties->hasDefinition(
prefix +
"MemoryName"))
138 ARMARX_INFO <<
"Recording still in progress, stopping component anyways. "
139 "Saving statistics...";
143 ARMARX_WARNING <<
"Statistics could not be saved for recording that was interrupted by "
144 "disconnecting the component";
158 ARMARX_WARNING <<
"Please set the memory name before initializing the component. "
159 "Otherwise the WM and LTM may have different names";
165 mns::dto::RegisterServerResult
172 mns::dto::MemoryServerInterfaces server;
173 server.reading = ReadingMemoryInterfacePrx::uncheckedCast(
parent.
getProxy());
174 server.writing = WritingMemoryInterfacePrx::uncheckedCast(
parent.
getProxy());
175 server.prediction = PredictingMemoryInterfacePrx::uncheckedCast(
parent.
getProxy());
176 server.actions = actions::ActionsInterfacePrx::uncheckedCast(
parent.
getProxy());
178 mns::dto::RegisterServerResult result;
182 result.success =
true;
184 <<
" in the Memory Name System (MNS).";
188 result.success =
false;
189 result.errorMessage = e.what();
197 mns::dto::RemoveServerResult
202 mns::dto::RemoveServerResult result;
206 result.success =
true;
208 <<
" from the Memory Name System (MNS).";
212 result.success =
false;
213 result.errorMessage = e.what();
216 catch (
const Ice::NotRegisteredException&)
219 result.success =
false;
220 result.errorMessage =
"Memory Name System is gone.";
void removeServer(const MemoryID &memoryID)
Remove a memory server from the MNS.
virtual void postOnConnectComponent() override
MemoryToIceAdapter iceAdapter
Helps connecting memory to ice. Used to handle Ice callbacks.
void addPluginDependency(ManagedIceObjectPlugin *dependedOn)
bool isMemoryNameSystemEnabled()
Indicate whether the Memory Name System (MNS) is enabled.
const std::string & prefix() const
MemoryID withMemoryName(const std::string &name) const
MemoryNameSystem & getMemoryNameSystemClient()
Get the MNS client.
ManagedIceObject & parent()
void getAndSaveStatistics()
getAndSaveStatistics generates and saves statistics for a LTM recording
virtual ~Plugin() override
#define ARMARX_CHECK_NOT_NULL(ptr)
This macro evaluates whether ptr is not null and if it turns out to be false it will throw an Express...
void createPropertyDefinitions(PropertyDefinitionsPtr &defs, const std::string &prefix) override
default parameters. Implementation should use the configuration to configure
void registerServer(const MemoryID &memoryID, mns::dto::MemoryServerInterfaces server)
Register a memory server in the MNS.
PluginT * addPlugin(const std::string prefix="", ParamsT &&...params)
static std::string MakeMemoryTopicName(const MemoryID &memoryID)
void setMemoryListener(client::MemoryListenerInterfacePrx memoryListenerTopic)
void setMemoryID(const MemoryID &)
mns::dto::RegisterServerResult registerServer(armarx::Component &parent)
Register the parent component in the MNS.
server::ltm::Memory longtermMemory
A manager class for the ltm. It internally holds a normal wm instance as a cache.
Plugin(ManagedIceObject &parent, std::string prefix)
std::string memoryTopicName
Available at onInit().
Baseclass for all ArmarX ManagedIceObjects requiring properties.
virtual std::string getDefaultName() const =0
Retrieve default name of component.
virtual void postCreatePropertyDefinitions(PropertyDefinitionsPtr &properties) override
The ManagedIceObject is the base class for all ArmarX objects.
TopicProxyType getTopic(const std::string &name)
Returns a proxy of the specified topic.
void offeringTopic(const std::string &name)
Registers a topic for retrival after initialization.
const std::string memoryName
Indicates that a query to the Memory Name System failed.
void setMemoryName(const std::string &memoryName)
Set the name of the wm and the ltm.
virtual void postOnInitComponent() override
virtual void preOnDisconnectComponent() override
client::MemoryListenerInterfacePrx memoryTopic
Available after onConnect().
std::string getName() const
Retrieve name of object.
virtual void preOnInitComponent() override
server::wm::Memory workingMemory
The actual memory.
Ice::ObjectPrx getProxy(long timeoutMs=0, bool waitForScheduler=true) const
Returns the proxy of this object (optionally it waits for the proxy)
This file offers overloads of toIce() and fromIce() functions for STL container types.
void configure()
initialize config
mns::dto::RemoveServerResult removeServer()
Remove the parent component from the MNS.
const armem::MemoryID MemoryID