[Groonga-commit] groonga/grnxx at a9d07b8 [new_data_types] Add Column<Int>::read().

Back to archive index

susumu.yata null+****@clear*****
Thu Nov 6 22:55:55 JST 2014


susumu.yata	2014-11-06 22:55:55 +0900 (Thu, 06 Nov 2014)

  New Revision: a9d07b8f37ceb8bbb0d75138df36437d085fcfe2
  https://github.com/groonga/grnxx/commit/a9d07b8f37ceb8bbb0d75138df36437d085fcfe2

  Message:
    Add Column<Int>::read().

  Modified files:
    lib/grnxx/impl/column/scalar/int.cpp
    lib/grnxx/impl/column/scalar/int.hpp

  Modified: lib/grnxx/impl/column/scalar/int.cpp (+9 -0)
===================================================================
--- lib/grnxx/impl/column/scalar/int.cpp    2014-11-06 22:45:41 +0900 (7fd800b)
+++ lib/grnxx/impl/column/scalar/int.cpp    2014-11-06 22:55:55 +0900 (784892b)
@@ -233,6 +233,15 @@ void Column<Int>::unset(Int row_id) {
   }
 }
 
+void Column<Int>::read(ArrayCRef<Record> records, ArrayRef<Int> values) const {
+  if (records.size() != values.size()) {
+    throw "Data size conflict";  // TODO
+  }
+  for (size_t i = 0; i < records.size(); ++i) {
+    values.set(i, get(records[i].row_id));
+  }
+}
+
 //void Column<Int>::clear_references(Int row_id) {
 //  // TODO: Cursor should not be used to avoid errors.
 //  if (indexes_.size() != 0) {

  Modified: lib/grnxx/impl/column/scalar/int.hpp (+1 -1)
===================================================================
--- lib/grnxx/impl/column/scalar/int.hpp    2014-11-06 22:45:41 +0900 (d8cff6e)
+++ lib/grnxx/impl/column/scalar/int.hpp    2014-11-06 22:55:55 +0900 (d3323fc)
@@ -47,7 +47,7 @@ class Column<Int> : public ColumnBase {
   // Read values.
   //
   // On failure, throws an exception.
-  void read(ArrayCRef<Record> records, ArrayRef<Bool> values) const;
+  void read(ArrayCRef<Record> records, ArrayRef<Int> values) const;
 
  private:
   Array<Int> values_;
-------------- next part --------------
HTML����������������������������...
下載 



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