More final markings.

These classes were recommended by gcc's -Wsugggest-final-types as places where
large numbers of virtual functions could be optimized away.
This commit is contained in:
Tim Wojtulewicz 2020-04-03 15:26:44 -04:00
parent 9c89cd4a47
commit 4035ec7760
21 changed files with 26 additions and 27 deletions

View file

@ -38,7 +38,7 @@ enum DNS_MgrMode {
// Number of seconds we'll wait for a reply. // Number of seconds we'll wait for a reply.
#define DNS_TIMEOUT 5 #define DNS_TIMEOUT 5
class DNS_Mgr : public iosource::IOSource { class DNS_Mgr final : public iosource::IOSource {
public: public:
explicit DNS_Mgr(DNS_MgrMode mode); explicit DNS_Mgr(DNS_MgrMode mode);
~DNS_Mgr() override; ~DNS_Mgr() override;

View file

@ -48,7 +48,7 @@ protected:
extern uint64_t num_events_queued; extern uint64_t num_events_queued;
extern uint64_t num_events_dispatched; extern uint64_t num_events_dispatched;
class EventMgr : public BroObj, public iosource::IOSource { class EventMgr final : public BroObj, public iosource::IOSource {
public: public:
EventMgr(); EventMgr();
~EventMgr() override; ~EventMgr() override;

View file

@ -92,7 +92,7 @@ protected:
int bytes_read; int bytes_read;
}; };
class BinarySerializationFormat : public SerializationFormat { class BinarySerializationFormat final : public SerializationFormat {
public: public:
BinarySerializationFormat(); BinarySerializationFormat();
~BinarySerializationFormat() override; ~BinarySerializationFormat() override;

View file

@ -65,7 +65,7 @@ protected:
}; };
class ProfileLogger : public SegmentStatsReporter { class ProfileLogger final : public SegmentStatsReporter {
public: public:
ProfileLogger(BroFile* file, double interval); ProfileLogger(BroFile* file, double interval);
~ProfileLogger() override; ~ProfileLogger() override;
@ -84,7 +84,7 @@ private:
// Generates load_sample() events. // Generates load_sample() events.
class SampleLogger : public SegmentStatsReporter { class SampleLogger final : public SegmentStatsReporter {
public: public:
SampleLogger(); SampleLogger();
~SampleLogger() override; ~SampleLogger() override;

View file

@ -114,7 +114,7 @@ private:
ValCache cache; ValCache cache;
}; };
class Manager : public iosource::IOSource { class Manager final : public iosource::IOSource {
public: public:
Manager(); Manager();

View file

@ -165,7 +165,7 @@ private:
/** /**
* Represents a request to add an analyzer to an analyzer set. * Represents a request to add an analyzer to an analyzer set.
*/ */
class AddMod : public Modification { class AddMod final : public Modification {
public: public:
/** /**
* Construct request which can add an analyzer to an analyzer set. * Construct request which can add an analyzer to an analyzer set.
@ -186,7 +186,7 @@ private:
/** /**
* Represents a request to remove an analyzer from an analyzer set. * Represents a request to remove an analyzer from an analyzer set.
*/ */
class RemoveMod : public Modification { class RemoveMod final : public Modification {
public: public:
/** /**
* Construct request which can remove an analyzer from an analyzer set. * Construct request which can remove an analyzer from an analyzer set.

View file

@ -9,7 +9,7 @@ namespace file_analysis {
class File; class File;
class FileReassembler : public Reassembler { class FileReassembler final : public Reassembler {
public: public:
FileReassembler(File* f, uint64_t starting_offset); FileReassembler(File* f, uint64_t starting_offset);
@ -56,4 +56,4 @@ protected:
bool flushing; bool flushing;
}; };
} // namespace analyzer::* } // namespace analyzer::*

View file

@ -94,7 +94,7 @@ Manager::Stream::~Stream()
delete reader; delete reader;
} }
class Manager::TableStream: public Manager::Stream { class Manager::TableStream final : public Manager::Stream {
public: public:
unsigned int num_idx_fields; unsigned int num_idx_fields;
@ -116,7 +116,7 @@ public:
~TableStream() override; ~TableStream() override;
}; };
class Manager::EventStream: public Manager::Stream { class Manager::EventStream final : public Manager::Stream {
public: public:
EventHandlerPtr event; EventHandlerPtr event;
@ -128,7 +128,7 @@ public:
~EventStream() override; ~EventStream() override;
}; };
class Manager::AnalysisStream: public Manager::Stream { class Manager::AnalysisStream final : public Manager::Stream {
public: public:
string file_id; string file_id;

View file

@ -33,7 +33,7 @@ struct FieldMapping {
/** /**
* Reader for structured ASCII files. * Reader for structured ASCII files.
*/ */
class Ascii : public ReaderBackend { class Ascii final : public ReaderBackend {
public: public:
explicit Ascii(ReaderFrontend* frontend); explicit Ascii(ReaderFrontend* frontend);
~Ascii() override; ~Ascii() override;

View file

@ -10,7 +10,7 @@ namespace input { namespace reader {
/** /**
* A benchmark reader to measure performance of the input framework. * A benchmark reader to measure performance of the input framework.
*/ */
class Benchmark : public ReaderBackend { class Benchmark final : public ReaderBackend {
public: public:
explicit Benchmark(ReaderFrontend* frontend); explicit Benchmark(ReaderFrontend* frontend);
~Benchmark() override; ~Benchmark() override;

View file

@ -12,7 +12,7 @@ namespace input { namespace reader {
/** /**
* Binary mode file reader. * Binary mode file reader.
*/ */
class Binary : public ReaderBackend { class Binary final : public ReaderBackend {
public: public:
explicit Binary(ReaderFrontend* frontend); explicit Binary(ReaderFrontend* frontend);
~Binary() override; ~Binary() override;

View file

@ -17,7 +17,7 @@ namespace input { namespace reader {
/** /**
* Reader for Configuration files. * Reader for Configuration files.
*/ */
class Config : public ReaderBackend { class Config final : public ReaderBackend {
public: public:
explicit Config(ReaderFrontend* frontend); explicit Config(ReaderFrontend* frontend);
~Config() override; ~Config() override;

View file

@ -15,7 +15,7 @@ namespace input { namespace reader {
* A reader that returns a file (or the output of a command) as a single * A reader that returns a file (or the output of a command) as a single
* blob. * blob.
*/ */
class Raw : public ReaderBackend { class Raw final : public ReaderBackend {
public: public:
explicit Raw(ReaderFrontend* frontend); explicit Raw(ReaderFrontend* frontend);
~Raw() override; ~Raw() override;

View file

@ -13,7 +13,7 @@
namespace input { namespace reader { namespace input { namespace reader {
class SQLite : public ReaderBackend { class SQLite final : public ReaderBackend {
public: public:
explicit SQLite(ReaderFrontend* frontend); explicit SQLite(ReaderFrontend* frontend);
~SQLite() override; ~SQLite() override;

View file

@ -159,7 +159,7 @@ private:
void RemoveAll(); void RemoveAll();
class WakeupHandler : public IOSource { class WakeupHandler final : public IOSource {
public: public:
WakeupHandler(); WakeupHandler();
~WakeupHandler(); ~WakeupHandler();

View file

@ -13,7 +13,7 @@ extern "C" {
namespace iosource { namespace iosource {
namespace pcap { namespace pcap {
class PcapSource : public iosource::PktSrc { class PcapSource final : public iosource::PktSrc {
public: public:
PcapSource(const std::string& path, bool is_live); PcapSource(const std::string& path, bool is_live);
~PcapSource() override; ~PcapSource() override;

View file

@ -12,7 +12,7 @@
namespace logging { namespace writer { namespace logging { namespace writer {
class Ascii : public WriterBackend { class Ascii final : public WriterBackend {
public: public:
explicit Ascii(WriterFrontend* frontend); explicit Ascii(WriterFrontend* frontend);
~Ascii() override; ~Ascii() override;
@ -75,4 +75,3 @@ private:
} }
} }

View file

@ -8,7 +8,7 @@
namespace logging { namespace writer { namespace logging { namespace writer {
class None : public WriterBackend { class None final : public WriterBackend {
public: public:
explicit None(WriterFrontend* frontend) : WriterBackend(frontend) {} explicit None(WriterFrontend* frontend) : WriterBackend(frontend) {}
~None() override {}; ~None() override {};

View file

@ -13,7 +13,7 @@
namespace logging { namespace writer { namespace logging { namespace writer {
class SQLite : public WriterBackend { class SQLite final : public WriterBackend {
public: public:
explicit SQLite(WriterFrontend* frontend); explicit SQLite(WriterFrontend* frontend);
~SQLite() override; ~SQLite() override;

View file

@ -6,7 +6,7 @@
namespace threading { namespace formatter { namespace threading { namespace formatter {
class Ascii : public Formatter { class Ascii final : public Formatter {
public: public:
/** /**
* A struct to pass the necessary configuration values to the * A struct to pass the necessary configuration values to the

View file

@ -14,7 +14,7 @@ namespace threading { namespace formatter {
* A thread-safe class for converting values into a JSON representation * A thread-safe class for converting values into a JSON representation
* and vice versa. * and vice versa.
*/ */
class JSON : public Formatter { class JSON final : public Formatter {
public: public:
enum TimeFormat { enum TimeFormat {
TS_EPOCH, // Doubles that represents seconds from the UNIX epoch. TS_EPOCH, // Doubles that represents seconds from the UNIX epoch.