43 lines
1.3 KiB
C++
43 lines
1.3 KiB
C++
#ifndef TASK_HPP
|
|
#define TASK_HPP
|
|
|
|
#include "TaskState.hpp"
|
|
|
|
#include "../core/Model.hpp"
|
|
#include "../core/Types.hpp"
|
|
|
|
#include "matador/object/object_ptr.hpp"
|
|
|
|
#include "matador/utils/base_class.hpp"
|
|
|
|
namespace work::models::jobs {
|
|
struct Task : core::Model {
|
|
std::string name;
|
|
std::string description;
|
|
std::string job_name;
|
|
TaskState state;
|
|
matador::object::object_ptr<Payload> payload;
|
|
JobMode job_mode;
|
|
core::timestamp start_delay;
|
|
core::timestamp interval;
|
|
uint64_t user_session_id;
|
|
|
|
template<typename Operator>
|
|
void process( Operator& op ) {
|
|
namespace field = matador::access;
|
|
field::process( op, *matador::base_class<Model>( this ) );
|
|
field::attribute( op, "name", name, 511 );
|
|
field::attribute( op, "description", description, 511 );
|
|
field::attribute( op, "job_name", job_name, 511 );
|
|
field::attribute( op, "state", state );
|
|
field::belongs_to( op, "payload", payload, matador::utils::default_foreign_attributes );
|
|
field::attribute( op, "job_mode", job_mode );
|
|
field::attribute( op, "start_delay", start_delay );
|
|
field::attribute( op, "interval", interval );
|
|
field::attribute( op, "user_session_id", user_session_id );
|
|
}
|
|
};
|
|
}
|
|
|
|
#endif //TASK_HPP
|