Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
properties are now stored in maps and managed by ProperyHolder
[simgrid.git] / src / s4u / s4u_actor.cpp
index 859dfe7..7dcef8f 100644 (file)
@@ -174,14 +174,17 @@ void Actor::killAll(int resetPid)
 /** Retrieve the property value (or nullptr if not set) */
 const char* Actor::getProperty(const char* key)
 {
-  return (char*)xbt_dict_get_or_null(simcall_process_get_properties(pimpl_), key);
+  return simgrid::simix::kernelImmediate([this, key] { return pimpl_->getProperty(key); });
 }
 
 void Actor::setProperty(const char* key, const char* value)
 {
-  simgrid::simix::kernelImmediate([this, key, value] {
-    xbt_dict_set(simcall_process_get_properties(pimpl_), key, (char*)value, (void_f_pvoid_t) nullptr);
-  });
+  simgrid::simix::kernelImmediate([this, key, value] { pimpl_->setProperty(key, value); });
+}
+
+Actor* Actor::restart()
+{
+  return simgrid::simix::kernelImmediate([this]() { return pimpl_->restart(); });
 }
 
 // ***** this_actor *****
@@ -222,31 +225,32 @@ void execute(double flops)
   simcall_execution_wait(s);
 }
 
-void* recv(MailboxPtr chan) {
+void* recv(MailboxPtr chan) // deprecated
+{
   return chan->get();
 }
 
-void* recv(MailboxPtr chan, double timeout)
+void* recv(MailboxPtr chan, double timeout) // deprecated
 {
   return chan->get(timeout);
 }
 
-void send(MailboxPtr chan, void* payload, double simulatedSize)
+void send(MailboxPtr chan, void* payload, double simulatedSize) // deprecated
 {
   chan->put(payload, simulatedSize);
 }
 
-void send(MailboxPtr chan, void* payload, double simulatedSize, double timeout)
+void send(MailboxPtr chan, void* payload, double simulatedSize, double timeout) // deprecated
 {
   chan->put(payload, simulatedSize, timeout);
 }
 
-CommPtr isend(MailboxPtr chan, void* payload, double simulatedSize)
+CommPtr isend(MailboxPtr chan, void* payload, double simulatedSize) // deprecated
 {
   return chan->put_async(payload, simulatedSize);
 }
 
-CommPtr irecv(MailboxPtr chan, void** data)
+CommPtr irecv(MailboxPtr chan, void** data) // deprecated
 {
   return chan->get_async(data);
 }