Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Sanitize the prototype of Actor::on_exit() callbacks
[simgrid.git] / include / simgrid / simix.h
index f3eed0e..05f0e26 100644 (file)
@@ -129,12 +129,13 @@ XBT_PUBLIC void SIMIX_launch_application(const std::string& file);
  */
 
 #ifdef __cplusplus
-XBT_PUBLIC smx_actor_t SIMIX_process_attach(const char* name, void* data, const char* hostname,
-                                            std::unordered_map<std::string, std::string>* properties,
-                                            smx_actor_t parent_process);
+XBT_ATTRIB_DEPRECATED_v325("Please use ActorImpl::attach() or sg_actor_attach()") XBT_PUBLIC smx_actor_t
+    SIMIX_process_attach(const char* name, void* data, const char* hostname,
+                         std::unordered_map<std::string, std::string>* properties, smx_actor_t parent_process);
 #endif
 SG_BEGIN_DECL()
-XBT_PUBLIC void SIMIX_process_detach();
+XBT_ATTRIB_DEPRECATED_v325("Please use ActorImpl::detach() or sg_actor_detach()") XBT_PUBLIC
+    void SIMIX_process_detach();
 SG_END_DECL()
 
 /********************************* Process ************************************/
@@ -149,7 +150,8 @@ XBT_PUBLIC void SIMIX_process_on_exit(smx_actor_t process, int_f_pvoid_pvoid_t f
 SG_END_DECL()
 
 #ifdef __cplusplus
-XBT_PUBLIC void SIMIX_process_on_exit(smx_actor_t process, std::function<void(int, void*)> fun, void* data);
+XBT_PUBLIC void SIMIX_process_on_exit(smx_actor_t process, std::function<void(bool /*failed*/, void* /*data*/)> fun,
+                                      void* data);
 #endif
 
 /****************************** Communication *********************************/
@@ -176,9 +178,9 @@ XBT_ATTRIB_DEPRECATED_v325("Please use CommImpl::finish") XBT_PUBLIC void SIMIX_
 XBT_PUBLIC smx_activity_t simcall_execution_parallel_start(const std::string& name, int host_nb,
                                                            const sg_host_t* host_list, const double* flops_amount,
                                                            const double* bytes_amount, double rate, double timeout);
+XBT_PUBLIC e_smx_state_t simcall_execution_wait(const smx_activity_t& execution);
 XBT_PUBLIC e_smx_state_t simcall_execution_test(const smx_activity_t& execution);
 #endif
-XBT_PUBLIC e_smx_state_t simcall_execution_wait(smx_activity_t execution);
 
 /**************************** Process simcalls ********************************/
 SG_BEGIN_DECL()
@@ -224,19 +226,20 @@ XBT_PUBLIC smx_activity_t simcall_comm_irecv(smx_actor_t receiver, smx_mailbox_t
 XBT_PUBLIC smx_activity_t simcall_comm_iprobe(smx_mailbox_t mbox, int type,
                                               int (*match_fun)(void*, void*, simgrid::kernel::activity::CommImpl*),
                                               void* data);
-#endif
 
 /* FIXME: waitany is going to be a vararg function, and should take a timeout */
-XBT_PUBLIC unsigned int simcall_comm_waitany(smx_activity_t* comms, size_t count, double timeout);
-XBT_PUBLIC void simcall_comm_wait(smx_activity_t comm, double timeout);
-XBT_PUBLIC int simcall_comm_test(smx_activity_t comm);
-XBT_PUBLIC int simcall_comm_testany(smx_activity_t* comms, size_t count);
+XBT_PUBLIC unsigned int simcall_comm_waitany(smx_activity_t comms[], size_t count, double timeout);
+XBT_PUBLIC unsigned int simcall_comm_waitany(simgrid::kernel::activity::CommImpl* comms[], size_t count,
+                                             double timeout);
+XBT_PUBLIC void simcall_comm_wait(const smx_activity_t& comm, double timeout);
+XBT_PUBLIC int simcall_comm_test(const smx_activity_t& comm);
+XBT_PUBLIC int simcall_comm_testany(smx_activity_t comms[], size_t count);
+XBT_PUBLIC int simcall_comm_testany(simgrid::kernel::activity::CommImpl* comms[], size_t count);
+#endif
 
 /************************** Synchro simcalls **********************************/
 SG_BEGIN_DECL()
 XBT_PUBLIC smx_mutex_t simcall_mutex_init();
-XBT_PUBLIC smx_mutex_t SIMIX_mutex_ref(smx_mutex_t mutex);
-XBT_PUBLIC void SIMIX_mutex_unref(smx_mutex_t mutex);
 XBT_PUBLIC void simcall_mutex_lock(smx_mutex_t mutex);
 XBT_PUBLIC int simcall_mutex_trylock(smx_mutex_t mutex);
 XBT_PUBLIC void simcall_mutex_unlock(smx_mutex_t mutex);