Changeset View
Changeset View
Standalone View
Standalone View
source/blender/functions/FN_generic_virtual_vector_array.hh
| Show First 20 Lines • Show All 94 Lines • ▼ Show 20 Lines | virtual void get_vector_element_impl(const int64_t index, | ||||
| void *r_value) const = 0; | void *r_value) const = 0; | ||||
| virtual bool is_single_vector_impl() const | virtual bool is_single_vector_impl() const | ||||
| { | { | ||||
| return false; | return false; | ||||
| } | } | ||||
| }; | }; | ||||
| class GVArrayForGVVectorArrayIndex : public GVArray { | class GVArray_For_GVVectorArrayIndex : public GVArray { | ||||
| private: | private: | ||||
| const GVVectorArray &vector_array_; | const GVVectorArray &vector_array_; | ||||
| const int64_t index_; | const int64_t index_; | ||||
| public: | public: | ||||
| GVArrayForGVVectorArrayIndex(const GVVectorArray &vector_array, const int64_t index) | GVArray_For_GVVectorArrayIndex(const GVVectorArray &vector_array, const int64_t index) | ||||
| : GVArray(vector_array.type(), vector_array.get_vector_size(index)), | : GVArray(vector_array.type(), vector_array.get_vector_size(index)), | ||||
| vector_array_(vector_array), | vector_array_(vector_array), | ||||
| index_(index) | index_(index) | ||||
| { | { | ||||
| } | } | ||||
| protected: | protected: | ||||
| void get_impl(const int64_t index_in_vector, void *r_value) const override; | void get_impl(const int64_t index_in_vector, void *r_value) const override; | ||||
| void get_to_uninitialized_impl(const int64_t index_in_vector, void *r_value) const override; | void get_to_uninitialized_impl(const int64_t index_in_vector, void *r_value) const override; | ||||
| }; | }; | ||||
| class GVVectorArrayForSingleGVArray : public GVVectorArray { | class GVVectorArray_For_SingleGVArray : public GVVectorArray { | ||||
| private: | private: | ||||
| const GVArray &array_; | const GVArray &array_; | ||||
| public: | public: | ||||
| GVVectorArrayForSingleGVArray(const GVArray &array, const int64_t size) | GVVectorArray_For_SingleGVArray(const GVArray &array, const int64_t size) | ||||
| : GVVectorArray(array.type(), size), array_(array) | : GVVectorArray(array.type(), size), array_(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; | ||||
| void get_vector_element_impl(const int64_t index, | void get_vector_element_impl(const int64_t index, | ||||
| const int64_t index_in_vector, | const int64_t index_in_vector, | ||||
| void *r_value) const override; | void *r_value) const override; | ||||
| bool is_single_vector_impl() const override; | bool is_single_vector_impl() const override; | ||||
| }; | }; | ||||
| class GVVectorArrayForSingleGSpan : public GVVectorArray { | class GVVectorArray_For_SingleGSpan : public GVVectorArray { | ||||
| private: | private: | ||||
| const GSpan span_; | const GSpan span_; | ||||
| public: | public: | ||||
| GVVectorArrayForSingleGSpan(const GSpan span, const int64_t size) | GVVectorArray_For_SingleGSpan(const GSpan span, const int64_t size) | ||||
| : GVVectorArray(span.type(), size), span_(span) | : GVVectorArray(span.type(), size), span_(span) | ||||
| { | { | ||||
| } | } | ||||
| protected: | protected: | ||||
| int64_t get_vector_size_impl(const int64_t UNUSED(index)) const override; | int64_t get_vector_size_impl(const int64_t UNUSED(index)) const override; | ||||
| void get_vector_element_impl(const int64_t UNUSED(index), | void get_vector_element_impl(const int64_t UNUSED(index), | ||||
| const int64_t index_in_vector, | const int64_t index_in_vector, | ||||
| void *r_value) const override; | void *r_value) const override; | ||||
| bool is_single_vector_impl() const override; | bool is_single_vector_impl() const override; | ||||
| }; | }; | ||||
| template<typename T> class VVectorArrayForGVVectorArray : public VVectorArray<T> { | template<typename T> class VVectorArray_For_GVVectorArray : public VVectorArray<T> { | ||||
| private: | private: | ||||
| const GVVectorArray &vector_array_; | const GVVectorArray &vector_array_; | ||||
| public: | public: | ||||
| VVectorArrayForGVVectorArray(const GVVectorArray &vector_array) | VVectorArray_For_GVVectorArray(const GVVectorArray &vector_array) | ||||
| : VVectorArray<T>(vector_array.size()), vector_array_(vector_array) | : VVectorArray<T>(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_.get_vector_size(index); | return vector_array_.get_vector_size(index); | ||||
| Show All 16 Lines | |||||