From bc8b88974d9b2cfcaf51aab73d28aca79c1fcb18 Mon Sep 17 00:00:00 2001 From: Anton Todua Date: Sun, 22 Apr 2018 19:32:41 +0300 Subject: [PATCH] fix error: add virtual destructor to Index::Iterator --- core/CMakeLists.txt | 1 - core/src/main/lspl/text/indexes/Index.cpp | 22 ------------------- core/src/main/lspl/text/indexes/Index.h | 6 +++-- .../lspl/text/indexes/SpeechPartIndex.cpp | 8 +++---- 4 files changed, 8 insertions(+), 29 deletions(-) delete mode 100644 core/src/main/lspl/text/indexes/Index.cpp diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index 65936804..acf89094 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -78,7 +78,6 @@ set(LSPL_CORE_SOURCES src/main/lspl/text/readers/JsonTextReader.cpp src/main/lspl/text/readers/TextReader.cpp src/main/lspl/text/readers/PlainTextReader.cpp - src/main/lspl/text/indexes/Index.cpp src/main/lspl/text/indexes/PatternIndex.cpp src/main/lspl/text/indexes/SpeechPartIndex.cpp src/main/lspl/text/Node.cpp diff --git a/core/src/main/lspl/text/indexes/Index.cpp b/core/src/main/lspl/text/indexes/Index.cpp deleted file mode 100644 index d1c39f47..00000000 --- a/core/src/main/lspl/text/indexes/Index.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Index.cpp - * - * Created on: Mar 18, 2009 - * Author: alno - */ -#include "../../base/BaseInternal.h" - -#include "Index.h" - -namespace lspl { namespace text { namespace indexes { - -Index::Index() { - // TODO Auto-generated constructor stub - -} - -Index::~Index() { - // TODO Auto-generated destructor stub -} - -} } } diff --git a/core/src/main/lspl/text/indexes/Index.h b/core/src/main/lspl/text/indexes/Index.h index fcb29770..2a68d010 100644 --- a/core/src/main/lspl/text/indexes/Index.h +++ b/core/src/main/lspl/text/indexes/Index.h @@ -25,6 +25,8 @@ class LSPL_EXPORT Index { */ class LSPL_EXPORT Iterator { public: + virtual ~Iterator() = default; + Transition * operator *() { return get(); } Transition * operator ->() { return get(); } @@ -36,8 +38,8 @@ class LSPL_EXPORT Index { }; public: - Index(); - virtual ~Index(); + Index() = default; + virtual ~Index() = default; }; } } } // namespace lspl::text::indexes diff --git a/core/src/main/lspl/text/indexes/SpeechPartIndex.cpp b/core/src/main/lspl/text/indexes/SpeechPartIndex.cpp index d9d54b3b..9902411d 100644 --- a/core/src/main/lspl/text/indexes/SpeechPartIndex.cpp +++ b/core/src/main/lspl/text/indexes/SpeechPartIndex.cpp @@ -28,20 +28,20 @@ class SpeechPartIndex::Impl { class SpeechPartIndex::IteratorImpl : public Index::Iterator { public: IteratorImpl(Impl::IndexValue & value) : it( value.begin() ), end( value.end() ) { + } - }; virtual Transition * get() { return it->get(); - }; + } virtual void increment() { ++ it; - }; + } virtual bool finished() { return it == end; - }; + } private: Impl::IndexValue::iterator it;