Go to the documentation of this file.
30 const std::string
prefix =
"mem.";
40 if (not properties->hasDefinition(
prefix +
"MemoryName"))
112 <<
"Stored working memory contents into long-term memory on component stop";
117 <<
"Not storing WM into LTM on stop, as longtermMemory.p.storeOnstop is "
124 <<
"Could not store working memory into the long-term memory on component stop.";
131 ARMARX_INFO <<
"Recording still in progress, stopping component anyways. "
132 "Saving statistics...";
138 ARMARX_WARNING <<
"Statistics could not be saved for recording that was interrupted by "
139 "disconnecting the component";
153 ARMARX_WARNING <<
"Please set the memory name before initializing the component. "
154 "Otherwise the WM and LTM may have different names";
160 mns::dto::RegisterServerResult
167 mns::dto::MemoryServerInterfaces server;
168 server.reading = ReadingMemoryInterfacePrx::uncheckedCast(
parent.
getProxy());
169 server.writing = WritingMemoryInterfacePrx::uncheckedCast(
parent.
getProxy());
170 server.prediction = PredictingMemoryInterfacePrx::uncheckedCast(
parent.
getProxy());
171 server.actions = actions::ActionsInterfacePrx::uncheckedCast(
parent.
getProxy());
173 mns::dto::RegisterServerResult result;
177 result.success =
true;
179 <<
" in the Memory Name System (MNS).";
183 result.success =
false;
184 result.errorMessage = e.what();
192 mns::dto::RemoveServerResult
197 mns::dto::RemoveServerResult result;
201 result.success =
true;
203 <<
" from the Memory Name System (MNS).";
207 result.success =
false;
208 result.errorMessage = e.what();
211 catch (
const Ice::NotRegisteredException&)
214 result.success =
false;
215 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...
PluginT * addPlugin(const std::string prefix="", ParamsT &&... params)
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.
struct armarx::armem::server::ltm::detail::MemoryBase::Properties p
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)
void directlyStore(const armem::wm::Memory &memory, bool simulatedVersion=false)
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
virtual void preOnConnectComponent() 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