File tree Expand file tree Collapse file tree 3 files changed +15
-4
lines changed
power_grid_model_c/power_grid_model/include/power_grid_model/common Expand file tree Collapse file tree 3 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -17,8 +17,8 @@ class CalculationInfo : public NoLogger {
1717 using Report = std::add_lvalue_reference_t <std::add_const_t <Data>>;
1818 static_assert (std::same_as<Report, Data const &>);
1919
20- virtual void log (LogEvent tag, double value) override { log_impl (tag, value); }
21- virtual void log (LogEvent tag, Idx value) override { log_impl (tag, static_cast <double >(value)); }
20+ void log (LogEvent tag, double value) override { log_impl (tag, value); }
21+ void log (LogEvent tag, Idx value) override { log_impl (tag, static_cast <double >(value)); }
2222
2323 private:
2424 Data data_;
Original file line number Diff line number Diff line change @@ -43,13 +43,19 @@ enum class LogEvent : int16_t {
4343 max_num_iter = 2248 , // TODO(mgovers): find other error code
4444};
4545
46- struct Logger {
46+ class Logger {
47+ public:
4748 virtual void log (LogEvent tag) = 0;
4849 virtual void log (LogEvent tag, std::string_view message) = 0;
4950 virtual void log (LogEvent tag, double value) = 0;
5051 virtual void log (LogEvent tag, Idx value) = 0;
52+ virtual ~Logger () = 0 ;
5153
52- virtual ~Logger () = default ;
54+ protected:
55+ Logger (Logger const &) = default ;
56+ Logger (Logger&&) = default ;
57+ Logger& operator =(Logger const &) = default ;
58+ Logger& operator =(Logger&&) = default ;
5359};
5460
5561} // namespace common::logging
Original file line number Diff line number Diff line change @@ -23,6 +23,11 @@ class NoLogger : public Logger {
2323 void log (LogEvent /* tag*/ , Idx /* value*/ ) override {
2424 // no logging
2525 }
26+ NoLogger (NoLogger const &) = default ;
27+ NoLogger (NoLogger&&) = default ;
28+ NoLogger& operator =(NoLogger const &) = default ;
29+ NoLogger& operator =(NoLogger&&) = default ;
30+ ~NoLogger () override = default ;
2631};
2732
2833} // namespace power_grid_model::common::logging
You can’t perform that action at this time.
0 commit comments