susumu.yata
null+****@clear*****
Mon Jul 14 01:48:25 JST 2014
susumu.yata 2014-07-14 01:48:25 +0900 (Mon, 14 Jul 2014) New Revision: 7c14090ec8b4e6ba5f7ba7637259525226e49aa4 https://github.com/groonga/grnxx/commit/7c14090ec8b4e6ba5f7ba7637259525226e49aa4 Message: Add comments. Modified files: include/grnxx/expression.hpp lib/grnxx/expression.cpp Modified: include/grnxx/expression.hpp (+1 -1) =================================================================== --- include/grnxx/expression.hpp 2014-07-11 17:15:23 +0900 (9a114c6) +++ include/grnxx/expression.hpp 2014-07-14 01:48:25 +0900 (ed71605) @@ -35,7 +35,7 @@ class Expression { // Return the result data type. DataType data_type() const; - // Filter records. + // Filter out false records. // // Evaluates the expression for the given record set and removes records // whose evaluation results are false. Modified: lib/grnxx/expression.cpp (+19 -1) =================================================================== --- lib/grnxx/expression.cpp 2014-07-11 17:15:23 +0900 (be5b631) +++ lib/grnxx/expression.cpp 2014-07-14 01:48:25 +0900 (a00a5fc) @@ -21,14 +21,32 @@ class ExpressionNode { ExpressionNode() {} virtual ~ExpressionNode() {} + // Return the node type. virtual ExpressionNodeType node_type() const = 0; + // Return the result data type. virtual DataType data_type() const = 0; + // Filter out false records. + // + // Evaluates the expression for the given record set and removes records + // whose evaluation results are false. + // + // Returns true on success. + // On failure, returns false and stores error information into "*error" if + // "error" != nullptr. virtual bool filter(Error *error, RecordSet *record_set) { - // TODO: Set an "This type is not supported" error. + // TODO: Define "This type is not supported" error. GRNXX_ERROR_SET(error, NOT_SUPPORTED_YET, "Not supported yet"); return false; } + + // Evaluate the expression subtree. + // + // The evaluation results are stored into each expression node. + // + // Returns true on success. + // On failure, returns false and stores error information into "*error" if + // "error" != nullptr. virtual bool evaluate(Error *error, const RecordSet &record_set) { // TODO: This should be a pure virtual function. GRNXX_ERROR_SET(error, NOT_SUPPORTED_YET, "Not supported yet"); -------------- next part -------------- HTML����������������������������... 下載