[Groonga-commit] groonga/grnxx [master] Add a new option MAP_CURSOR_ORDER_BY_DISTANCE.

Back to archive index

susumu.yata null+****@clear*****
Mon Apr 15 10:42:58 JST 2013


susumu.yata	2013-04-15 10:42:58 +0900 (Mon, 15 Apr 2013)

  New Revision: 111a83bfb61efc33528c75debcb6a06fd243f2d6
  https://github.com/groonga/grnxx/commit/111a83bfb61efc33528c75debcb6a06fd243f2d6

  Message:
    Add a new option MAP_CURSOR_ORDER_BY_DISTANCE.
    
    Not yet supported.

  Modified files:
    lib/grnxx/alpha/map.cpp
    lib/grnxx/alpha/map.hpp

  Modified: lib/grnxx/alpha/map.cpp (+0 -14)
===================================================================
--- lib/grnxx/alpha/map.cpp    2013-04-15 10:23:39 +0900 (0329f77)
+++ lib/grnxx/alpha/map.cpp    2013-04-15 10:42:58 +0900 (a96e003)
@@ -245,20 +245,6 @@ MapCursor<GeoPoint> *Map<GeoPoint>::open_bitwise_completion_cursor(
       this, query, bit_size, options);
 }
 
-//template <typename T>
-//MapCursor<T> *Map<T>::open_neighbor_cursor(
-//    T, size_t, const MapCursorOptions &) {
-//  // Not supported.
-//  return nullptr;
-//}
-
-//template <>
-//MapCursor<GeoPoint> *Map<GeoPoint>::open_neighbor_cursor(
-//    GeoPoint query, size_t min_size, const MapCursorOptions &options) {
-//  // TODO: Not supported.
-//  return nullptr;
-//}
-
 template <typename T>
 MapCursor<T> *Map<T>::open_prefix_cursor(
     T, size_t, const MapCursorOptions &) {

  Modified: lib/grnxx/alpha/map.hpp (+9 -10)
===================================================================
--- lib/grnxx/alpha/map.hpp    2013-04-15 10:23:39 +0900 (1480ed7)
+++ lib/grnxx/alpha/map.hpp    2013-04-15 10:42:58 +0900 (ff21f62)
@@ -44,22 +44,25 @@ struct MapCursorFlagsIdentifier;
 typedef FlagsImpl<MapCursorFlagsIdentifier> MapCursorFlags;
 
 // Sort keys by ID.
-constexpr MapCursorFlags MAP_CURSOR_ORDER_BY_ID   =
+constexpr MapCursorFlags MAP_CURSOR_ORDER_BY_ID       =
     MapCursorFlags::define(0x001);
 // Sort keys by key.
-constexpr MapCursorFlags MAP_CURSOR_ORDER_BY_KEY  =
+constexpr MapCursorFlags MAP_CURSOR_ORDER_BY_KEY      =
     MapCursorFlags::define(0x002);
+// TODO: Sort keys by distance.
+constexpr MapCursorFlags MAP_CURSOR_ORDER_BY_DISTANCE =
+    MapCursorFlags::define(0x004);
 // Access keys in reverse order.
-constexpr MapCursorFlags MAP_CURSOR_REVERSE_ORDER =
+constexpr MapCursorFlags MAP_CURSOR_REVERSE_ORDER     =
     MapCursorFlags::define(0x010);
 // Return keys except min.
-constexpr MapCursorFlags MAP_CURSOR_EXCEPT_MIN    =
+constexpr MapCursorFlags MAP_CURSOR_EXCEPT_MIN        =
     MapCursorFlags::define(0x100);
 // Return keys except max.
-constexpr MapCursorFlags MAP_CURSOR_EXCEPT_MAX    =
+constexpr MapCursorFlags MAP_CURSOR_EXCEPT_MAX        =
     MapCursorFlags::define(0x200);
 // Return keys except exact match.
-constexpr MapCursorFlags MAP_CURSOR_EXCEPT_QUERY  =
+constexpr MapCursorFlags MAP_CURSOR_EXCEPT_QUERY      =
     MapCursorFlags::define(0x400);
 
 struct MapCursorOptions {
@@ -160,10 +163,6 @@ class Map {
   virtual MapCursor<T> *open_bitwise_completion_cursor(
       T query, size_t bit_size,
       const MapCursorOptions &options = MapCursorOptions());
-  // Create a cursor for accessing keys close to "query".
-//  virtual MapCursor<T> *open_neighbor_cursor(
-//      T query, size_t min_size,
-//      const MapCursorOptions &options = MapCursorOptions());
 
   // Only for Slice.
   // Create a cursor for accessing keys matching a prefix of "query".
-------------- next part --------------
HTML����������������������������...
Download 



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