Go to the documentation of this file.
30 const std::string
prefix =
"mem.";
40 if (not properties->hasDefinition(
prefix +
"MemoryName"))
140 ARMARX_INFO <<
"Recording still in progress, stopping component anyways. "
141 "Saving statistics...";
147 ARMARX_WARNING <<
"Statistics could not be saved for recording that was interrupted by "
148 "disconnecting the component";
162 ARMARX_WARNING <<
"Please set the memory name before initializing the component. "
163 "Otherwise the WM and LTM may have different names";
169 mns::dto::RegisterServerResult
176 mns::dto::MemoryServerInterfaces server;
177 server.reading = ReadingMemoryInterfacePrx::uncheckedCast(
parent.
getProxy());
178 server.writing = WritingMemoryInterfacePrx::uncheckedCast(
parent.
getProxy());
179 server.prediction = PredictingMemoryInterfacePrx::uncheckedCast(
parent.
getProxy());
180 server.actions = actions::ActionsInterfacePrx::uncheckedCast(
parent.
getProxy());
182 mns::dto::RegisterServerResult result;
186 result.success =
true;
188 <<
" in the Memory Name System (MNS).";
192 result.success =
false;
193 result.errorMessage = e.what();
201 mns::dto::RemoveServerResult
206 mns::dto::RemoveServerResult result;
210 result.success =
true;
212 <<
" from the Memory Name System (MNS).";
216 result.success =
false;
217 result.errorMessage = e.what();
220 catch (
const Ice::NotRegisteredException&)
223 result.success =
false;
224 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