From 27e8cb2ae1f74ecb0dd822cc933f1bdac27aab32 Mon Sep 17 00:00:00 2001
From: Tomas Pecka <peckato1@fit.cvut.cz>
Date: Sun, 1 Apr 2018 14:21:16 +0200
Subject: [PATCH] Fix compile on clang6.0 (virtual ~)

---
 alib2abstraction/src/registry/AlgorithmRegistry.hpp  | 12 ++++++++++++
 alib2abstraction/src/registry/CastRegistry.hpp       |  4 ++++
 alib2abstraction/src/registry/ContainerRegistry.hpp  |  6 ++++++
 alib2abstraction/src/registry/ImmediateRegistry.hpp  |  5 +++++
 alib2abstraction/src/registry/NormalizeRegistry.hpp  |  6 ++++++
 .../src/registry/ValuePrinterRegistry.hpp            |  6 ++++++
 alib2raw/src/registry/RawReaderRegistry.hpp          |  4 ++++
 alib2raw/src/registry/RawWriterRegistry.hpp          |  5 +++++
 alib2str/src/core/stringApi.hpp                      | 11 +++++++++++
 alib2str/src/registry/StringReaderRegistry.hpp       |  5 +++++
 alib2str/src/registry/StringWriterRegistry.hpp       |  6 ++++++
 alib2xml/src/core/xmlApi.hpp                         | 12 ++++++++++++
 alib2xml/src/registry/XmlComposerRegistry.hpp        |  5 +++++
 alib2xml/src/registry/XmlContainerParserRegistry.hpp |  6 ++++++
 alib2xml/src/registry/XmlParserRegistry.hpp          |  5 +++++
 15 files changed, 98 insertions(+)

