[Groonga-commit] groonga/grnxx at 436cd4b [master] Make Cursor::read() pure virtual. (#61)

Back to archive index

susumu.yata null+****@clear*****
Thu Sep 18 16:13:01 JST 2014


susumu.yata	2014-09-18 16:13:01 +0900 (Thu, 18 Sep 2014)

  New Revision: 436cd4b68057976065c673bf557ba49674ea21b4
  https://github.com/groonga/grnxx/commit/436cd4b68057976065c673bf557ba49674ea21b4

  Message:
    Make Cursor::read() pure virtual. (#61)

  Modified files:
    include/grnxx/cursor.hpp
    lib/grnxx/cursor.cpp

  Modified: include/grnxx/cursor.hpp (+1 -3)
===================================================================
--- include/grnxx/cursor.hpp    2014-09-18 16:12:14 +0900 (8db43d5)
+++ include/grnxx/cursor.hpp    2014-09-18 16:13:01 +0900 (a29837d)
@@ -23,8 +23,6 @@ class Cursor {
   // "error" != nullptr.
   virtual Int read(Error *error, Int max_count, Array<Record> *records);
 
-  // TODO: should be pure virtual.
-  //
   // Read the next records.
   //
   // Reads at most "records.size()" records into "records".
@@ -32,7 +30,7 @@ class Cursor {
   // On success, returns the number of records read.
   // On failure, returns -1 and stores error information into "*error" if
   // "error" != nullptr.
-  virtual Int read(Error *error, ArrayRef<Record> records);
+  virtual Int read(Error *error, ArrayRef<Record> records) = 0;
 
   // Read all the remaining records.
   //

  Modified: lib/grnxx/cursor.cpp (+0 -5)
===================================================================
--- lib/grnxx/cursor.cpp    2014-09-18 16:12:14 +0900 (ae21991)
+++ lib/grnxx/cursor.cpp    2014-09-18 16:13:01 +0900 (d991ea8)
@@ -69,11 +69,6 @@ Int Cursor::read(Error *error, Int max_count, Array<Record> *records) {
   return count;
 }
 
-// TODO: To be removed!
-Int Cursor::read(Error *, ArrayRef<Record>) {
-  return -1;
-}
-
 Int Cursor::read_all(Error *error, Array<Record> *records) {
   Int total_count = 0;
   Int count;
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index