susumu.yata
null+****@clear*****
Wed May 29 18:28:53 JST 2013
susumu.yata 2013-05-29 18:28:53 +0900 (Wed, 29 May 2013) New Revision: be523ff9275dd3bc4dbaf84738d1699e4221fd04 https://github.com/groonga/grnxx/commit/be523ff9275dd3bc4dbaf84738d1699e4221fd04 Message: Enable grnxx::ArrayMap<Bytes>. Modified files: lib/grnxx/map.cpp lib/grnxx/map.hpp lib/grnxx/map/array_map.cpp lib/grnxx/map/cursor_impl.cpp lib/grnxx/map/helper.hpp Modified: lib/grnxx/map.cpp (+1 -2) =================================================================== --- lib/grnxx/map.cpp 2013-05-29 18:13:37 +0900 (697b4d6) +++ lib/grnxx/map.cpp 2013-05-29 18:28:53 +0900 (baff7f6) @@ -293,7 +293,6 @@ template class Map<int64_t>; template class Map<uint64_t>; template class Map<double>; template class Map<GeoPoint>; -// TODO: To be enabled -//template class Map<Bytes>; +template class Map<Bytes>; } // namespace grnxx Modified: lib/grnxx/map.hpp (+0 -1) =================================================================== --- lib/grnxx/map.hpp 2013-05-29 18:13:37 +0900 (bada395) +++ lib/grnxx/map.hpp 2013-05-29 18:28:53 +0900 (3eb8a2d) @@ -127,7 +127,6 @@ class Map { // Remove all the keys in "*this" and return true on success. virtual bool truncate(); - // TODO: Not yet fixed. // Return a reference to create a cursor query. MapCursorAllKeys<T> all_keys() const { return MapCursorAllKeys<T>(); Modified: lib/grnxx/map/array_map.cpp (+2 -4) =================================================================== --- lib/grnxx/map/array_map.cpp 2013-05-29 18:13:37 +0900 (416f175) +++ lib/grnxx/map/array_map.cpp 2013-05-29 18:28:53 +0900 (d88c6ea) @@ -20,8 +20,7 @@ #include <memory> #include <new> -// TODO -//#include "grnxx/bytes.hpp" +#include "grnxx/bytes.hpp" #include "grnxx/geo_point.hpp" #include "grnxx/logger.hpp" #include "grnxx/storage.hpp" @@ -361,8 +360,7 @@ template class ArrayMap<int64_t>; template class ArrayMap<uint64_t>; template class ArrayMap<double>; template class ArrayMap<GeoPoint>; -// TODO -//template class ArrayMap<Bytes>; +template class ArrayMap<Bytes>; } // namespace map } // namespace grnxx Modified: lib/grnxx/map/cursor_impl.cpp (+3 -6) =================================================================== --- lib/grnxx/map/cursor_impl.cpp 2013-05-29 18:13:37 +0900 (f99fecc) +++ lib/grnxx/map/cursor_impl.cpp 2013-05-29 18:28:53 +0900 (9720e0d) @@ -328,8 +328,7 @@ template class AllKeysCursor<uint32_t>; template class AllKeysCursor<uint64_t>; template class AllKeysCursor<double>; template class AllKeysCursor<GeoPoint>; -// TODO: To be enabled. -//template class AllKeysCursor<Bytes>; +template class AllKeysCursor<Bytes>; template class KeyIDRangeCursor<int8_t>; template class KeyIDRangeCursor<int16_t>; @@ -341,8 +340,7 @@ template class KeyIDRangeCursor<uint32_t>; template class KeyIDRangeCursor<uint64_t>; template class KeyIDRangeCursor<double>; template class KeyIDRangeCursor<GeoPoint>; -// TODO: To be enabled. -//template class KeyIDRangeCursor<Bytes>; +template class KeyIDRangeCursor<Bytes>; template class KeyRangeCursor<int8_t>; template class KeyRangeCursor<int16_t>; @@ -355,8 +353,7 @@ template class KeyRangeCursor<uint64_t>; template class KeyRangeCursor<double>; // GeoPoint does not support comparison operators (<, <=, >, >=). //template class KeyRangeCursor<GeoPoint>; -// TODO: To be enabled. -//template class KeyRangeCursor<Bytes>; +template class KeyRangeCursor<Bytes>; } // namespace map } // namespace grnxx Modified: lib/grnxx/map/helper.hpp (+7 -0) =================================================================== --- lib/grnxx/map/helper.hpp 2013-05-29 18:13:37 +0900 (a4a7984) +++ lib/grnxx/map/helper.hpp 2013-05-29 18:28:53 +0900 (e6d9fb5) @@ -26,6 +26,8 @@ #include <type_traits> #include "grnxx/array.hpp" +#include "grnxx/bytes.hpp" +#include "grnxx/map/bytes_array.hpp" #include "grnxx/traits.hpp" namespace grnxx { @@ -74,6 +76,11 @@ struct KeyArrayHelper<T, 4> { // Map<T> has at most 2^32 different keys. using Type = Array<T, 65536, 256, 256>; }; +template <> +struct KeyArrayHelper<Bytes> { + // Map<T> has at most 2^40 different keys. + using Type = BytesArray; +}; // Normalize a key. template <typename T, -------------- next part -------------- HTML����������������������������... ダウンロード