Skip to content

Commit

Permalink
fix error: add virtual destructor to Index::Iterator
Browse files Browse the repository at this point in the history
al-pacino committed Apr 22, 2018
1 parent 8aa2f4c commit bc8b889
Showing 4 changed files with 8 additions and 29 deletions.
1 change: 0 additions & 1 deletion core/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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
22 changes: 0 additions & 22 deletions core/src/main/lspl/text/indexes/Index.cpp

This file was deleted.

6 changes: 4 additions & 2 deletions core/src/main/lspl/text/indexes/Index.h
Original file line number Diff line number Diff line change
@@ -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
8 changes: 4 additions & 4 deletions core/src/main/lspl/text/indexes/SpeechPartIndex.cpp
Original file line number Diff line number Diff line change
@@ -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;

0 comments on commit bc8b889

Please sign in to comment.