1*0ec8b83dSEd Tanous #pragma once 2*0ec8b83dSEd Tanous #include <nlohmann/json.hpp> 3*0ec8b83dSEd Tanous 4*0ec8b83dSEd Tanous namespace task 5*0ec8b83dSEd Tanous { 6*0ec8b83dSEd Tanous // clang-format off 7*0ec8b83dSEd Tanous 8*0ec8b83dSEd Tanous enum class TaskState{ 9*0ec8b83dSEd Tanous Invalid, 10*0ec8b83dSEd Tanous New, 11*0ec8b83dSEd Tanous Starting, 12*0ec8b83dSEd Tanous Running, 13*0ec8b83dSEd Tanous Suspended, 14*0ec8b83dSEd Tanous Interrupted, 15*0ec8b83dSEd Tanous Pending, 16*0ec8b83dSEd Tanous Stopping, 17*0ec8b83dSEd Tanous Completed, 18*0ec8b83dSEd Tanous Killed, 19*0ec8b83dSEd Tanous Exception, 20*0ec8b83dSEd Tanous Service, 21*0ec8b83dSEd Tanous Cancelling, 22*0ec8b83dSEd Tanous Cancelled, 23*0ec8b83dSEd Tanous }; 24*0ec8b83dSEd Tanous 25*0ec8b83dSEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(TaskState, { 26*0ec8b83dSEd Tanous {TaskState::Invalid, "Invalid"}, 27*0ec8b83dSEd Tanous {TaskState::New, "New"}, 28*0ec8b83dSEd Tanous {TaskState::Starting, "Starting"}, 29*0ec8b83dSEd Tanous {TaskState::Running, "Running"}, 30*0ec8b83dSEd Tanous {TaskState::Suspended, "Suspended"}, 31*0ec8b83dSEd Tanous {TaskState::Interrupted, "Interrupted"}, 32*0ec8b83dSEd Tanous {TaskState::Pending, "Pending"}, 33*0ec8b83dSEd Tanous {TaskState::Stopping, "Stopping"}, 34*0ec8b83dSEd Tanous {TaskState::Completed, "Completed"}, 35*0ec8b83dSEd Tanous {TaskState::Killed, "Killed"}, 36*0ec8b83dSEd Tanous {TaskState::Exception, "Exception"}, 37*0ec8b83dSEd Tanous {TaskState::Service, "Service"}, 38*0ec8b83dSEd Tanous {TaskState::Cancelling, "Cancelling"}, 39*0ec8b83dSEd Tanous {TaskState::Cancelled, "Cancelled"}, 40*0ec8b83dSEd Tanous }); 41*0ec8b83dSEd Tanous 42*0ec8b83dSEd Tanous } 43*0ec8b83dSEd Tanous // clang-format on 44