Go to the documentation of this file.
30 const std::string
prefix =
"mem.";
40 if (not properties->hasDefinition(
prefix +
"MemoryName"))
142 ARMARX_INFO <<
"Recording still in progress, stopping component anyways. "
143 "Saving statistics...";
149 ARMARX_WARNING <<
"Statistics could not be saved for recording that was interrupted by "
150 "disconnecting the component";
164 ARMARX_WARNING <<
"Please set the memory name before initializing the component. "
165 "Otherwise the WM and LTM may have different names";
171 mns::dto::RegisterServerResult
178 mns::dto::MemoryServerInterfaces server;
179 server.reading = ReadingMemoryInterfacePrx::uncheckedCast(
parent.
getProxy());
180 server.writing = WritingMemoryInterfacePrx::uncheckedCast(
parent.
getProxy());
181 server.prediction = PredictingMemoryInterfacePrx::uncheckedCast(
parent.
getProxy());
182 server.actions = actions::ActionsInterfacePrx::uncheckedCast(
parent.
getProxy());
184 mns::dto::RegisterServerResult result;
188 result.success =
true;
190 <<
" in the Memory Name System (MNS).";
194 result.success =
false;
195 result.errorMessage = e.what();
203 mns::dto::RemoveServerResult
208 mns::dto::RemoveServerResult result;
212 result.success =
true;
214 <<
" from the Memory Name System (MNS).";
218 result.success =
false;
219 result.errorMessage = e.what();
222 catch (
const Ice::NotRegisteredException&)
225 result.success =
false;
226 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)
armem::CommitResult reloadFromLTM()
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