diff options
author | Sergey Senozhatsky <sergey.senozhatsky@gmail.com> | 2012-10-10 11:13:52 -0700 |
---|---|---|
committer | Chris E Ferron <chris.e.ferron@linux.intel.com> | 2012-10-11 14:53:31 -0700 |
commit | 1a8e46469e828251ab910cb4016b9161efe9ff5d (patch) | |
tree | 9e610d2ecbe61d60c5d3d26c911200f0605f9495 /src/report/report-maker.cpp | |
parent | 3338b6f9af81ddd8a0acab923de3646b20dc5136 (diff) | |
download | powertop-2.0-v2-1a8e46469e828251ab910cb4016b9161efe9ff5d.tar.gz |
Small rework on report formatter side
Hello,
below is initial version of rework I was talking about. Igor did most part of it (introduced
report_formatter_base class), so mine are just minor tweaks. I'm glad still no one mentioned
templates, just kidding.
one thing I don't really like so far is
else if (type == REPORT_OFF)
formatter = new report_formatter();
which is just cryptic and thus look wrong.
perhaps we need something like `new report_formatter_basic()' here (which will require header
file rename).
please review and comment.
------------------------------------------------------------------------
Small rework on report formatter side:
- make report_formatter a basic class (previously was interface). hence we can
remove empty report_formatter interface implementation.
- drop report-formatter-null class
- in report maker now we create report_formatter instance for REPORT_OFF mode
- rename report_formatter_base to report_formatter_string_base, so class name tells
a bit more, later we can create report_formatter_xml_base/report_formatter_json_base/etc.
Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Diffstat (limited to 'src/report/report-maker.cpp')
-rw-r--r-- | src/report/report-maker.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/report/report-maker.cpp b/src/report/report-maker.cpp index 4a68a8c..eef0fb1 100644 --- a/src/report/report-maker.cpp +++ b/src/report/report-maker.cpp @@ -31,7 +31,6 @@ #include "report-maker.h" #include "report-formatter-csv.h" #include "report-formatter-html.h" -#include "report-formatter-null.h" /* ************************************************************************ */ @@ -114,7 +113,7 @@ report_maker::setup_report_formatter() else if (type == REPORT_CSV) formatter = new report_formatter_csv(); else if (type == REPORT_OFF) - formatter = new report_formatter_null(); + formatter = new report_formatter(); else assert(false); } |