Changeset View
Changeset View
Standalone View
Standalone View
source/blender/functions/FN_generic_vector_array.hh
| Show First 20 Lines • Show All 117 Lines • ▼ Show 20 Lines | public: | ||||
| void extend(const int64_t index, const Span<T> values) | void extend(const int64_t index, const Span<T> values) | ||||
| { | { | ||||
| vector_array_->extend(index, values); | vector_array_->extend(index, values); | ||||
| } | } | ||||
| void extend(const int64_t index, const VArray<T> &values) | void extend(const int64_t index, const VArray<T> &values) | ||||
| { | { | ||||
| GVArrayForVArray<T> array{values}; | GVArray_For_VArray<T> array{values}; | ||||
| this->extend(index, array); | this->extend(index, array); | ||||
| } | } | ||||
| MutableSpan<T> operator[](const int64_t index) | MutableSpan<T> operator[](const int64_t index) | ||||
| { | { | ||||
| return (*vector_array_)[index].typed<T>(); | return (*vector_array_)[index].typed<T>(); | ||||
| } | } | ||||
| }; | }; | ||||
| /* A generic virtual vector array implementation for a `GVectorArray`. */ | /* A generic virtual vector array implementation for a `GVectorArray`. */ | ||||
| class GVVectorArrayForGVectorArray : public GVVectorArray { | class GVVectorArray_For_GVectorArray : public GVVectorArray { | ||||
| private: | private: | ||||
| const GVectorArray &vector_array_; | const GVectorArray &vector_array_; | ||||
| public: | public: | ||||
| GVVectorArrayForGVectorArray(const GVectorArray &vector_array) | GVVectorArray_For_GVectorArray(const GVectorArray &vector_array) | ||||
| : GVVectorArray(vector_array.type(), vector_array.size()), vector_array_(vector_array) | : GVVectorArray(vector_array.type(), vector_array.size()), vector_array_(vector_array) | ||||
| { | { | ||||
| } | } | ||||
| protected: | protected: | ||||
| int64_t get_vector_size_impl(const int64_t index) const override | int64_t get_vector_size_impl(const int64_t index) const override | ||||
| { | { | ||||
| return vector_array_[index].size(); | return vector_array_[index].size(); | ||||
| Show All 11 Lines | |||||