aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/compression
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2016-01-10 00:51:48 -0500
committerJack Lloyd <[email protected]>2016-01-10 00:51:48 -0500
commit45124582e3b964800f0be1f88773dd6f2cafc672 (patch)
tree9bd788556ddf9731e466b7f24a16e604f662ea24 /src/lib/compression
parent672d29570e55686b90126b5d6f5d337ddf0b8f04 (diff)
Add final attribute to many classes
In some cases this can offer better optimization, via devirtualization. And it lets the user know the class is not intended for derivation. Some discussion in GH #402
Diffstat (limited to 'src/lib/compression')
-rw-r--r--src/lib/compression/bzip2/bzip2.h4
-rw-r--r--src/lib/compression/compression.h18
-rw-r--r--src/lib/compression/lzma/lzma.h4
-rw-r--r--src/lib/compression/zlib/zlib.h12
4 files changed, 19 insertions, 19 deletions
diff --git a/src/lib/compression/bzip2/bzip2.h b/src/lib/compression/bzip2/bzip2.h
index ca0ac529b..06c80cb8e 100644
--- a/src/lib/compression/bzip2/bzip2.h
+++ b/src/lib/compression/bzip2/bzip2.h
@@ -16,7 +16,7 @@ namespace Botan {
/**
* Bzip2 Compression
*/
-class BOTAN_DLL Bzip2_Compression : public Stream_Compression
+class BOTAN_DLL Bzip2_Compression final : public Stream_Compression
{
public:
/**
@@ -39,7 +39,7 @@ class BOTAN_DLL Bzip2_Compression : public Stream_Compression
/**
* Bzip2 Deccompression
*/
-class BOTAN_DLL Bzip2_Decompression : public Stream_Decompression
+class BOTAN_DLL Bzip2_Decompression final : public Stream_Decompression
{
public:
std::string name() const override { return "Bzip2_Decompression"; }
diff --git a/src/lib/compression/compression.h b/src/lib/compression/compression.h
index 0a8079de8..66aaacdc4 100644
--- a/src/lib/compression/compression.h
+++ b/src/lib/compression/compression.h
@@ -58,16 +58,16 @@ class Compression_Stream
class BOTAN_DLL Stream_Compression : public Compressor_Transform
{
public:
- void update(secure_vector<byte>& buf, size_t offset = 0) override;
+ void update(secure_vector<byte>& buf, size_t offset = 0) final override;
- void flush(secure_vector<byte>& buf, size_t offset = 0) override;
+ void flush(secure_vector<byte>& buf, size_t offset = 0) final override;
- void finish(secure_vector<byte>& buf, size_t offset = 0) override;
+ void finish(secure_vector<byte>& buf, size_t offset = 0) final override;
- void clear() override;
+ void clear() final override;
private:
- secure_vector<byte> start_raw(const byte[], size_t) override;
+ secure_vector<byte> start_raw(const byte[], size_t) final override;
void process(secure_vector<byte>& buf, size_t offset, u32bit flags);
@@ -80,14 +80,14 @@ class BOTAN_DLL Stream_Compression : public Compressor_Transform
class BOTAN_DLL Stream_Decompression : public Compressor_Transform
{
public:
- void update(secure_vector<byte>& buf, size_t offset = 0) override;
+ void update(secure_vector<byte>& buf, size_t offset = 0) final override;
- void finish(secure_vector<byte>& buf, size_t offset = 0) override;
+ void finish(secure_vector<byte>& buf, size_t offset = 0) final override;
- void clear() override;
+ void clear() final override;
private:
- secure_vector<byte> start_raw(const byte[], size_t) override;
+ secure_vector<byte> start_raw(const byte[], size_t) final override;
void process(secure_vector<byte>& buf, size_t offset, u32bit flags);
diff --git a/src/lib/compression/lzma/lzma.h b/src/lib/compression/lzma/lzma.h
index 5f19c4b97..d9ea10091 100644
--- a/src/lib/compression/lzma/lzma.h
+++ b/src/lib/compression/lzma/lzma.h
@@ -17,7 +17,7 @@ namespace Botan {
/**
* LZMA Compression
*/
-class BOTAN_DLL LZMA_Compression : public Stream_Compression
+class BOTAN_DLL LZMA_Compression final : public Stream_Compression
{
public:
/**
@@ -38,7 +38,7 @@ class BOTAN_DLL LZMA_Compression : public Stream_Compression
/**
* LZMA Deccompression
*/
-class BOTAN_DLL LZMA_Decompression : public Stream_Decompression
+class BOTAN_DLL LZMA_Decompression final : public Stream_Decompression
{
public:
std::string name() const override { return "LZMA_Decompression"; }
diff --git a/src/lib/compression/zlib/zlib.h b/src/lib/compression/zlib/zlib.h
index 2437e6133..6a8cead14 100644
--- a/src/lib/compression/zlib/zlib.h
+++ b/src/lib/compression/zlib/zlib.h
@@ -16,7 +16,7 @@ namespace Botan {
/**
* Zlib Compression
*/
-class BOTAN_DLL Zlib_Compression : public Stream_Compression
+class BOTAN_DLL Zlib_Compression final : public Stream_Compression
{
public:
/**
@@ -38,7 +38,7 @@ class BOTAN_DLL Zlib_Compression : public Stream_Compression
/**
* Zlib Decompression
*/
-class BOTAN_DLL Zlib_Decompression : public Stream_Decompression
+class BOTAN_DLL Zlib_Decompression final : public Stream_Decompression
{
public:
std::string name() const override { return "Zlib_Decompression"; }
@@ -50,7 +50,7 @@ class BOTAN_DLL Zlib_Decompression : public Stream_Decompression
/**
* Deflate Compression
*/
-class BOTAN_DLL Deflate_Compression : public Stream_Compression
+class BOTAN_DLL Deflate_Compression final : public Stream_Compression
{
public:
/**
@@ -71,7 +71,7 @@ class BOTAN_DLL Deflate_Compression : public Stream_Compression
/**
* Deflate Decompression
*/
-class BOTAN_DLL Deflate_Decompression : public Stream_Decompression
+class BOTAN_DLL Deflate_Decompression final : public Stream_Decompression
{
public:
std::string name() const override { return "Deflate_Decompression"; }
@@ -83,7 +83,7 @@ class BOTAN_DLL Deflate_Decompression : public Stream_Decompression
/**
* Gzip Compression
*/
-class BOTAN_DLL Gzip_Compression : public Stream_Compression
+class BOTAN_DLL Gzip_Compression final : public Stream_Compression
{
public:
/**
@@ -106,7 +106,7 @@ class BOTAN_DLL Gzip_Compression : public Stream_Compression
/**
* Gzip Decompression
*/
-class BOTAN_DLL Gzip_Decompression : public Stream_Decompression
+class BOTAN_DLL Gzip_Decompression final : public Stream_Decompression
{
public:
std::string name() const override { return "Gzip_Decompression"; }