#define SIMGRID_S4U_ACTIVITY_HPP
#include <simgrid/forward.h>
+#include <xbt/signal.hpp>
namespace simgrid {
namespace s4u {
* - Synchronization activities may possibly be connected to no action.
*/
class XBT_PUBLIC Activity {
- friend Comm;
+ friend simgrid::s4u::Comm;
friend XBT_PUBLIC void intrusive_ptr_release(Comm * c);
friend XBT_PUBLIC void intrusive_ptr_add_ref(Comm * c);
- friend Exec;
+ friend simgrid::s4u::Exec;
friend XBT_PUBLIC void intrusive_ptr_release(Exec * e);
friend XBT_PUBLIC void intrusive_ptr_add_ref(Exec * e);
- friend Io;
+ friend simgrid::s4u::Io;
friend XBT_PUBLIC void intrusive_ptr_release(Io* i);
friend XBT_PUBLIC void intrusive_ptr_add_ref(Io* i);
virtual ~Activity() = default;
public:
+#ifndef DOXYGEN
Activity(Activity const&) = delete;
Activity& operator=(Activity const&) = delete;
+#endif
enum class State { INITED = 0, STARTED, CANCELED, ERRORED, FINISHED };
virtual Activity* cancel() = 0;
/** Retrieve the current state of the activity */
Activity::State get_state() { return state_; }
+ /** Returns whether this activity is completed */
+ virtual bool test() = 0;
/** Get the remaining amount of work that this Activity entails. When it's 0, it's done. */
virtual double get_remaining();
/** Retrieve the user data of the Activity */
void* get_user_data() { return user_data_; }
+#ifndef DOXYGEN
/** @deprecated See Activity::get_state()*/
XBT_ATTRIB_DEPRECATED_v323("Please use Activity::get_state()") Activity::State getState() { return state_; }
/** @deprecated See Activity::get_remaining() */
}
/** @deprecated See Activity::get_user_data() */
XBT_ATTRIB_DEPRECATED_v323("Please use Activity::get_user_data()") void* getUserData() { return user_data_; }
+#endif
private:
simgrid::kernel::activity::ActivityImplPtr pimpl_ = nullptr;