const char* ActivityImpl::get_state_str() const
{
- constexpr std::array<const char*, 12> names{{"WAITING", "READY", "RUNNING", "DONE", "CANCELED", "FAILED",
- "SRC_HOST_FAILURE", "DST_HOST_FAILURE", "TIMEOUT", "SRC_TIMEOUT",
- "DST_TIMEOUT", "LINK_FAILURE"}};
- return names[static_cast<int>(state_)];
+ return to_c_str(state_);
}
bool ActivityImpl::test()
#include <string>
#include <list>
-#include <xbt/base.h>
#include "simgrid/forward.h"
+#include <xbt/utility.hpp>
#include <atomic>
#include <simgrid/kernel/resource/Action.hpp>
namespace simgrid {
namespace kernel {
namespace activity {
-enum class State {
- WAITING = 0,
- READY,
- RUNNING,
- DONE,
- CANCELED,
- FAILED,
- SRC_HOST_FAILURE,
- DST_HOST_FAILURE,
- TIMEOUT,
- SRC_TIMEOUT,
- DST_TIMEOUT,
- LINK_FAILURE
-};
+
+XBT_DECLARE_ENUM_CLASS(State, WAITING, READY, RUNNING, DONE, CANCELED, FAILED, SRC_HOST_FAILURE, DST_HOST_FAILURE,
+ TIMEOUT, SRC_TIMEOUT, DST_TIMEOUT, LINK_FAILURE);
class XBT_PUBLIC ActivityImpl {
std::atomic_int_fast32_t refcount_{0};