xbt::signal<void(AnyActivity&)> on_this_veto;
public:
- /*! Add a callback fired when the activity completes (either normally, cancelled or failed) */
+ /*! \static Add a callback fired when any activity completes (either normally, cancelled or failed) */
static void on_completion_cb(const std::function<void(AnyActivity const&)>& cb) { on_completion.connect(cb); }
+ /*! Add a callback fired when this specific activity completes (either normally, cancelled or failed) */
void on_this_completion_cb(const std::function<void(AnyActivity const&)>& cb) { on_this_completion.connect(cb); }
- /*! Add a callback fired when the activity is suspended */
+ /*! \static Add a callback fired when any activity is suspended */
static void on_suspend_cb(const std::function<void(AnyActivity const&)>& cb) { on_suspend.connect(cb); }
+ /*! Add a callback fired when this specific activity is suspended */
void on_this_suspend_cb(const std::function<void(AnyActivity const&)>& cb) { on_this_suspend.connect(cb); }
- /*! Add a callback fired when the activity is resumed after being suspended */
+ /*! \static Add a callback fired when any activity is resumed after being suspended */
static void on_resume_cb(const std::function<void(AnyActivity const&)>& cb) { on_resume.connect(cb); }
+ /*! Add a callback fired when this specific activity is resumed after being suspended */
void on_this_resume_cb(const std::function<void(AnyActivity const&)>& cb) { on_this_resume.connect(cb); }
- /*! Add a callback fired each time that the activity fails to start because of a veto (e.g., unsolved dependency or no
- * resource assigned) */
+ /*! \static Add a callback fired each time that any activity fails to start because of a veto (e.g., unsolved
+ * dependency or no resource assigned) */
static void on_veto_cb(const std::function<void(AnyActivity&)>& cb) { on_veto.connect(cb); }
+ /*! Add a callback fired each time that this specific activity fails to start because of a veto (e.g., unsolved
+ * dependency or no resource assigned) */
void on_this_veto_cb(const std::function<void(AnyActivity&)>& cb) { on_this_veto.connect(cb); }
XBT_ATTRIB_DEPRECATED_v337("Please use on_suspend_cb() instead") static void on_suspended_cb(
Barrier& operator=(Barrier const&) = delete;
#endif
- /** Creates a barrier for the given amount of actors */
+ /** \static Creates a barrier for the given amount of actors */
static BarrierPtr create(unsigned int expected_actors);
/** Blocks into the barrier. Every waiting actors will be unlocked once the expected amount of actors reaches the barrier */
int wait();
void fire_on_this_veto() const override { on_this_veto(const_cast<Comm&>(*this)); }
public:
+ /*! \static Add a callback fired when the send of any Comm is posted */
static void on_send_cb(const std::function<void(Comm const&)>& cb) { on_send.connect(cb); }
+ /*! \static Add a callback fired when the recv of any Comm is posted */
static void on_recv_cb(const std::function<void(Comm const&)>& cb) { on_recv.connect(cb); }
+ /*! \static Add a callback fired when any Comm starts */
static void on_start_cb(const std::function<void(Comm const&)>& cb) { on_start.connect(cb); }
+ /*! Add a callback fired when this specific Comm starts */
void on_this_start_cb(const std::function<void(Comm const&)>& cb) { on_this_start.connect(cb); }
CommPtr set_copy_data_callback(const std::function<void(kernel::activity::CommImpl*, void*, size_t)>& callback);
const std::function<void(simgrid::kernel::activity::CommImpl*, void*, size_t)>& copy_data_fun,
void* data, double timeout, double rate);
- /* "One-sided" communications. This way of communicating bypasses the mailbox and actors mechanism. It creates a
+ /* \static
+ * "One-sided" communications. This way of communicating bypasses the mailbox and actors mechanism. It creates a
* communication (vetoabled, asynchronous, or synchronous) directly between two hosts. There is really no limit on
* the hosts involved. In particular, the actor creating such a communication does not have to be on one of the
* involved hosts! Enjoy the comfort of the simulator :)
Comm* wait_for(double timeout) override;
- /*! take a vector s4u::CommPtr and return the rank of the first finished one (or -1 if none is done). */
+ /*! \static take a vector s4u::CommPtr and return the rank of the first finished one (or -1 if none is done). */
static ssize_t test_any(const std::vector<CommPtr>& comms);
- /*! take a vector s4u::CommPtr and return when one of them is finished.
+ /*! \static take a vector s4u::CommPtr and return when one of them is finished.
* The return value is the rank of the first finished CommPtr. */
static ssize_t wait_any(const std::vector<CommPtr>& comms) { return wait_any_for(comms, -1); }
- /*! Same as wait_any, but with a timeout. Return -1 if the timeout occurs.*/
+ /*! \static Same as wait_any, but with a timeout. Return -1 if the timeout occurs.*/
static ssize_t wait_any_for(const std::vector<CommPtr>& comms, double timeout);
- /*! take a vector s4u::CommPtr and return when all of them is finished. */
+ /*! \static take a vector s4u::CommPtr and return when all of them is finished. */
static void wait_all(const std::vector<CommPtr>& comms);
- /*! Same as wait_all, but with a timeout. Return the number of terminated comm (less than comms.size() if the timeout
- * occurs). */
+ /*! \static Same as wait_all, but with a timeout. Return the number of terminated comm (less than comms.size() if
+ * the timeout occurs). */
static size_t wait_all_for(const std::vector<CommPtr>& comms, double timeout);
};
} // namespace simgrid::s4u
#endif
public:
- /** Create a new condition variable and return a smart pointer
+ /** \static Create a new condition variable and return a smart pointer
*
* @beginrst
* You should only manipulate :cpp:type:`simgrid::s4u::ConditionVariablePtr`, as created by this function (see also :ref:`s4u_raii`).
Disk* seal();
/* The signals */
- /** @brief Add a callback fired when a new Disk is created */
+ /** @brief \static Add a callback fired when a new Disk is created */
static void on_creation_cb(const std::function<void(Disk&)>& cb) { on_creation.connect(cb); }
- /** @brief Add a callback fired when any Disk is destroyed */
+ /** @brief \static Add a callback fired when any Disk is destroyed */
static void on_destruction_cb(const std::function<void(Disk const&)>& cb) { on_destruction.connect(cb); }
/** @brief Add a callback fired when this specific Disk is destroyed */
void on_this_destruction_cb(const std::function<void(Disk const&)>& cb) { on_this_destruction.connect(cb); }
- /** @brief Add a callback fired when any Disk is turned on or off */
+ /** @brief \static Add a callback fired when any Disk is turned on or off */
static void on_onoff_cb(const std::function<void(Disk const&)>& cb)
{
on_onoff.connect(cb);
Exec(Exec const&) = delete;
Exec& operator=(Exec const&) = delete;
#endif
- /*! Signal fired each time that an execution actually starts (no veto) */
+ /*! \static Signal fired each time that any execution actually starts (no veto) */
static void on_start_cb(const std::function<void(Exec const&)>& cb) { on_start.connect(cb); }
+ /*! Signal fired each time that this specific execution actually starts (no veto) */
void on_this_start_cb(const std::function<void(Exec const&)>& cb) { on_this_start.connect(cb); }
+ /*! \static Initiate the creation of an Exec. Setters have to be called afterwards */
static ExecPtr init();
- /*! take a vector of s4u::ExecPtr and return when one of them is finished.
+ /*! \static take a vector of s4u::ExecPtr and return when one of them is finished.
* The return value is the rank of the first finished ExecPtr. */
static ssize_t wait_any(const std::vector<ExecPtr>& execs) { return wait_any_for(execs, -1); }
- /*! Same as wait_any, but with a timeout. If the timeout occurs, parameter last is returned.*/
+ /*! \static Same as wait_any, but with a timeout. If the timeout occurs, parameter last is returned.*/
static ssize_t wait_any_for(const std::vector<ExecPtr>& execs, double timeout);
/** @brief On sequential executions, returns the amount of flops that remain to be done; This cannot be used on
xbt::signal<void(Host const&)> on_this_onoff;
#endif
- /** Add a callback fired on each newly created host */
+ /** \static Add a callback fired on each newly created host */
static void on_creation_cb(const std::function<void(Host&)>& cb) { on_creation.connect(cb); }
- /** Add a callback fired when any machine is turned on or off (called AFTER the change) */
+ /** \static Add a callback fired when any machine is turned on or off (called AFTER the change) */
static void on_onoff_cb(const std::function<void(Host const&)>& cb)
{
on_onoff.connect(cb);
{
on_this_onoff.connect(cb);
}
- /** Add a callback fired when the speed of any machine is changed (called AFTER the change)
+ /** \static Add a callback fired when the speed of any machine is changed (called AFTER the change)
* (either because of a pstate switch or because of an external load event coming from the profile) */
static void on_speed_change_cb(const std::function<void(Host const&)>& cb) { on_speed_change.connect(cb); }
/** Add a callback fired when the speed of this specific machine is changed (called AFTER the change)
{
on_this_speed_change.connect(cb);
}
- /** Add a callback fired just before destructing any host */
+ /** \static Add a callback fired just before destructing any host */
static void on_destruction_cb(const std::function<void(Host const&)>& cb) { on_destruction.connect(cb); }
/** Add a callback fired just before destructing this specific host */
void on_this_destruction_cb(const std::function<void(Host const&)>& cb)
{
on_this_destruction.connect(cb);
}
- /** Add a callback fired when the state of any exec activity changes */
+ /** \static Add a callback fired when the state of any exec activity changes */
static void on_exec_state_change_cb(
const std::function<void(kernel::resource::CpuAction&, kernel::resource::Action::State previous)>& cb)
{
Host& operator=(Host const&) = delete;
#endif
- /** Retrieve a host from its name, or return nullptr */
+ /** \static Retrieve a host from its name, or return nullptr */
static Host* by_name_or_null(const std::string& name);
- /** Retrieve a host from its name, or die */
+ /** \static Retrieve a host from its name, or die */
static Host* by_name(const std::string& name);
- /** Retrieves the host on which the running actor is located */
+ /** \static Retrieves the host on which the running actor is located */
static Host* current();
/** Retrieves the name of that host as a C++ string */
Host* set_concurrency_limit(int limit);
int get_concurrency_limit() const;
- /** @brief Convert the CPU's speed from string to double */
+ /** \static @brief Convert the CPU's speed from string to double */
static std::vector<double> convert_pstate_speed_vector(const std::vector<std::string>& speed_per_state);
/**
* @brief Set the CPU's speed
public:
enum class OpType { READ, WRITE };
+ /*! \static Signal fired each time that any I/O actually starts (no veto) */
static void on_start_cb(const std::function<void(Io const&)>& cb) { on_start.connect(cb); }
+ /*! Signal fired each time this specific I/O actually starts (no veto) */
void on_this_start_cb(const std::function<void(Io const&)>& cb) { on_this_start.connect(cb); }
+ /*! \static Initiate the creation of an I/O. Setters have to be called afterwards */
static IoPtr init();
- /*! take a vector of s4u::IoPtr and return when one of them is finished.
+ /*! \static take a vector of s4u::IoPtr and return when one of them is finished.
* The return value is the rank of the first finished IoPtr. */
static ssize_t wait_any(const std::vector<IoPtr>& ios) { return wait_any_for(ios, -1); }
- /*! Same as wait_any, but with a timeout. If the timeout occurs, parameter last is returned.*/
+ /*! \static Same as wait_any, but with a timeout. If the timeout occurs, parameter last is returned.*/
static ssize_t wait_any_for(const std::vector<IoPtr>& ios, double timeout);
double get_remaining() const override;
kernel::resource::StandardLinkImpl* get_impl() const;
- /** @brief Retrieve a link from its name */
+ /** \static @brief Retrieve a link from its name */
static Link* by_name(const std::string& name);
static Link* by_name_or_null(const std::string& name);
public:
/* The signals */
- /** @brief Add a callback fired when a new Link is created */
+ /** \static @brief Add a callback fired when a new Link is created */
static void on_creation_cb(const std::function<void(Link&)>& cb) { on_creation.connect(cb); }
- /** @brief Add a callback fired when any Link is turned on or off */
+ /** \static @brief Add a callback fired when any Link is turned on or off */
static void on_onoff_cb(const std::function<void(Link const&)>& cb)
{
on_onoff.connect(cb);
{
on_this_onoff.connect(cb);
}
- /** @brief Add a callback fired when the bandwidth of any Link changes */
+ /** \static @brief Add a callback fired when the bandwidth of any Link changes */
static void on_bandwidth_change_cb(const std::function<void(Link const&)>& cb) { on_bandwidth_change.connect(cb); }
/** @brief Add a callback fired when the bandwidth of this specific Link changes */
void on_this_bandwidth_change_cb(const std::function<void(Link const&)>& cb)
{
on_this_bandwidth_change.connect(cb);
}
- /** @brief Add a callback fired when a communication changes it state (ready/done/cancel) */
+ /** \static @brief Add a callback fired when a communication changes it state (ready/done/cancel) */
static void on_communication_state_change_cb(
const std::function<void(kernel::resource::NetworkAction&, kernel::resource::Action::State)>& cb)
{
on_communication_state_change.connect(cb);
}
- /** @brief Add a callback fired when any Link is destroyed */
+ /** \static @brief Add a callback fired when any Link is destroyed */
static void on_destruction_cb(const std::function<void(Link const&)>& cb) { on_destruction.connect(cb); }
/** @brief Add a callback fired when this specific Link is destroyed */
void on_this_destruction_cb(const std::function<void(Link const&)>& cb)
/** @brief Get the link direction down */
Link* get_link_down() const;
- /** @brief Retrieve a link from its name */
+ /** \static @brief Retrieve a link from its name */
static SplitDuplexLink* by_name(const std::string& name);
};
/** @brief Retrieves the name of that mailbox as a C string */
const char* get_cname() const;
- /** Retrieve the mailbox associated to the given name. Mailboxes are created on demand. */
+ /** \static Retrieve the mailbox associated to the given name. Mailboxes are created on demand. */
static Mailbox* by_name(const std::string& name);
/** Returns whether the mailbox contains queued communications */
#endif
public:
- /** Constructs a new mutex */
+ /** \static Constructs a new mutex */
static MutexPtr create();
void lock();
void unlock();
#endif
public:
+ /** \static Add a callback fired on each newly created NetZone */
static void on_creation_cb(const std::function<void(NetZone const&)>& cb) { on_creation.connect(cb); }
+ /** \static Add a callback fired on each newly sealed NetZone */
static void on_seal_cb(const std::function<void(NetZone const&)>& cb) { on_seal.connect(cb); }
/**
#endif
public:
- /** Constructs a new semaphore */
+ /** \static Constructs a new semaphore */
static SemaphorePtr create(unsigned int initial_capacity);
void acquire();
State get_state() const;
/* Callbacks on signals */
+ /*! \static Add a callback fired when any VM is created */
static void on_creation_cb(const std::function<void(VirtualMachine&)>& cb) { on_vm_creation.connect(cb); }
+ /*! \static Add a callback fired when any VM starts */
static void on_start_cb(const std::function<void(VirtualMachine const&)>& cb) { on_start.connect(cb); }
+ /*! Add a callback fired when this specific VM starts */
void on_this_start_cb(const std::function<void(VirtualMachine const&)>& cb)
{
on_this_start.connect(cb);
}
+ /*! \static Add a callback fired when any VM is actually started */
static void on_started_cb(const std::function<void(VirtualMachine const&)>& cb) { on_started.connect(cb); }
+ /*! Add a callback fired when this specific VM is actually started */
void on_this_started_cb(const std::function<void(VirtualMachine const&)>& cb)
{
on_this_started.connect(cb);
}
+ /*! \static Add a callback fired when any VM is shut down */
static void on_shutdown_cb(const std::function<void(VirtualMachine const&)>& cb) { on_shutdown.connect(cb); }
+ /*! Add a callback fired when this specific VM is shut down */
void on_this_shutdown_cb(const std::function<void(VirtualMachine const&)>& cb)
{
on_this_shutdown.connect(cb);
}
+ /*! \static Add a callback fired when any VM is suspended*/
static void on_suspend_cb(const std::function<void(VirtualMachine const&)>& cb) { on_suspend.connect(cb); }
+ /*! Add a callback fired when this specific VM is suspended*/
void on_this_suspend_cb(const std::function<void(VirtualMachine const&)>& cb)
{
on_this_suspend.connect(cb);
}
+ /*! \static Add a callback fired when any VM is resumed*/
static void on_resume_cb(const std::function<void(VirtualMachine const&)>& cb) { on_resume.connect(cb); }
+ /*! Add a callback fired when this specific VM is resumed*/
void on_this_resume_cb(const std::function<void(VirtualMachine const&)>& cb)
{
on_this_resume.connect(cb);
}
+ /*! \static Add a callback fired when any VM is destroyed*/
static void on_destruction_cb(const std::function<void(VirtualMachine const&)>& cb) { on_vm_destruction.connect(cb); }
+ /*! Add a callback fired when this specific VM is destroyed*/
void on_this_destruction_cb(const std::function<void(VirtualMachine const&)>& cb)
{
on_this_vm_destruction.connect(cb);
}
+ /*! \static Add a callback fired when any VM starts a migration*/
static void on_migration_start_cb(const std::function<void(VirtualMachine const&)>& cb)
{
on_migration_start.connect(cb);
}
+ /*! Add a callback fired when this specific VM starts a migration*/
void on_this_migration_start_cb(const std::function<void(VirtualMachine const&)>& cb)
{
on_this_migration_start.connect(cb);
}
+ /*! \static Add a callback fired when any VM ends a migration*/
static void on_migration_end_cb(const std::function<void(VirtualMachine const&)>& cb)
{
on_migration_end.connect(cb);
}
+ /*! Add a callback fired when this specific VM ends a migration*/
void on_this_migration_end_cb(const std::function<void(VirtualMachine const&)>& cb)
{
on_this_migration_end.connect(cb);