[Groonga-commit] groonga/grnxx at ec1bb19 [master] Inline Table member functions.

Back to archive index

susumu.yata null+****@clear*****
Mon Oct 6 22:24:31 JST 2014


susumu.yata	2014-10-06 22:24:31 +0900 (Mon, 06 Oct 2014)

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

  Message:
    Inline Table member functions.

  Modified files:
    lib/grnxx/impl/table.cpp
    lib/grnxx/impl/table.hpp

  Modified: lib/grnxx/impl/table.cpp (+0 -24)
===================================================================
--- lib/grnxx/impl/table.cpp    2014-10-06 22:23:47 +0900 (54d133b)
+++ lib/grnxx/impl/table.cpp    2014-10-06 22:24:31 +0900 (2ec873b)
@@ -229,26 +229,6 @@ grnxx::DB *Table::db() const {
   return db_;
 }
 
-StringCRef Table::name() const {
-  return name_.ref();
-}
-
-Int Table::num_columns() const {
-  return columns_.size();
-}
-
-Column *Table::key_column() const {
-  return key_column_;
-}
-
-Int Table::num_rows() const {
-  return num_rows_;
-}
-
-Int Table::max_row_id() const {
-  return max_row_id_;
-}
-
 Column *Table::create_column(Error *error,
                              const StringCRef &name,
                              DataType data_type,
@@ -340,10 +320,6 @@ bool Table::reorder_column(Error *error,
   return true;
 }
 
-Column *Table::get_column(Int column_id) const {
-  return columns_[column_id].get();
-}
-
 Column *Table::find_column(Error *error, const StringCRef &name) const {
   for (Int column_id = 0; column_id < num_columns(); ++column_id) {
     if (name == columns_[column_id]->name()) {

  Modified: lib/grnxx/impl/table.hpp (+18 -6)
===================================================================
--- lib/grnxx/impl/table.hpp    2014-10-06 22:23:47 +0900 (5d33d53)
+++ lib/grnxx/impl/table.hpp    2014-10-06 22:24:31 +0900 (2d90117)
@@ -17,11 +17,21 @@ class Table : public grnxx::Table {
   ~Table();
 
   grnxx::DB *db() const;
-  StringCRef name() const;
-  Int num_columns() const;
-  Column *key_column() const;
-  Int num_rows() const;
-  Int max_row_id() const;
+  StringCRef name() const {
+    return name_.ref();
+  }
+  Int num_columns() const {
+    return columns_.size();
+  }
+  Column *key_column() const {
+    return key_column_;
+  }
+  Int num_rows() const {
+    return num_rows_;
+  }
+  Int max_row_id() const {
+    return max_row_id_;
+  }
 
   Column *create_column(Error *error,
                         const StringCRef &name,
@@ -35,7 +45,9 @@ class Table : public grnxx::Table {
                       const StringCRef &name,
                       const StringCRef &prev_name);
 
-  Column *get_column(Int column_id) const;
+  Column *get_column(Int column_id) const {
+    return columns_[column_id].get();
+  }
   Column *find_column(Error *error, const StringCRef &name) const;
 
   bool set_key_column(Error *error, const StringCRef &name);
-------------- next part --------------
HTML����������������������������...
Download 



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