reengineer task to use limited access public variables

This commit is contained in:
Fabian Posch 2024-01-10 15:43:23 -05:00
parent b73034fdc1
commit f7e4722615
2 changed files with 36 additions and 36 deletions

View file

@ -168,14 +168,14 @@ class Task {
* *
* @return db::uuid_t Task UUID * @return db::uuid_t Task UUID
*/ */
db::uuid_t get_uuid() { return task_uuid; }; const db::uuid_t& uuid = task_uuid;
/** /**
* @brief Get the ID of the job this task belongs to * @brief Get the ID of the job this task belongs to
* *
* @return const char* Job ID * @return const char* Job ID
*/ */
std::string get_job_id() { return job_id; }; const std::string& job_id = job_id_;
/** /**
* @brief Get information whether this task is a one shot simulation or contributes * @brief Get information whether this task is a one shot simulation or contributes
@ -183,7 +183,7 @@ class Task {
* *
* @return TaskType * @return TaskType
*/ */
TaskTypeType get_task_type() { return task_type; }; const TaskTypeType& task_type = task_type_;
/** /**
* @brief Does this simulation task have a reference task to compare to? * @brief Does this simulation task have a reference task to compare to?
@ -191,77 +191,77 @@ class Task {
* @return true It does * @return true It does
* @return false It does not * @return false It does not
*/ */
bool is_reference_run() { return is_reference; }; const bool& is_reference_run = is_reference_;
/** /**
* @brief Get the reference object UUID * @brief Get the reference object UUID
* *
* @return The UUID of the reference simulation task * @return The UUID of the reference simulation task
*/ */
db::uuid_t get_reference() { return reference_uuid; } const db::uuid_t& reference_uuid = reference_uuid_;
/** /**
* @brief Get the status of this task * @brief Get the status of this task
* *
* @return TaskStatusType The task status * @return TaskStatusType The task status
*/ */
TaskStatusType get_status() { return status; } const TaskStatusType& status = status_;
/** /**
* @brief Set the status of the task * @brief Set the status of the task
* *
* @param new_status The new status this task should be set to * @param new_status The new status this task should be set to
*/ */
void set_status(TaskStatusType new_status) { this->status = new_status; } void set_status(TaskStatusType new_status) { this->status_ = new_status; };
/** /**
* @brief Get the value of the maximum allowed pipeline load factor * @brief Get the value of the maximum allowed pipeline load factor
* *
* @return float * @return float
*/ */
float get_max_plf() { return max_plf; }; const float& max_plf = max_plf_;
/** /**
* @brief Get the error with which this simulation task was completed * @brief Get the error with which this simulation task was completed
* *
* @return TaskErrorType * @return TaskErrorType
*/ */
TaskErrorType get_error() { return error; }; const TaskErrorType& error = error_;
/** /**
* @brief Set the error with which this task was completed * @brief Set the error with which this task was completed
* *
* @param error * @param error
*/ */
void set_error(TaskErrorType error) { this->error = error; }; void set_error(TaskErrorType error) { this->error_ = error; };
/** /**
* @brief Get the simulation log of this task. Empty if not yet simulated. * @brief Get the simulation log of this task. Empty if not yet simulated.
* *
* @return std::string The simulation log in JSON format * @return std::string The simulation log in JSON format
*/ */
std::string get_log() { return sim_log; }; const std::string& sim_log = sim_log_;
/** /**
* @brief Set the simulation log * @brief Set the simulation log
* *
* @param log * @param log
*/ */
void set_log(std::string log) { this->sim_log = log; }; void set_log(std::string log) { this->sim_log_ = log; };
/** /**
* @brief Get the simulation trace of this task. Empty if not yet simulated. * @brief Get the simulation trace of this task. Empty if not yet simulated.
* *
* @return std::string The simulation log in TODO format * @return std::string The simulation log in TODO format
*/ */
std::string get_trace() { return trace; }; const std::string& trace = trace_;
/** /**
* @brief Set the simulation trace * @brief Set the simulation trace
* *
* @param trace * @param trace
*/ */
void set_trace(std::string trace) { this->trace = trace; }; void set_trace(std::string trace) { this->trace_ = trace; };
///////////////////////////////////// /////////////////////////////////////
private: private:
@ -270,24 +270,24 @@ class Task {
db::uuid_t task_uuid; db::uuid_t task_uuid;
// ID of the job this task belongs to // ID of the job this task belongs to
std::string job_id; std::string job_id_;
// Is this task a single shot or does it depend on central coverage metrics? // Is this task a single shot or does it depend on central coverage metrics?
TaskTypeType task_type; TaskTypeType task_type_;
// Does this task have a reference run which we should compare the trace to? // Does this task have a reference run which we should compare the trace to?
bool is_reference; bool is_reference_;
TaskStatusType status; TaskStatusType status_;
db::uuid_t reference_uuid; db::uuid_t reference_uuid_;
// maximum pipeline load factor // maximum pipeline load factor
float max_plf; float max_plf_;
// error with which this task was completed // error with which this task was completed
TaskErrorType error; TaskErrorType error_;
// simulation output // simulation output
std::string sim_log; std::string sim_log_;
std::string trace; std::string trace_;
}; };

View file

@ -37,14 +37,14 @@ Task::Task (db::uuid_t task_uuid,
) )
{ {
this->task_uuid = task_uuid; this->task_uuid = task_uuid;
this->job_id = job_id; this->job_id_ = job_id;
this->status = status; this->status_ = status;
this->task_type = type; this->task_type_ = type;
this->is_reference = is_reference; this->is_reference_ = is_reference;
this->reference_uuid = reference_uuid; this->reference_uuid_ = reference_uuid;
this->max_plf = max_plf; this->max_plf_ = max_plf;
this->error = error; this->error_ = error;
this->sim_log = sim_log; this->sim_log_ = sim_log;
} }
Task::Task (db::uuid_t task_uuid, Task::Task (db::uuid_t task_uuid,
@ -56,11 +56,11 @@ Task::Task (db::uuid_t task_uuid,
) )
{ {
this->task_uuid = task_uuid; this->task_uuid = task_uuid;
this->job_id = job_id; this->job_id_ = job_id;
this->task_type = type; this->task_type_ = type;
this->is_reference = is_reference; this->is_reference_ = is_reference;
this->reference_uuid = reference_uuid; this->reference_uuid_ = reference_uuid;
this->max_plf = max_plf; this->max_plf_ = max_plf;
} }