35
35
class StatWriter : public AbstractWriter {
36
36
public:
37
37
// / silently drop scan properties when printing stats only
38
- virtual void setScanProps (const TScanProps &) { }
38
+ void setScanProps (const TScanProps &) override { }
39
39
};
40
40
41
41
class FilePrinter : public StatWriter {
42
42
private:
43
43
std::string file_;
44
44
45
45
protected:
46
- virtual void notifyFile (const std::string &fileName) {
46
+ void notifyFile (const std::string &fileName) override {
47
47
file_ = fileName;
48
48
}
49
49
50
- virtual void handleDef (const Defect &) {
50
+ void handleDef (const Defect &) override {
51
51
if (file_.empty ())
52
52
return ;
53
53
@@ -61,11 +61,11 @@ class GroupPrinter: public StatWriter {
61
61
std::string file_;
62
62
63
63
protected:
64
- virtual void notifyFile (const std::string &fileName) {
64
+ void notifyFile (const std::string &fileName) override {
65
65
file_ = fileName;
66
66
}
67
67
68
- virtual void handleDef (const Defect &def) {
68
+ void handleDef (const Defect &def) override {
69
69
if (!file_.empty ()) {
70
70
std::cout << " \n\n === " << file_ << " ===\n " ;
71
71
file_.clear ();
@@ -78,7 +78,7 @@ class GroupPrinter: public StatWriter {
78
78
79
79
class KeyEventPrinter : public StatWriter {
80
80
protected:
81
- virtual void handleDef (const Defect &def) {
81
+ void handleDef (const Defect &def) override {
82
82
const DefEvent &keyEvent = def.events [def.keyEventIdx ];
83
83
std::cout << def.checker << " \t " << keyEvent.event << " \n " ;
84
84
}
@@ -90,11 +90,11 @@ class DefCounter: public StatWriter {
90
90
TMap cnt_;
91
91
92
92
public:
93
- virtual void handleDef (const Defect &def) {
93
+ void handleDef (const Defect &def) override {
94
94
++cnt_[def.checker ];
95
95
}
96
96
97
- virtual void flush () {
97
+ void flush () override {
98
98
for (TMap::const_reference item : cnt_) {
99
99
using namespace std ;
100
100
const ios_base::fmtflags oldFlags = cout.flags ();
@@ -114,13 +114,13 @@ class EvtCounter: public StatWriter {
114
114
TMap cnt_;
115
115
116
116
public:
117
- virtual void handleDef (const Defect &def) {
117
+ void handleDef (const Defect &def) override {
118
118
const DefEvent &evt = def.events [def.keyEventIdx ];
119
119
const TKey key (def.checker , evt.event );
120
120
++cnt_[key];
121
121
}
122
122
123
- virtual void flush () {
123
+ void flush () override {
124
124
for (TMap::const_reference item : cnt_) {
125
125
using namespace std ;
126
126
const TKey &key = item.first ;
@@ -147,12 +147,12 @@ class FileDefCounter: public StatWriter {
147
147
TMap cntMap_;
148
148
149
149
public:
150
- virtual ~FileDefCounter () {
150
+ ~FileDefCounter () override {
151
151
for (TMap::const_reference item : cntMap_)
152
152
delete /* (DefCounter *) */ item.second ;
153
153
}
154
154
155
- virtual void handleDef (const Defect &def) {
155
+ void handleDef (const Defect &def) override {
156
156
const std::string fName = def.events [def.keyEventIdx ].fileName ;
157
157
TMap::const_iterator it = cntMap_.find (fName );
158
158
@@ -163,7 +163,7 @@ class FileDefCounter: public StatWriter {
163
163
defCnt->handleDef (def);
164
164
}
165
165
166
- virtual void flush () {
166
+ void flush () override {
167
167
for (TMap::const_reference item : cntMap_) {
168
168
const std::string fName = item.first ;
169
169
std::cout << " \n\n --- " << fName << " ---\n " ;
@@ -184,7 +184,7 @@ class MsgPredicate: public IPredicate {
184
184
{
185
185
}
186
186
187
- virtual bool matchDef (const Defect &def) const {
187
+ bool matchDef (const Defect &def) const override {
188
188
for (const DefEvent &evt : def.events ) {
189
189
if (boost::regex_search (evt.msg , re_))
190
190
return true ;
@@ -204,7 +204,7 @@ class KeyEventPredicate: public IPredicate {
204
204
{
205
205
}
206
206
207
- virtual bool matchDef (const Defect &def) const {
207
+ bool matchDef (const Defect &def) const override {
208
208
const DefEvent &keyEvent = def.events [def.keyEventIdx ];
209
209
return boost::regex_search (keyEvent.event , re_);
210
210
}
@@ -220,7 +220,7 @@ class ErrorPredicate: public IPredicate {
220
220
{
221
221
}
222
222
223
- virtual bool matchDef (const Defect &def) const {
223
+ bool matchDef (const Defect &def) const override {
224
224
const DefEvent &evt = def.events [def.keyEventIdx ];
225
225
return boost::regex_search (evt.msg , re_);
226
226
}
@@ -236,7 +236,7 @@ class PathPredicate: public IPredicate {
236
236
{
237
237
}
238
238
239
- virtual bool matchDef (const Defect &def) const {
239
+ bool matchDef (const Defect &def) const override {
240
240
const DefEvent &evt = def.events [def.keyEventIdx ];
241
241
return boost::regex_search (evt.fileName , re_);
242
242
}
@@ -252,7 +252,7 @@ class CheckerPredicate: public IPredicate {
252
252
{
253
253
}
254
254
255
- virtual bool matchDef (const Defect &def) const {
255
+ bool matchDef (const Defect &def) const override {
256
256
return boost::regex_search (def.checker , re_);
257
257
}
258
258
};
@@ -267,7 +267,7 @@ class AnnotPredicate: public IPredicate {
267
267
{
268
268
}
269
269
270
- virtual bool matchDef (const Defect &def) const {
270
+ bool matchDef (const Defect &def) const override {
271
271
return boost::regex_search (def.annotation , re_);
272
272
}
273
273
};
@@ -283,7 +283,7 @@ class SrcAnnotPredicate: public IPredicate {
283
283
}
284
284
285
285
// FIXME: this implementation is desperately inefficient
286
- virtual bool matchDef (const Defect &def) const {
286
+ bool matchDef (const Defect &def) const override {
287
287
const DefEvent &evt = def.events [def.keyEventIdx ];
288
288
const std::string &fname = evt.fileName ;
289
289
std::fstream fstr (fname.c_str (), std::ios::in);
@@ -323,7 +323,7 @@ class PathStripper: public GenericAbstractFilter {
323
323
{
324
324
}
325
325
326
- virtual void handleDef (const Defect &defOrig) {
326
+ void handleDef (const Defect &defOrig) override {
327
327
Defect def (defOrig);
328
328
329
329
// iterate through all events
@@ -356,17 +356,16 @@ class DropScanProps: public GenericAbstractFilter {
356
356
}
357
357
358
358
// / ignore any given scan properties
359
- virtual void setScanProps (const TScanProps &) {
360
- }
359
+ void setScanProps (const TScanProps &) override { }
361
360
362
361
// / always return empty scan properties
363
- virtual const TScanProps& getScanProps () const {
362
+ const TScanProps& getScanProps () const override {
364
363
return emp_;
365
364
}
366
365
367
366
protected:
368
367
// / trivial pass-through
369
- virtual void handleDef (const Defect &def) {
368
+ void handleDef (const Defect &def) override {
370
369
agent_->handleDef (def);
371
370
}
372
371
@@ -382,7 +381,7 @@ class DuplicateFilter: public AbstractFilter {
382
381
}
383
382
384
383
protected:
385
- virtual bool matchDef (const Defect &def) {
384
+ bool matchDef (const Defect &def) override {
386
385
DefEvent evt = def.events [def.keyEventIdx ];
387
386
388
387
// abstract out differences we do not deem important
0 commit comments