susumu.yata
null+****@clear*****
Tue Dec 16 10:53:58 JST 2014
susumu.yata 2014-11-25 18:31:40 +0900 (Tue, 25 Nov 2014) New Revision: 7c4f4b1afeb633654a419405c5214f85a9770864 https://github.com/groonga/grnxx/commit/7c4f4b1afeb633654a419405c5214f85a9770864 Message: Rename Vector<T>::data() to raw_data(). (#116) Modified files: include/grnxx/data_types/vector/bool.hpp include/grnxx/data_types/vector/float.hpp include/grnxx/data_types/vector/geo_point.hpp include/grnxx/data_types/vector/int.hpp lib/grnxx/impl/column/vector/bool.cpp lib/grnxx/impl/column/vector/float.cpp lib/grnxx/impl/column/vector/geo_point.cpp lib/grnxx/impl/column/vector/int.cpp Modified: include/grnxx/data_types/vector/bool.hpp (+1 -1) =================================================================== --- include/grnxx/data_types/vector/bool.hpp 2014-11-25 18:23:17 +0900 (e7ce613) +++ include/grnxx/data_types/vector/bool.hpp 2014-11-25 18:31:40 +0900 (30453bc) @@ -31,7 +31,7 @@ class Vector<Bool> { const Bool &operator[](size_t i) const { return data_[i]; } - constexpr const Bool *data() const { + constexpr const Bool *raw_data() const { return data_; } constexpr Int size() const { Modified: include/grnxx/data_types/vector/float.hpp (+1 -1) =================================================================== --- include/grnxx/data_types/vector/float.hpp 2014-11-25 18:23:17 +0900 (2821b7a) +++ include/grnxx/data_types/vector/float.hpp 2014-11-25 18:31:40 +0900 (88a1114) @@ -33,7 +33,7 @@ class Vector<Float> { const Float &operator[](size_t i) const { return data_[i]; } - constexpr const Float *data() const { + constexpr const Float *raw_data() const { return data_; } constexpr Int size() const { Modified: include/grnxx/data_types/vector/geo_point.hpp (+1 -1) =================================================================== --- include/grnxx/data_types/vector/geo_point.hpp 2014-11-25 18:23:17 +0900 (a738115) +++ include/grnxx/data_types/vector/geo_point.hpp 2014-11-25 18:31:40 +0900 (fc55ae7) @@ -33,7 +33,7 @@ class Vector<GeoPoint> { const GeoPoint &operator[](size_t i) const { return data_[i]; } - constexpr const GeoPoint *data() const { + constexpr const GeoPoint *raw_data() const { return data_; } constexpr Int size() const { Modified: include/grnxx/data_types/vector/int.hpp (+1 -1) =================================================================== --- include/grnxx/data_types/vector/int.hpp 2014-11-25 18:23:17 +0900 (4570c1c) +++ include/grnxx/data_types/vector/int.hpp 2014-11-25 18:31:40 +0900 (164c191) @@ -31,7 +31,7 @@ class Vector<Int> { const Int &operator[](size_t i) const { return data_[i]; } - constexpr const Int *data() const { + constexpr const Int *raw_data() const { return data_; } constexpr Int size() const { Modified: lib/grnxx/impl/column/vector/bool.cpp (+3 -2) =================================================================== --- lib/grnxx/impl/column/vector/bool.cpp 2014-11-25 18:23:17 +0900 (dd9f156) +++ lib/grnxx/impl/column/vector/bool.cpp 2014-11-25 18:31:40 +0900 (578bedc) @@ -56,7 +56,7 @@ void Column<Vector<Bool>>::set(Int row_id, const Datum &datum) { uint64_t header; if (size < 0xFFFF) { bodies_.resize(offset + size); - std::memcpy(&bodies_[offset], new_value.data(), size); + std::memcpy(&bodies_[offset], new_value.raw_data(), size); header = (offset << 16) | size; } else { // The size of a long vector is stored in front of the body. @@ -65,7 +65,8 @@ void Column<Vector<Bool>>::set(Int row_id, const Datum &datum) { } bodies_.resize(offset + sizeof(uint64_t) + size); *reinterpret_cast<uint64_t *>(&bodies_[offset]) = size; - std::memcpy(&bodies_[offset + sizeof(uint64_t)], new_value.data(), size); + std::memcpy(&bodies_[offset + sizeof(uint64_t)], + new_value.raw_data(), size); header = (offset << 16) | 0xFFFF; } headers_[value_id] = header; Modified: lib/grnxx/impl/column/vector/float.cpp (+2 -2) =================================================================== --- lib/grnxx/impl/column/vector/float.cpp 2014-11-25 18:23:17 +0900 (1dbc067) +++ lib/grnxx/impl/column/vector/float.cpp 2014-11-25 18:31:40 +0900 (3f4eeee) @@ -56,7 +56,7 @@ void Column<Vector<Float>>::set(Int row_id, const Datum &datum) { uint64_t header; if (size < 0xFFFF) { bodies_.resize(offset + size); - std::memcpy(&bodies_[offset], new_value.data(), sizeof(Float) * size); + std::memcpy(&bodies_[offset], new_value.raw_data(), sizeof(Float) * size); header = (offset << 16) | size; } else { // The size of a long vector is stored in front of the body. @@ -66,7 +66,7 @@ void Column<Vector<Float>>::set(Int row_id, const Datum &datum) { bodies_.resize(offset + sizeof(uint64_t) + size); *reinterpret_cast<uint64_t *>(&bodies_[offset]) = size; std::memcpy(&bodies_[offset + sizeof(uint64_t)], - new_value.data(), sizeof(Float) * size); + new_value.raw_data(), sizeof(Float) * size); header = (offset << 16) | 0xFFFF; } headers_[value_id] = header; Modified: lib/grnxx/impl/column/vector/geo_point.cpp (+3 -2) =================================================================== --- lib/grnxx/impl/column/vector/geo_point.cpp 2014-11-25 18:23:17 +0900 (dc5d9cb) +++ lib/grnxx/impl/column/vector/geo_point.cpp 2014-11-25 18:31:40 +0900 (e57bd27) @@ -56,7 +56,8 @@ void Column<Vector<GeoPoint>>::set(Int row_id, const Datum &datum) { uint64_t header; if (size < 0xFFFF) { bodies_.resize(offset + size); - std::memcpy(&bodies_[offset], new_value.data(), sizeof(GeoPoint) * size); + std::memcpy(&bodies_[offset], new_value.raw_data(), + sizeof(GeoPoint) * size); header = (offset << 16) | size; } else { // The size of a long vector is stored in front of the body. @@ -66,7 +67,7 @@ void Column<Vector<GeoPoint>>::set(Int row_id, const Datum &datum) { bodies_.resize(offset + sizeof(uint64_t) + size); *reinterpret_cast<uint64_t *>(&bodies_[offset]) = size; std::memcpy(&bodies_[offset + sizeof(uint64_t)], - new_value.data(), sizeof(GeoPoint) * size); + new_value.raw_data(), sizeof(GeoPoint) * size); header = (offset << 16) | 0xFFFF; } headers_[value_id] = header; Modified: lib/grnxx/impl/column/vector/int.cpp (+2 -2) =================================================================== --- lib/grnxx/impl/column/vector/int.cpp 2014-11-25 18:23:17 +0900 (b5f810a) +++ lib/grnxx/impl/column/vector/int.cpp 2014-11-25 18:31:40 +0900 (047672f) @@ -71,7 +71,7 @@ void Column<Vector<Int>>::set(Int row_id, const Datum &datum) { uint64_t header; if (size < 0xFFFF) { bodies_.resize(offset + size); - std::memcpy(&bodies_[offset], new_value.data(), sizeof(Int) * size); + std::memcpy(&bodies_[offset], new_value.raw_data(), sizeof(Int) * size); header = (offset << 16) | size; } else { // The size of a long vector is stored in front of the body. @@ -81,7 +81,7 @@ void Column<Vector<Int>>::set(Int row_id, const Datum &datum) { bodies_.resize(offset + sizeof(uint64_t) + size); *reinterpret_cast<uint64_t *>(&bodies_[offset]) = size; std::memcpy(&bodies_[offset + sizeof(uint64_t)], - new_value.data(), sizeof(Int) * size); + new_value.raw_data(), sizeof(Int) * size); header = (offset << 16) | 0xFFFF; } headers_[value_id] = header; -------------- next part -------------- HTML����������������������������...Download