diff --git a/include/db_lib/task.hpp b/include/db_lib/task.hpp index 3804e55..e9896f3 100644 --- a/include/db_lib/task.hpp +++ b/include/db_lib/task.hpp @@ -168,14 +168,14 @@ class Task { * * @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 * * @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 @@ -183,7 +183,7 @@ class Task { * * @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? @@ -191,77 +191,77 @@ class Task { * @return true It does * @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 * * @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 * * @return TaskStatusType The task status */ - TaskStatusType get_status() { return status; } + const TaskStatusType& status = status_; /** * @brief Set the status of the task * * @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 * * @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 * * @return TaskErrorType */ - TaskErrorType get_error() { return error; }; + const TaskErrorType& error = error_; /** * @brief Set the error with which this task was completed * * @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. * * @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 * * @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. * * @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 * * @param trace */ - void set_trace(std::string trace) { this->trace = trace; }; + void set_trace(std::string trace) { this->trace_ = trace; }; ///////////////////////////////////// private: @@ -270,24 +270,24 @@ class Task { db::uuid_t task_uuid; // 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? - TaskTypeType task_type; + TaskTypeType task_type_; // Does this task have a reference run which we should compare the trace to? - bool is_reference; - TaskStatusType status; - db::uuid_t reference_uuid; + bool is_reference_; + TaskStatusType status_; + db::uuid_t reference_uuid_; // maximum pipeline load factor - float max_plf; + float max_plf_; // error with which this task was completed - TaskErrorType error; + TaskErrorType error_; // simulation output - std::string sim_log; - std::string trace; + std::string sim_log_; + std::string trace_; }; diff --git a/src/db_lib/task.cpp b/src/db_lib/task.cpp index 7a0c55b..304e14c 100644 --- a/src/db_lib/task.cpp +++ b/src/db_lib/task.cpp @@ -37,14 +37,14 @@ Task::Task (db::uuid_t task_uuid, ) { this->task_uuid = task_uuid; - this->job_id = job_id; - this->status = status; - this->task_type = type; - this->is_reference = is_reference; - this->reference_uuid = reference_uuid; - this->max_plf = max_plf; - this->error = error; - this->sim_log = sim_log; + this->job_id_ = job_id; + this->status_ = status; + this->task_type_ = type; + this->is_reference_ = is_reference; + this->reference_uuid_ = reference_uuid; + this->max_plf_ = max_plf; + this->error_ = error; + this->sim_log_ = sim_log; } Task::Task (db::uuid_t task_uuid, @@ -56,11 +56,11 @@ Task::Task (db::uuid_t task_uuid, ) { this->task_uuid = task_uuid; - this->job_id = job_id; - this->task_type = type; - this->is_reference = is_reference; - this->reference_uuid = reference_uuid; - this->max_plf = max_plf; + this->job_id_ = job_id; + this->task_type_ = type; + this->is_reference_ = is_reference; + this->reference_uuid_ = reference_uuid; + this->max_plf_ = max_plf; }