Skip to content

Commit 86d31a3

Browse files
committed
rename Task::success to ::set_success, Task::fail to ::set_fail
1 parent 56d8abc commit 86d31a3

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

vpr/src/server/task.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,18 @@ bool Task::options_match(const std::unique_ptr<Task>& other) {
3434
return other->options() == m_options;
3535
}
3636

37-
void Task::fail(const std::string& error) {
37+
void Task::set_fail(const std::string& error) {
3838
m_is_finished = true;
3939
m_error = error;
4040
bake_response();
4141
}
4242

43-
void Task::success() {
43+
void Task::set_success() {
4444
m_is_finished = true;
4545
bake_response();
4646
}
4747

48-
void Task::success(std::string&& result) {
48+
void Task::set_success(std::string&& result) {
4949
m_result = std::move(result);
5050
m_is_finished = true;
5151
bake_response();

vpr/src/server/task.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,12 @@ class Task {
129129
*
130130
* @param error The error message describing the reason for the task's failure.
131131
*/
132-
void fail(const std::string& error);
132+
void set_fail(const std::string& error);
133133

134134
/**
135135
* @brief Marks the task as successfully completed.
136136
*/
137-
void success();
137+
void set_success();
138138

139139
/**
140140
* @brief Marks the task as successfully completed with the specified result.
@@ -145,7 +145,7 @@ class Task {
145145
* @param result An rvalue reference to a string describing the result of the task execution.
146146
* The content of this string will be moved into the task's result storage.
147147
*/
148-
void success(std::string&& result);
148+
void set_success(std::string&& result);
149149

150150
/**
151151
* @brief Generates a string containing information about the task.

vpr/src/server/taskresolver.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ void TaskResolver::own_task(TaskPtr&& new_task) {
1818
if (task->cmd() == new_task->cmd()) {
1919
if (task->options_match(new_task)) {
2020
std::string msg = "similar task is already in execution, reject new " + new_task->info() + " and waiting for old " + task->info() + " execution";
21-
new_task->fail(msg);
21+
new_task->set_fail(msg);
2222
} else {
2323
// handle case when task has same cmd but different options
2424
if (new_task->job_id() > task->job_id()) {
2525
std::string msg = "old " + task->info() + " is overridden by a new " + new_task->info();
26-
task->fail(msg);
26+
task->set_fail(msg);
2727
}
2828
}
2929
}
@@ -102,21 +102,21 @@ void TaskResolver::process_get_path_list_task(ezgl::application*, const TaskPtr&
102102
CritPathsResultPtr crit_paths_result = calc_critical_path(path_type, n_critical_path_num, details_level_opt.value(), is_flat);
103103
if (crit_paths_result->is_valid()) {
104104
server_ctx.crit_paths = std::move(crit_paths_result->paths);
105-
task->success(std::move(crit_paths_result->report));
105+
task->set_success(std::move(crit_paths_result->report));
106106
} else {
107107
std::string msg{"Critical paths report is empty"};
108108
VTR_LOG_ERROR(msg.c_str());
109-
task->fail(msg);
109+
task->set_fail(msg);
110110
}
111111
} else {
112112
std::string msg{"unsupported report details level " + details_level_str};
113113
VTR_LOG_ERROR(msg.c_str());
114-
task->fail(msg);
114+
task->set_fail(msg);
115115
}
116116
} else {
117117
std::string msg{"options errors in get crit path list telegram: " + options.errors_str()};
118118
VTR_LOG_ERROR(msg.c_str());
119-
task->fail(msg);
119+
task->set_fail(msg);
120120
}
121121
}
122122

@@ -138,16 +138,16 @@ void TaskResolver::process_draw_critical_path_task(ezgl::application* app, const
138138
gint high_light_mode_index = get_item_index_by_text(toggle_crit_path, high_light_mode.c_str());
139139
if (high_light_mode_index != -1) {
140140
gtk_combo_box_set_active(toggle_crit_path, high_light_mode_index);
141-
task->success();
141+
task->set_success();
142142
} else {
143143
std::string msg{"cannot find ToggleCritPath qcombobox index for item " + high_light_mode};
144144
VTR_LOG_ERROR(msg.c_str());
145-
task->fail(msg);
145+
task->set_fail(msg);
146146
}
147147
} else {
148148
std::string msg{"options errors in highlight crit path telegram: " + options.errors_str()};
149149
VTR_LOG_ERROR(msg.c_str());
150-
task->fail(msg);
150+
task->set_fail(msg);
151151
}
152152
}
153153

0 commit comments

Comments
 (0)