26 class GVMutableArrayImpl;
42 virtual void get(
int64_t index,
void *r_value)
const;
112 template<
typename ImplT,
typename... Args>
void emplace(Args &&...args);
121 operator bool()
const;
195 template<
typename ImplT,
typename... Args>
static GVArray For(Args &&...args);
227 template<
typename ImplT,
typename... Args>
static GVMutableArray For(Args &&...args);
245 void fill(const
void *value);
267 void *owned_data_ =
nullptr;
281 void *owned_data_ =
nullptr;
282 bool save_has_been_called_ =
false;
283 bool show_not_saved_warning_ =
true;
295 void disable_not_applied_warning();
318 *(
T *)r_value = varray_[index];
323 new (r_value)
T(varray_[index]);
374 varray_.
get(index, &value);
425 *(
T *)r_value = varray_[index];
430 new (r_value)
T(varray_[index]);
440 const T &value_ = *(
const T *)value;
441 varray_.
set(index, value_);
446 T &value_ = *(
T *)value;
447 varray_.
set(index, std::move(value_));
453 T &value_ = *(
T *)value;
454 varray_.
set(index, std::move(value_));
512 varray_.
get(index, &value);
516 void set(
const int64_t index,
T value)
override
526 bool try_assign_GVArray(GVArray &varray)
const override
532 bool try_assign_GVMutableArray(
GVMutableArray &varray)
const override
554 MutableSpan<T> r_span)
const override
586 void get(
int64_t index,
void *r_value)
const override;
600 void *dst)
const override;
621 const void *value_ =
nullptr;
634 void get(
const int64_t index,
void *r_value)
const override;
723 static_assert(std::is_base_of_v<GVArrayImpl, ImplT>);
724 if constexpr (std::is_copy_constructible_v<ImplT> && Storage::template is_inline_v<ImplT>) {
725 impl_ = &
storage_.template emplace<ImplT>(std::forward<Args>(args)...);
728 std::shared_ptr<const GVArrayImpl>
ptr = std::make_shared<ImplT>(std::forward<Args>(args)...);
772 inline GVArrayCommon::operator
bool()
const
774 return impl_ !=
nullptr;
784 if (
impl_ ==
nullptr) {
792 return this->
size() == 0;
806 this->emplace<GVArrayImpl_For_GSpan_final>(mutable_span);
814 this->emplace<GVArrayImpl_For_SingleValueRef_final>(
type,
size, value);
820 static_assert(std::is_base_of_v<GVArrayImpl, StorageT> ||
823 if constexpr (std::is_base_of_v<GVArrayImpl, StorageT>) {
824 return {[](
const void *
buffer) {
828 else if constexpr (std::is_same_v<StorageT, const GVArrayImpl *>) {
829 return {[](
const void *
buffer) {
return *(
const StorageT *)
buffer; }};
831 else if constexpr (std::is_same_v<StorageT, std::shared_ptr<const GVArrayImpl>>) {
832 return {[](
const void *
buffer) {
return ((
const StorageT *)
buffer)->
get(); }};
843 static_assert(std::is_base_of_v<GVArrayImpl, ImplT>);
845 varray.template emplace<ImplT>(std::forward<Args>(args)...);
868 *
this = GVArray::For<GVArrayImpl_For_VArray<T>>(varray);
899 template<
typename ImplT,
typename... Args>
902 static_assert(std::is_base_of_v<GVMutableArrayImpl, ImplT>);
904 varray.
emplace<ImplT>(std::forward<Args>(args)...);
922 *
this = GVMutableArray::For<GVMutableArrayImpl_For_VMutableArray<T>>(varray);
#define BLI_assert_unreachable()
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
const void * data() const
const CPPType & type() const
CommonVArrayInfo common_info() const
bool may_have_ownership() const
void emplace(Args &&...args)
GSpan get_internal_span() const
const GVArrayImpl * impl_from_storage() const
bool try_assign_VArray(VArray< T > &varray) const
void copy_from(const GVArrayCommon &other)
const CPPType & type() const
void move_from(GVArrayCommon &&other) noexcept
void get_to_uninitialized(int64_t index, void *r_value) const
void materialize(void *dst) const
void get_internal_single_to_uninitialized(void *r_value) const
void materialize_to_uninitialized(void *dst) const
void get(int64_t index, void *r_value) const
IndexRange index_range() const
const GVArrayImpl * impl_
void materialize_compressed_to_uninitialized(IndexMask mask, void *dst) const
void materialize_compressed(IndexMask mask, void *dst) const
void get_internal_single(void *r_value) const
GVArrayImpl_For_GSpan(const CPPType &type, int64_t size)
const int64_t element_size_
GVArrayImpl_For_GSpan(const GMutableSpan span)
GVArrayImpl_For_SingleValueRef(const CPPType &type, const int64_t size, const void *value)
GVArrayImpl_For_SingleValueRef(const CPPType &type, const int64_t size)
bool try_assign_VArray(void *varray) const override
void materialize_compressed(const IndexMask mask, void *dst) const override
GVArrayImpl_For_VArray(VArray< T > varray)
void materialize_to_uninitialized(const IndexMask mask, void *dst) const override
void get(const int64_t index, void *r_value) const override
void get_to_uninitialized(const int64_t index, void *r_value) const override
CommonVArrayInfo common_info() const override
void materialize(const IndexMask mask, void *dst) const override
void materialize_compressed_to_uninitialized(const IndexMask mask, void *dst) const override
virtual void materialize_compressed_to_uninitialized(IndexMask mask, void *dst) const
virtual void get_to_uninitialized(int64_t index, void *r_value) const =0
virtual void materialize_compressed(IndexMask mask, void *dst) const
virtual void materialize(const IndexMask mask, void *dst) const
virtual void materialize_to_uninitialized(const IndexMask mask, void *dst) const
virtual void get(int64_t index, void *r_value) const
virtual bool try_assign_VArray(void *varray) const
GVArrayImpl(const CPPType &type, int64_t size)
virtual CommonVArrayInfo common_info() const
const CPPType & type() const
virtual ~GVArrayImpl()=default
GVArray slice(IndexRange slice) const
static GVArray ForEmpty(const CPPType &type)
static GVArray ForGArray(GArray<> array)
static GVArray ForSingleDefault(const CPPType &type, int64_t size)
const GVArrayImpl * get_implementation() const
GVArray & operator=(const GVArray &other)
static GVArray For(Args &&...args)
GVArray(const GVArray &other)
GVArray(GVArray &&other) noexcept
static GVArray ForSingleRef(const CPPType &type, int64_t size, const void *value)
static GVArray ForSpan(GSpan span)
static GVArray ForSingle(const CPPType &type, int64_t size, const void *value)
VArray< T > typed() const
void materialize_to_uninitialized(const IndexMask mask, void *dst) const override
GVMutableArrayImpl_For_VMutableArray(VMutableArray< T > varray)
void set_by_copy(const int64_t index, const void *value) override
bool try_assign_VMutableArray(void *varray) const override
VMutableArray< T > varray_
void materialize_compressed(const IndexMask mask, void *dst) const override
CommonVArrayInfo common_info() const override
void materialize_compressed_to_uninitialized(const IndexMask mask, void *dst) const override
void get(const int64_t index, void *r_value) const override
bool try_assign_VArray(void *varray) const override
void get_to_uninitialized(const int64_t index, void *r_value) const override
void set_by_relocate(const int64_t index, void *value) override
void set_by_move(const int64_t index, void *value) override
void materialize(const IndexMask mask, void *dst) const override
void set_all(const void *src) override
virtual bool try_assign_VMutableArray(void *varray) const
virtual void set_all(const void *src)
virtual void set_by_copy(int64_t index, const void *value)
GVMutableArrayImpl(const CPPType &type, int64_t size)
virtual void set_by_relocate(int64_t index, void *value)
virtual void set_by_move(int64_t index, void *value)=0
GVMutableArray(GVMutableArray &&other) noexcept
void set_by_move(int64_t index, void *value)
void set_all(const void *src)
void set_by_copy(int64_t index, const void *value)
GVMutableArray(const GVMutableArray &other)
GVMutableArrayImpl * get_implementation() const
GMutableSpan get_internal_span() const
bool try_assign_VMutableArray(VMutableArray< T > &varray) const
GVMutableArray & operator=(const GVMutableArray &other)
void fill(const void *value)
VMutableArray< T > typed() const
static GVMutableArray ForSpan(GMutableSpan span)
static GVMutableArray For(Args &&...args)
void set_by_relocate(int64_t index, void *value)
constexpr T * data() const
void materialize(MutableSpan< T > r_span) const
void materialize_compressed(IndexMask mask, MutableSpan< T > r_span) const
void materialize_compressed_to_uninitialized(IndexMask mask, MutableSpan< T > r_span) const
bool try_assign_GVArray(GVArray &varray) const
void materialize_to_uninitialized(MutableSpan< T > r_span) const
CommonVArrayInfo common_info() const
void materialize(IndexMask mask, MutableSpan< T > r_span) const override
void materialize_to_uninitialized(IndexMask mask, MutableSpan< T > r_span) const override
void materialize_compressed_to_uninitialized(IndexMask mask, MutableSpan< T > r_span) const override
bool try_assign_GVArray(GVArray &varray) const override
VArrayImpl_For_GVArray(GVArray varray)
CommonVArrayInfo common_info() const override
void materialize_compressed(IndexMask mask, MutableSpan< T > r_span) const override
T get(const int64_t index) const override
static VArray ForSingle(T value, const int64_t size)
static VArray ForSpan(Span< T > values)
VMutableArrayImpl_For_GVMutableArray(GVMutableArray varray)
void set(const int64_t index, T value)
static VMutableArray ForSpan(MutableSpan< T > values)
bool try_assign_GVMutableArray(GVMutableArray &varray) const
void set_all(Span< T > src)
SyclQueue void void * src
ccl_global float * buffer
ccl_device_inline float4 mask(const int4 &mask, const float4 &a)
constexpr bool is_same_any_v
constexpr bool is_trivial_extended_v< GVArrayImpl_For_GSpan_final >
constexpr bool is_trivial_extended_v< GVArrayImpl_For_SingleValueRef_final >