[Groonga-commit] groonga/grnxx at 86e69f5 [master] Enable operations for Float, Time, and GeoPoint.

Back to archive index

susumu.yata null+****@clear*****
Mon Jul 14 18:27:19 JST 2014


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

  New Revision: 86e69f558aa5a7a97da5a9356fe686607dca12be
  https://github.com/groonga/grnxx/commit/86e69f558aa5a7a97da5a9356fe686607dca12be

  Message:
    Enable operations for Float, Time, and GeoPoint.

  Modified files:
    lib/grnxx/expression.cpp

  Modified: lib/grnxx/expression.cpp (+54 -0)
===================================================================
--- lib/grnxx/expression.cpp    2014-07-14 18:25:39 +0900 (3d8ab70)
+++ lib/grnxx/expression.cpp    2014-07-14 18:27:19 +0900 (b133155)
@@ -415,6 +415,18 @@ bool ExpressionBuilder::push_datum(Error *error, const Datum &datum) {
       node.reset(new (nothrow) DatumNode<Int>(datum.force_int()));
       break;
     }
+    case FLOAT_DATA: {
+      node.reset(new (nothrow) DatumNode<Float>(datum.force_float()));
+      break;
+    }
+    case TIME_DATA: {
+      node.reset(new (nothrow) DatumNode<Time>(datum.force_time()));
+      break;
+    }
+    case GEO_POINT_DATA: {
+      node.reset(new (nothrow) DatumNode<GeoPoint>(datum.force_geo_point()));
+      break;
+    }
     default: {
       // TODO: Other types are not supported yet.
       GRNXX_ERROR_SET(error, NOT_SUPPORTED_YET, "Not supported yet");
@@ -456,6 +468,18 @@ bool ExpressionBuilder::push_column(Error *error, String name) {
         node.reset(new (nothrow) ColumnNode<Int>(column));
         break;
       }
+      case FLOAT_DATA: {
+        node.reset(new (nothrow) ColumnNode<Float>(column));
+        break;
+      }
+      case TIME_DATA: {
+        node.reset(new (nothrow) ColumnNode<Time>(column));
+        break;
+      }
+      case GEO_POINT_DATA: {
+        node.reset(new (nothrow) ColumnNode<GeoPoint>(column));
+        break;
+      }
       default: {
         // TODO: Not supported yet.
         GRNXX_ERROR_SET(error, NOT_SUPPORTED_YET, "Not supported yet");
@@ -578,6 +602,24 @@ bool ExpressionBuilder::push_equality_operator(Error *error) {
           functor, std::move(lhs), std::move(rhs)));
       break;
     }
+    case FLOAT_DATA: {
+      typename T::template Functor<Float> functor;
+      node.reset(new (nothrow) BinaryNode<decltype(functor)>(
+          functor, std::move(lhs), std::move(rhs)));
+      break;
+    }
+    case TIME_DATA: {
+      typename T::template Functor<Time> functor;
+      node.reset(new (nothrow) BinaryNode<decltype(functor)>(
+          functor, std::move(lhs), std::move(rhs)));
+      break;
+    }
+    case GEO_POINT_DATA: {
+      typename T::template Functor<GeoPoint> functor;
+      node.reset(new (nothrow) BinaryNode<decltype(functor)>(
+          functor, std::move(lhs), std::move(rhs)));
+      break;
+    }
     // TODO: Support other types.
     default: {
       GRNXX_ERROR_SET(error, NOT_SUPPORTED_YET, "Not supported yet");
@@ -615,6 +657,18 @@ bool ExpressionBuilder::push_comparison_operator(Error *error) {
           functor, std::move(lhs), std::move(rhs)));
       break;
     }
+    case FLOAT_DATA: {
+      typename T::template Functor<Float> functor;
+      node.reset(new (nothrow) BinaryNode<decltype(functor)>(
+          functor, std::move(lhs), std::move(rhs)));
+      break;
+    }
+    case TIME_DATA: {
+      typename T::template Functor<Time> functor;
+      node.reset(new (nothrow) BinaryNode<decltype(functor)>(
+          functor, std::move(lhs), std::move(rhs)));
+      break;
+    }
     // TODO: Support other comparable types.
     default: {
       GRNXX_ERROR_SET(error, NOT_SUPPORTED_YET, "Not supported yet");
-------------- next part --------------
HTML����������������������������...
下载 



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