From 4060d81d35594486ea0640832d43d544cbdbfcd3 Mon Sep 17 00:00:00 2001 From: ilor <kailoran@gmail.com> Date: Fri, 20 May 2011 15:57:49 +0200 Subject: [PATCH] Revert "add has_more to readers". Not needed with the upgraded shared_ptr swig wrappers (and also not fully correct). This reverts commit 99388c5355f42043178e6391a66d19840764b0b2. --- libcorpus2/io/reader.cpp | 16 ---------------- libcorpus2/io/reader.h | 11 ----------- swig/libcorpustokenreader.i | 1 - 3 files changed, 28 deletions(-) diff --git a/libcorpus2/io/reader.cpp b/libcorpus2/io/reader.cpp index 7dacd10..46a158a 100644 --- a/libcorpus2/io/reader.cpp +++ b/libcorpus2/io/reader.cpp @@ -222,22 +222,6 @@ boost::shared_ptr<Chunk> BufferedChunkReader::get_next_chunk() } } -bool BufferedChunkReader::has_more() -{ - ensure_more(); - return !chunk_buf_.empty(); -} - -bool BufferedSentenceReader::has_more() -{ - if (sentence_buf_ != NULL) { - return true; - } - sentence_buf_ = actual_next_sentence(); - return (sentence_buf_ != NULL); -} - - BufferedSentenceReader::BufferedSentenceReader(const Tagset& tagset) : TokenReader(tagset), chunkify_(true) , sentence_buf_(), token_buf_() diff --git a/libcorpus2/io/reader.h b/libcorpus2/io/reader.h index e4e242f..417497d 100644 --- a/libcorpus2/io/reader.h +++ b/libcorpus2/io/reader.h @@ -90,13 +90,6 @@ public: */ virtual boost::shared_ptr<Chunk> get_next_chunk() = 0; - - /** - * Checks if there is anything left to be returned. Non-const because it - * might read ahead and fill the buffer. - */ - virtual bool has_more() = 0; - /** * General option setter. */ @@ -304,8 +297,6 @@ public: boost::shared_ptr<Chunk> get_next_chunk(); - bool has_more(); - void set_option(const std::string& option) { TokenReader::set_option(option); } @@ -341,8 +332,6 @@ public: Sentence::Ptr get_next_sentence(); - bool has_more(); - boost::shared_ptr<Chunk> get_next_chunk(); void set_option(const std::string& option) { diff --git a/swig/libcorpustokenreader.i b/swig/libcorpustokenreader.i index c5d64d1..0a367d5 100644 --- a/swig/libcorpustokenreader.i +++ b/swig/libcorpustokenreader.i @@ -61,7 +61,6 @@ namespace Corpus2 { virtual Token* get_next_token() = 0; virtual Sentence::Ptr get_next_sentence() = 0; virtual boost::shared_ptr<Chunk> get_next_chunk() = 0; - virtual bool has_more() = 0; /* --------------------------------------------------------------------- */ virtual void set_option(const std::string& option); -- GitLab