diff --git a/alib2abstraction/src/registry/AlgorithmRegistry.hpp b/alib2abstraction/src/registry/AlgorithmRegistry.hpp
index 16e2286a9c..c94fda303e 100644
--- a/alib2abstraction/src/registry/AlgorithmRegistry.hpp
+++ b/alib2abstraction/src/registry/AlgorithmRegistry.hpp
@@ -30,6 +30,9 @@ class AlgorithmRegistry {
 	class Entry {
 	public:
 		virtual std::shared_ptr < abstraction::OperationAbstraction > getAbstraction ( ) const = 0;
+
+		virtual ~Entry ( ) {
+		}
 	};
 
 	template < class ObjectType, class Return, class ... Params >
@@ -40,6 +43,9 @@ class AlgorithmRegistry {
 		MemberImpl ( std::function < Return ( typename std::remove_reference < ObjectType >::type *, Params ... ) > callback ) : m_callback ( callback ) {
 		}
 
+		virtual ~MemberImpl ( ) {
+		}
+
 		virtual std::shared_ptr < abstraction::OperationAbstraction > getAbstraction ( ) const override;
 	};
 
@@ -51,6 +57,9 @@ class AlgorithmRegistry {
 		EntryImpl ( std::function < Return ( Params ... ) > callback ) : m_callback ( callback ) {
 		}
 
+		virtual ~EntryImpl ( ) {
+		}
+
 		virtual std::shared_ptr < abstraction::OperationAbstraction > getAbstraction ( ) const override;
 	};
 
@@ -62,6 +71,9 @@ class AlgorithmRegistry {
 		WrapperImpl ( std::function < std::shared_ptr < abstraction::OperationAbstraction > ( Params ... ) > wrapperFinder ) : m_wrapperFinder ( wrapperFinder ) {
 		}
 
+		virtual ~WrapperImpl ( ) {
+		}
+
 		virtual std::shared_ptr < abstraction::OperationAbstraction > getAbstraction ( ) const override;
 	};
 
diff --git a/alib2abstraction/src/registry/CastRegistry.hpp b/alib2abstraction/src/registry/CastRegistry.hpp
index 804864291e..9cb3097bcc 100644
--- a/alib2abstraction/src/registry/CastRegistry.hpp
+++ b/alib2abstraction/src/registry/CastRegistry.hpp
@@ -24,6 +24,8 @@ class CastRegistry {
 	class Entry {
 	public:
 		virtual std::shared_ptr < abstraction::OperationAbstraction > getAbstraction ( ) const = 0;
+		virtual ~Entry ( ) {
+		}
 
 	};
 
@@ -39,6 +41,8 @@ class CastRegistry {
 	public:
 		AlgorithmEntryImpl ( std::function < Return ( Param ) > callback ) : m_callback ( callback ) {
 		}
+		virtual ~AlgorithmEntryImpl ( ) {
+		}
 
 		virtual std::shared_ptr < abstraction::OperationAbstraction > getAbstraction ( ) const override;
 	};
diff --git a/alib2abstraction/src/registry/ContainerRegistry.hpp b/alib2abstraction/src/registry/ContainerRegistry.hpp
index 748b0631cb..a0cc88d237 100644
--- a/alib2abstraction/src/registry/ContainerRegistry.hpp
+++ b/alib2abstraction/src/registry/ContainerRegistry.hpp
@@ -24,12 +24,18 @@ class ContainerRegistry {
 	class Entry {
 	public:
 		virtual std::shared_ptr < abstraction::OperationAbstraction > getAbstraction ( ) const = 0;
+
+		virtual ~Entry ( ) {
+		}
 	};
 
 	template < class Params >
 	class SetEntryImpl : public Entry {
 	public:
 		virtual std::shared_ptr < abstraction::OperationAbstraction > getAbstraction ( ) const override;
+
+		virtual ~SetEntryImpl ( ) {
+		}
 	};
 
 	static ext::map < std::string, ext::vector < ext::pair < std::string, std::shared_ptr < Entry > > > > & getEntries ( ) {
diff --git a/alib2abstraction/src/registry/ImmediateRegistry.hpp b/alib2abstraction/src/registry/ImmediateRegistry.hpp
index 71f8aed4ef..f791480cbb 100644
--- a/alib2abstraction/src/registry/ImmediateRegistry.hpp
+++ b/alib2abstraction/src/registry/ImmediateRegistry.hpp
@@ -22,6 +22,8 @@ class ImmediateRegistry {
 	public:
 		virtual std::shared_ptr < abstraction::OperationAbstraction > getAbstraction ( std::string value ) const = 0;
 
+		virtual ~Entry ( ) {
+		}
 	};
 
 	template < class Result >
@@ -30,6 +32,9 @@ class ImmediateRegistry {
 		EntryImpl ( ) {
 		}
 
+		virtual ~EntryImpl ( ) {
+		}
+
 		virtual std::shared_ptr < abstraction::OperationAbstraction > getAbstraction ( std::string value ) const override;
 	};
 
diff --git a/alib2abstraction/src/registry/NormalizeRegistry.hpp b/alib2abstraction/src/registry/NormalizeRegistry.hpp
index 131661a7f7..bd545349b5 100644
--- a/alib2abstraction/src/registry/NormalizeRegistry.hpp
+++ b/alib2abstraction/src/registry/NormalizeRegistry.hpp
@@ -21,6 +21,9 @@ class NormalizeRegistry {
 	public:
 		virtual std::shared_ptr < abstraction::OperationAbstraction > getAbstraction ( ) const = 0;
 
+		virtual ~Entry ( ) {
+		}
+
 	};
 
 	template < class Param >
@@ -29,6 +32,9 @@ class NormalizeRegistry {
 		EntryImpl ( ) {
 		}
 
+		virtual ~EntryImpl ( ) {
+		}
+
 		virtual std::shared_ptr < abstraction::OperationAbstraction > getAbstraction ( ) const override;
 	};
 
diff --git a/alib2abstraction/src/registry/ValuePrinterRegistry.hpp b/alib2abstraction/src/registry/ValuePrinterRegistry.hpp
index ed21d121bf..efc2d40e5b 100644
--- a/alib2abstraction/src/registry/ValuePrinterRegistry.hpp
+++ b/alib2abstraction/src/registry/ValuePrinterRegistry.hpp
@@ -21,6 +21,9 @@ class ValuePrinterRegistry {
 	public:
 		virtual std::shared_ptr < abstraction::OperationAbstraction > getAbstraction ( std::ostream & os ) const = 0;
 
+		virtual ~Entry ( ) {
+		}
+
 	};
 
 	template < class Param >
@@ -29,6 +32,9 @@ class ValuePrinterRegistry {
 		EntryImpl ( ) {
 		}
 
+		virtual ~EntryImpl ( ) {
+		}
+
 		virtual std::shared_ptr < abstraction::OperationAbstraction > getAbstraction ( std::ostream & os ) const override;
 	};
 
diff --git a/alib2raw/src/registry/RawReaderRegistry.hpp b/alib2raw/src/registry/RawReaderRegistry.hpp
index 7e1c3a6228..66cffe99eb 100644
--- a/alib2raw/src/registry/RawReaderRegistry.hpp
+++ b/alib2raw/src/registry/RawReaderRegistry.hpp
@@ -23,6 +23,8 @@ class RawReaderRegistry {
 	public:
 		virtual std::shared_ptr < abstraction::OperationAbstraction > getAbstraction ( ) const = 0;
 
+		virtual ~Entry ( ) {
+		}
 	};
 
 	template < class Return >
@@ -30,6 +32,8 @@ class RawReaderRegistry {
 	public:
 		virtual std::shared_ptr < abstraction::OperationAbstraction > getAbstraction ( ) const override;
 
+		virtual ~EntryImpl ( ) {
+		}
 	};
 
 	static ext::map < std::string, std::unique_ptr < Entry > > & getEntries ( ) {
diff --git a/alib2raw/src/registry/RawWriterRegistry.hpp b/alib2raw/src/registry/RawWriterRegistry.hpp
index b7ae25ecdc..b8210981a6 100644
--- a/alib2raw/src/registry/RawWriterRegistry.hpp
+++ b/alib2raw/src/registry/RawWriterRegistry.hpp
@@ -23,6 +23,8 @@ class RawWriterRegistry {
 	public:
 		virtual std::shared_ptr < abstraction::OperationAbstraction > getAbstraction ( ) const = 0;
 
+		virtual ~Entry ( ) {
+		}
 	};
 
 	template < class Param >
@@ -31,6 +33,9 @@ class RawWriterRegistry {
 		EntryImpl ( ) {
 		}
 
+		virtual ~EntryImpl ( ) {
+		}
+
 		virtual std::shared_ptr < abstraction::OperationAbstraction > getAbstraction ( ) const override;
 	};
 
diff --git a/alib2str/src/core/stringApi.hpp b/alib2str/src/core/stringApi.hpp
index e2c9a0504b..8c63b7a167 100644
--- a/alib2str/src/core/stringApi.hpp
+++ b/alib2str/src/core/stringApi.hpp
@@ -30,6 +30,8 @@ private:
 	class GroupReader {
 	public:
 		virtual Group parse ( std::istream & input ) = 0;
+		virtual ~GroupReader ( ) {
+		}
 	};
 
 	static ext::deque < std::pair < std::function < bool ( std::istream & ) >, std::unique_ptr < GroupReader > > > & parseFunctions ( ) {
@@ -46,6 +48,9 @@ private:
 		ReaderRegister( ) : parseFunction ( stringApi < Type >::parse ) {
 		}
 
+		virtual ~ReaderRegister ( ) {
+		}
+
 		virtual Group parse ( std::istream & input ) {
 			return Group ( parseFunction ( input ) );
 		}
@@ -54,6 +59,9 @@ private:
 	class GroupWriter {
 	public:
 		virtual void compose ( std::ostream & output, const Group & group ) = 0;
+
+		virtual ~GroupWriter ( ) {
+		}
 	};
 
 	static ext::map < std::string, std::unique_ptr < GroupWriter > > & composeFunctions ( ) {
@@ -70,6 +78,9 @@ private:
 		WriterRegister( ) : composeFunction ( stringApi < Type >::compose ) {
 		}
 
+		virtual ~WriterRegister ( ) {
+		}
+
 		virtual void compose ( std::ostream & output, const Group & group ) {
 			composeFunction ( output, static_cast < const Type & > ( group.getData ( ) ) );
 		}
diff --git a/alib2str/src/registry/StringReaderRegistry.hpp b/alib2str/src/registry/StringReaderRegistry.hpp
index 7c16956201..f987514c2b 100644
--- a/alib2str/src/registry/StringReaderRegistry.hpp
+++ b/alib2str/src/registry/StringReaderRegistry.hpp
@@ -23,6 +23,8 @@ class StringReaderRegistry {
 	public:
 		virtual std::shared_ptr < abstraction::OperationAbstraction > getAbstraction ( ) const = 0;
 
+		virtual ~Entry ( ) {
+		}
 	};
 
 	template < class Return >
@@ -31,6 +33,9 @@ class StringReaderRegistry {
 		EntryImpl ( ) {
 		}
 
+		virtual ~EntryImpl ( ) {
+		}
+
 		virtual std::shared_ptr < abstraction::OperationAbstraction > getAbstraction ( ) const override;
 	};
 
diff --git a/alib2str/src/registry/StringWriterRegistry.hpp b/alib2str/src/registry/StringWriterRegistry.hpp
index 376cc96f95..68ab65ed6c 100644
--- a/alib2str/src/registry/StringWriterRegistry.hpp
+++ b/alib2str/src/registry/StringWriterRegistry.hpp
@@ -23,6 +23,9 @@ class StringWriterRegistry {
 	public:
 		virtual std::shared_ptr < abstraction::OperationAbstraction > getAbstraction ( ) const = 0;
 
+		virtual ~Entry ( ) {
+		}
+
 	};
 
 	template < class Param >
@@ -31,6 +34,9 @@ class StringWriterRegistry {
 		EntryImpl ( ) {
 		}
 
+		virtual ~EntryImpl ( ) {
+		}
+
 		virtual std::shared_ptr < abstraction::OperationAbstraction > getAbstraction ( ) const override;
 	};
 
diff --git a/alib2xml/src/core/xmlApi.hpp b/alib2xml/src/core/xmlApi.hpp
index ce3c49c7cf..d5267af54c 100644
--- a/alib2xml/src/core/xmlApi.hpp
+++ b/alib2xml/src/core/xmlApi.hpp
@@ -86,6 +86,9 @@ private:
 	class GroupParser {
 	public:
 		virtual Group parse ( ext::deque < sax::Token >::iterator & input ) = 0;
+
+		virtual ~GroupParser ( ) {
+		}
 	};
 
 	static ext::map < std::string, std::unique_ptr < GroupParser > > & parseFunctions ( ) {
@@ -102,6 +105,9 @@ private:
 		ParserRegister( ) : parseFunction ( xmlApi < Type >::parse ) {
 		}
 
+		virtual ~ParserRegister( ) {
+		}
+
 		virtual Group parse ( ext::deque < sax::Token >::iterator & input ) {
 			return Group ( parseFunction ( input ) );
 		}
@@ -111,6 +117,9 @@ private:
 	class GroupComposer {
 	public:
 		virtual void compose ( ext::deque < sax::Token > & input, const Group & group ) = 0;
+
+		virtual ~GroupComposer( ) {
+		}
 	};
 
 	static ext::map < std::string, std::unique_ptr < GroupComposer > > & composeFunctions ( ) {
@@ -127,6 +136,9 @@ private:
 		ComposerRegister( ) : composeFunction ( xmlApi < Type >::compose ) {
 		}
 
+		virtual ~ComposerRegister ( ) {
+		}
+
 		virtual void compose ( ext::deque < sax::Token > & input, const Group & group ) {
 			composeFunction ( input, static_cast < const Type & > ( group.getData ( ) ) );
 		}
diff --git a/alib2xml/src/registry/XmlComposerRegistry.hpp b/alib2xml/src/registry/XmlComposerRegistry.hpp
index 90bbe6696e..192fd7be3e 100644
--- a/alib2xml/src/registry/XmlComposerRegistry.hpp
+++ b/alib2xml/src/registry/XmlComposerRegistry.hpp
@@ -23,6 +23,8 @@ class XmlComposerRegistry {
 	public:
 		virtual std::shared_ptr < abstraction::OperationAbstraction > getAbstraction ( ) const = 0;
 
+		virtual ~Entry ( ) {
+		}
 	};
 
 	template < class Param >
@@ -31,6 +33,9 @@ class XmlComposerRegistry {
 		EntryImpl ( ) {
 		}
 
+		virtual ~EntryImpl ( ) {
+		}
+
 		virtual std::shared_ptr < abstraction::OperationAbstraction > getAbstraction ( ) const override;
 	};
 
diff --git a/alib2xml/src/registry/XmlContainerParserRegistry.hpp b/alib2xml/src/registry/XmlContainerParserRegistry.hpp
index 29f462baa6..3a678a8dd7 100644
--- a/alib2xml/src/registry/XmlContainerParserRegistry.hpp
+++ b/alib2xml/src/registry/XmlContainerParserRegistry.hpp
@@ -24,12 +24,18 @@ class XmlContainerParserRegistry {
 	class Entry {
 	public:
 		virtual std::shared_ptr < abstraction::OperationAbstraction > getAbstraction ( ) const = 0;
+
+		virtual ~Entry ( ) {
+		}
 	};
 
 	template < class Params >
 	class SetEntryImpl : public Entry {
 	public:
 		virtual std::shared_ptr < abstraction::OperationAbstraction > getAbstraction ( ) const override;
+
+		virtual ~SetEntryImpl ( ) {
+		}
 	};
 
 	static ext::map < std::string, ext::vector < ext::pair < std::string, std::shared_ptr < Entry > > > > & getEntries ( ) {
diff --git a/alib2xml/src/registry/XmlParserRegistry.hpp b/alib2xml/src/registry/XmlParserRegistry.hpp
index 067680b9c1..b252c33c39 100644
--- a/alib2xml/src/registry/XmlParserRegistry.hpp
+++ b/alib2xml/src/registry/XmlParserRegistry.hpp
@@ -23,6 +23,8 @@ class XmlParserRegistry {
 	public:
 		virtual std::shared_ptr < abstraction::OperationAbstraction > getAbstraction ( ) const = 0;
 
+		virtual ~Entry ( ) {
+		}
 	};
 
 	template < class Return >
@@ -31,6 +33,9 @@ class XmlParserRegistry {
 		EntryImpl ( ) {
 		}
 
+		virtual ~EntryImpl ( ) {
+		}
+
 		virtual std::shared_ptr < abstraction::OperationAbstraction > getAbstraction ( ) const override;
 	};
 
-- 
GitLab