Skip to content

Commit ec8490b

Browse files
committed
more resolve comments
Signed-off-by: Martijn Govers <[email protected]>
1 parent 1a20b38 commit ec8490b

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

power_grid_model_c/power_grid_model/include/power_grid_model/common/timer.hpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ using Duration = std::chrono::duration<double>;
1717

1818
class Timer {
1919
private:
20-
Logger* info_;
20+
Logger* log_;
2121
LogEvent code_;
2222
Clock::time_point start_;
2323

2424
public:
25-
Timer() : info_{nullptr}, code_{LogEvent::unknown} {};
26-
Timer(Logger& info, LogEvent code) : info_{&info}, code_{code}, start_{Clock::now()} {}
25+
Timer() : log_{nullptr}, code_{LogEvent::unknown} {};
26+
Timer(Logger& log, LogEvent code) : log_{&log}, code_{code}, start_{Clock::now()} {}
2727

2828
Timer(Timer const&) = delete;
2929
Timer(Timer&&) = default;
@@ -34,29 +34,29 @@ class Timer {
3434
stop();
3535

3636
// Copy/move members
37-
info_ = timer.info_;
37+
log_ = timer.log_;
3838
code_ = timer.code_;
3939
start_ = timer.start_;
4040

4141
// Disable original timer
42-
timer.info_ = nullptr;
42+
timer.log_ = nullptr;
4343

4444
// Return reference
4545
return *this;
4646
}
4747

4848
~Timer() {
49-
if (info_ != nullptr) {
49+
if (log_ != nullptr) {
5050
stop();
5151
}
5252
}
5353

5454
void stop() {
55-
if (info_ != nullptr) {
55+
if (log_ != nullptr) {
5656
auto const now = Clock::now();
5757
auto const duration = Duration(now - start_);
58-
info_->log(code_, duration.count());
59-
info_ = nullptr;
58+
log_->log(code_, duration.count());
59+
log_ = nullptr;
6060
}
6161
}
6262
};

power_grid_model_c/power_grid_model/include/power_grid_model/main_model_impl.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ class MainModelImpl<ExtraRetrievableTypes<ExtraRetrievableType...>, ComponentLis
159159
math_solver_dispatcher_{&math_solver_dispatcher} {}
160160

161161
MainModelImpl(MainModelImpl const& other)
162-
: log_{nullptr}, // calculation info should not be copied, because it may result in race conditions
162+
: log_{nullptr}, // logger should not be copied, because it may result in race conditions
163163
system_frequency_{other.system_frequency_},
164164
meta_data_{other.meta_data_},
165165
math_solver_dispatcher_{other.math_solver_dispatcher_},
@@ -183,7 +183,7 @@ class MainModelImpl<ExtraRetrievableTypes<ExtraRetrievableType...>, ComponentLis
183183
}
184184
MainModelImpl& operator=(MainModelImpl const& other) {
185185
if (this != &other) {
186-
log_ = nullptr; // calculation info should be reset, because it may result in race conditions
186+
log_ = nullptr; // logger should be reset, because it may result in race conditions
187187
system_frequency_ = other.system_frequency_;
188188
meta_data_ = other.meta_data_;
189189
math_solver_dispatcher_ = other.math_solver_dispatcher_;

tests/cpp_unit_tests/test_job_dispatch.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// SPDX-License-Identifier: MPL-2.0
44

55
#include <power_grid_model/batch_parameter.hpp>
6-
#include <power_grid_model/common/calculation_info.hpp>
6+
#include <power_grid_model/common/multi_threaded_logging.hpp>
77
#include <power_grid_model/common/common.hpp>
88
#include <power_grid_model/common/exception.hpp>
99
#include <power_grid_model/job_dispatch.hpp>

0 commit comments

Comments
 (0)