susumu.yata
null+****@clear*****
Tue Sep 16 19:42:19 JST 2014
susumu.yata 2014-09-16 19:42:19 +0900 (Tue, 16 Sep 2014) New Revision: cab77337e8b2eb9e5b1c93e267a49f18bb49d8af https://github.com/groonga/grnxx/commit/cab77337e8b2eb9e5b1c93e267a49f18bb49d8af Message: Rename Index::create_cursor() to Index::find(). (#52) Modified files: include/grnxx/index.hpp lib/grnxx/index.cpp lib/grnxx/tree_index.hpp test/test_index.cpp Modified: include/grnxx/index.hpp (+1 -1) =================================================================== --- include/grnxx/index.hpp 2014-09-16 19:22:51 +0900 (180d6d4) +++ include/grnxx/index.hpp 2014-09-16 19:42:19 +0900 (0ee3cd5) @@ -87,7 +87,7 @@ class Index { // On success, returns a pointer to the cursor. // On failure, returns nullptr and stores error information into "*error" if // "error" != nullptr. - virtual unique_ptr<Cursor> create_cursor( + virtual unique_ptr<Cursor> find( Error *error, const Datum &datum, const CursorOptions &options = CursorOptions()) const; Modified: lib/grnxx/index.cpp (+5 -5) =================================================================== --- lib/grnxx/index.cpp 2014-09-16 19:22:51 +0900 (4af5a41) +++ lib/grnxx/index.cpp 2014-09-16 19:42:19 +0900 (e512049) @@ -12,7 +12,7 @@ namespace grnxx { Index::~Index() {} -unique_ptr<Cursor> Index::create_cursor( +unique_ptr<Cursor> Index::find( Error *error, const Datum &, const CursorOptions &) const { @@ -384,7 +384,7 @@ unique_ptr<TreeIndex<Bool>> TreeIndex<Bool>::create( TreeIndex<Bool>::~TreeIndex() {} -unique_ptr<Cursor> TreeIndex<Bool>::create_cursor( +unique_ptr<Cursor> TreeIndex<Bool>::find( Error *error, const Datum &datum, const CursorOptions &options) const { @@ -545,7 +545,7 @@ unique_ptr<TreeIndex<Int>> TreeIndex<Int>::create( TreeIndex<Int>::~TreeIndex() {} -unique_ptr<Cursor> TreeIndex<Int>::create_cursor( +unique_ptr<Cursor> TreeIndex<Int>::find( Error *error, const Datum &datum, const CursorOptions &options) const { @@ -706,7 +706,7 @@ unique_ptr<TreeIndex<Float>> TreeIndex<Float>::create( TreeIndex<Float>::~TreeIndex() {} -unique_ptr<Cursor> TreeIndex<Float>::create_cursor( +unique_ptr<Cursor> TreeIndex<Float>::find( Error *error, const Datum &datum, const CursorOptions &options) const { @@ -878,7 +878,7 @@ unique_ptr<TreeIndex<Text>> TreeIndex<Text>::create( TreeIndex<Text>::~TreeIndex() {} -unique_ptr<Cursor> TreeIndex<Text>::create_cursor( +unique_ptr<Cursor> TreeIndex<Text>::find( Error *error, const Datum &datum, const CursorOptions &options) const { Modified: lib/grnxx/tree_index.hpp (+4 -4) =================================================================== --- lib/grnxx/tree_index.hpp 2014-09-16 19:22:51 +0900 (29923f4) +++ lib/grnxx/tree_index.hpp 2014-09-16 19:42:19 +0900 (ff21e2b) @@ -27,7 +27,7 @@ class TreeIndex<Bool> : public Index { ~TreeIndex(); - unique_ptr<Cursor> create_cursor( + unique_ptr<Cursor> find( Error *error, const Datum &datum, const CursorOptions &options = CursorOptions()) const; @@ -61,7 +61,7 @@ class TreeIndex<Int> : public Index { ~TreeIndex(); - unique_ptr<Cursor> create_cursor( + unique_ptr<Cursor> find( Error *error, const Datum &datum, const CursorOptions &options = CursorOptions()) const; @@ -107,7 +107,7 @@ class TreeIndex<Float> : public Index { ~TreeIndex(); - unique_ptr<Cursor> create_cursor( + unique_ptr<Cursor> find( Error *error, const Datum &datum, const CursorOptions &options = CursorOptions()) const; @@ -141,7 +141,7 @@ class TreeIndex<Text> : public Index { ~TreeIndex(); - unique_ptr<Cursor> create_cursor( + unique_ptr<Cursor> find( Error *error, const Datum &datum, const CursorOptions &options = CursorOptions()) const; Modified: test/test_index.cpp (+4 -4) =================================================================== --- test/test_index.cpp 2014-09-16 19:22:51 +0900 (b9359c9) +++ test/test_index.cpp 2014-09-16 19:42:19 +0900 (1501ef3) @@ -251,7 +251,7 @@ void test_bool_exact_match() { for (int possible_value_id = 0; possible_value_id < 2; ++possible_value_id) { grnxx::Bool value = possible_values[possible_value_id]; - auto cursor = index->create_cursor(&error, value); + auto cursor = index->find(&error, value); assert(cursor); grnxx::Array<grnxx::Record> records; @@ -310,7 +310,7 @@ void test_int_exact_match() { // Test cursors for each value. for (grnxx::Int value = 0; value < 100; ++value) { - auto cursor = index->create_cursor(&error, value); + auto cursor = index->find(&error, value); assert(cursor); grnxx::Array<grnxx::Record> records; @@ -371,7 +371,7 @@ void test_float_exact_match() { for (grnxx::Int int_value = 0; int_value < 256; ++int_value) { grnxx::Float value = int_value / 256.0; - auto cursor = index->create_cursor(&error, value); + auto cursor = index->find(&error, value); assert(cursor); grnxx::Array<grnxx::Record> records; @@ -436,7 +436,7 @@ void test_text_exact_match() { for (int int_value = 0; int_value < 100; ++int_value) { grnxx::Text value = bodies[int_value]; - auto cursor = index->create_cursor(&error, value); + auto cursor = index->find(&error, value); assert(cursor); grnxx::Array<grnxx::Record> records; -------------- next part -------------- HTML����������������������������... Download