[Groonga-commit] groonga/grnxx [master] Change the order of arguments.

Back to archive index

susumu.yata null+****@clear*****
Fri Nov 30 10:35:11 JST 2012


susumu.yata	2012-11-30 10:35:11 +0900 (Fri, 30 Nov 2012)

  New Revision: 0ae5959f87246a09fe0d19d8e126acf5cb3e7305
  https://github.com/groonga/grnxx/commit/0ae5959f87246a09fe0d19d8e126acf5cb3e7305

  Log:
    Change the order of arguments.

  Modified files:
    lib/alpha/vector.hpp
    test/test_alpha_vector.cpp

  Modified: lib/alpha/vector.hpp (+3 -3)
===================================================================
--- lib/alpha/vector.hpp    2012-11-30 09:49:01 +0900 (14dbb95)
+++ lib/alpha/vector.hpp    2012-11-30 10:35:11 +0900 (2464150)
@@ -231,13 +231,13 @@ class Vector {
   typedef T Value;
 
   Vector() : impl_() {}
-  Vector(io::Pool pool, const VectorCreate &)
+  Vector(const VectorCreate &, io::Pool pool)
     : impl_(VectorImpl::create(pool, nullptr, sizeof(Value), PAGE_SIZE,
                                TABLE_SIZE, SECONDARY_TABLE_SIZE, fill_page)) {}
-  Vector(io::Pool pool, const VectorCreate &, const Value &default_value)
+  Vector(const VectorCreate &, io::Pool pool, const Value &default_value)
     : impl_(VectorImpl::create(pool, &default_value, sizeof(Value), PAGE_SIZE,
                                TABLE_SIZE, SECONDARY_TABLE_SIZE, fill_page)) {}
-  Vector(io::Pool pool, const VectorOpen &, uint32_t block_id)
+  Vector(const VectorOpen &, io::Pool pool, uint32_t block_id)
     : impl_(VectorImpl::open(pool, block_id, sizeof(Value), PAGE_SIZE,
                              TABLE_SIZE, SECONDARY_TABLE_SIZE, fill_page)) {}
   ~Vector() {}

  Modified: test/test_alpha_vector.cpp (+8 -8)
===================================================================
--- test/test_alpha_vector.cpp    2012-11-30 09:49:01 +0900 (a78773f)
+++ test/test_alpha_vector.cpp    2012-11-30 10:35:11 +0900 (dbb52f7)
@@ -35,7 +35,7 @@ void test_basics() {
   grnxx::io::Pool pool("temp.grn", grnxx::io::GRNXX_IO_CREATE);
 
   grnxx::alpha::Vector<std::uint32_t> vector(
-      pool, grnxx::alpha::VECTOR_CREATE);
+      grnxx::alpha::VECTOR_CREATE, pool);
 
   assert(vector.block_id() == 0);
   assert(vector.value_size() == sizeof(std::uint32_t));
@@ -75,7 +75,7 @@ void test_basics() {
   pool = grnxx::io::Pool("temp.grn", grnxx::io::GRNXX_IO_OPEN);
 
   vector = grnxx::alpha::Vector<std::uint32_t>(
-      pool, grnxx::alpha::VECTOR_OPEN, block_id);
+      grnxx::alpha::VECTOR_OPEN, pool, block_id);
 
   assert(vector[0] == 1);
   assert(vector[1000] == 10);
@@ -91,7 +91,7 @@ void test_basics() {
   assert(vector[0] == 12);
 
   vector = grnxx::alpha::Vector<std::uint32_t>(
-      pool, grnxx::alpha::VECTOR_CREATE, 56789);
+      grnxx::alpha::VECTOR_CREATE, pool, 56789);
 
   assert(vector[0] == 56789);
   assert(vector[1000] == 56789);
@@ -112,7 +112,7 @@ void test_basics() {
 
   grnxx::alpha::Vector<std::uint32_t>::unlink(pool, 0);
 
-  grnxx::alpha::Vector<float> float_vector(pool, grnxx::alpha::VECTOR_CREATE);
+  grnxx::alpha::Vector<float> float_vector(grnxx::alpha::VECTOR_CREATE, pool);
 
   float_vector[0] = 1.0F;
   assert(float_vector[0] == 1.0F);
@@ -122,7 +122,7 @@ void test_basics() {
   float_vector = grnxx::alpha::Vector<float>();
 
   grnxx::alpha::Vector<double> double_vector(
-      pool, grnxx::alpha::VECTOR_CREATE);
+      grnxx::alpha::VECTOR_CREATE, pool);
 
   double_vector[0] = 1.0;
   assert(double_vector[0] == 1.0);
@@ -131,7 +131,7 @@ void test_basics() {
 
   double_vector = grnxx::alpha::Vector<double>();
 
-  grnxx::alpha::Vector<Point> point_vector(pool, grnxx::alpha::VECTOR_CREATE);
+  grnxx::alpha::Vector<Point> point_vector(grnxx::alpha::VECTOR_CREATE, pool);
 
   point_vector[0].x = 123;
   point_vector[0].y = 456;
@@ -155,7 +155,7 @@ void test_times() {
 
   grnxx::io::Pool pool("temp.grn", grnxx::io::GRNXX_IO_TEMPORARY);
 
-  grnxx::alpha::Vector<T> vector(pool, grnxx::alpha::VECTOR_CREATE);
+  grnxx::alpha::Vector<T> vector(grnxx::alpha::VECTOR_CREATE, pool);
 
   grnxx::Time start, end;
 
@@ -252,7 +252,7 @@ void test_times() {
   end = grnxx::Time::now();
   grnxx::Duration unlink_elapsed = end - start;
 
-  vector = grnxx::alpha::Vector<T>(pool, grnxx::alpha::VECTOR_CREATE, 0);
+  vector = grnxx::alpha::Vector<T>(grnxx::alpha::VECTOR_CREATE, pool, 0);
 
   start = grnxx::Time::now();
   for (std::uint64_t id = 0; id < VECTOR_SIZE; ++id) {
-------------- next part --------------
HTML����������������������������...
Descargar 



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