[Groonga-commit] groonga/grnxx at 44d3841 [master] Add TypeTraits for Time, GeoPoint, and Text.

Back to archive index

susumu.yata null+****@clear*****
Mon Jul 14 18:24:36 JST 2014


susumu.yata	2014-07-14 18:24:36 +0900 (Mon, 14 Jul 2014)

  New Revision: 44d384116a3be0a5bbaee6ee6ce689401452d525
  https://github.com/groonga/grnxx/commit/44d384116a3be0a5bbaee6ee6ce689401452d525

  Message:
    Add TypeTraits for Time, GeoPoint, and Text.

  Modified files:
    include/grnxx/types.hpp

  Modified: include/grnxx/types.hpp (+24 -0)
===================================================================
--- include/grnxx/types.hpp    2014-07-14 18:20:31 +0900 (3babc6b)
+++ include/grnxx/types.hpp    2014-07-14 18:24:36 +0900 (cc95943)
@@ -320,6 +320,30 @@ template <> struct TypeTraits <Float> {
     return 0.0;
   }
 };
+template <> struct TypeTraits <Time> {
+  static DataType data_type() {
+    return TIME_DATA;
+  }
+  static Time default_value() {
+    return Time(0);
+  }
+};
+template <> struct TypeTraits <GeoPoint> {
+  static DataType data_type() {
+    return GEO_POINT_DATA;
+  }
+  static GeoPoint default_value() {
+    return GeoPoint(0, 0);
+  }
+};
+template <> struct TypeTraits <Text> {
+  static DataType data_type() {
+    return TEXT_DATA;
+  }
+  static Text default_value() {
+    return Text("", 0);
+  }
+};
 
 // Zero is reserved for representing a null reference.
 constexpr Int NULL_ROW_ID = 0;
-------------- next part --------------
HTML����������������������������...
Download 



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