23 this->
get(
i, elem_dst);
39 this->
get(i, elem_dst);
53 type_->destruct(r_value);
76 type_->copy_construct(value, buffer);
78 type_->destruct(buffer);
84 type_->destruct(value);
268 type.copy_construct(value, &buffer_);
272 void get(
const int64_t index,
void *r_value)
const final
274 this->get_to_uninitialized(index, r_value);
276 void get_to_uninitialized(
const int64_t ,
void *r_value)
const final
281 void materialize(
const IndexMask &
mask,
void *dst)
const final
283 this->materialize_to_uninitialized(
mask, dst);
285 void materialize_to_uninitialized(
const IndexMask &
mask,
void *dst)
const final
287 type_->fill_construct_indices(buffer_, dst,
mask);
289 void materialize_compressed(
const IndexMask &
mask,
void *dst)
const final
291 this->materialize_compressed_to_uninitialized(
mask, dst);
293 void materialize_compressed_to_uninitialized(
const IndexMask &
mask,
void *dst)
const final
295 type_->fill_construct_n(buffer_, dst,
mask.size());
319 size_ = varray_.size();
325 owned_data_ = MEM_mallocN_aligned(type_->size * size_, type_->alignment, __func__);
326 varray_.materialize_to_uninitialized(IndexRange(size_), owned_data_);
332 :
GSpan(other.
type_ptr()), varray_(std::move(other.varray_)), owned_data_(other.owned_data_)
338 size_ = varray_.size();
346 other.owned_data_ =
nullptr;
347 other.data_ =
nullptr;
353 if (owned_data_ !=
nullptr) {
361 if (
this == &other) {
364 std::destroy_at(
this);
383 size_ = varray_.size();
386 data_ = const_cast<void *>(info.data);
389 owned_data_ = MEM_mallocN_aligned(type_->size * size_, type_->alignment, __func__);
390 if (copy_values_to_span) {
391 varray_.materialize_to_uninitialized(IndexRange(size_), owned_data_);
394 type_->default_construct_n(owned_data_, size_);
402 varray_(std::move(other.varray_)),
403 owned_data_(other.owned_data_),
404 show_not_saved_warning_(other.show_not_saved_warning_)
409 size_ = varray_.size();
412 data_ = const_cast<void *>(info.data);
417 other.owned_data_ =
nullptr;
418 other.data_ =
nullptr;
425 if (show_not_saved_warning_) {
426 if (!save_has_been_called_) {
427 std::cout <<
"Warning: Call `save()` to make sure that changes persist in all cases.\n";
431 if (owned_data_ !=
nullptr) {
439 if (
this == &other) {
442 std::destroy_at(
this);
449 save_has_been_called_ =
true;
450 if (
data_ != owned_data_) {
453 varray_.set_all(owned_data_);
458 show_not_saved_warning_ =
false;
501 switch (internal_info.
type) {
511 return internal_info;
523 varray_.materialize(shifted_mask, shifted_dst);
530 varray_.materialize_to_uninitialized(shifted_mask, shifted_dst);
536 varray_.materialize_compressed(shifted_mask, dst);
542 varray_.materialize_compressed_to_uninitialized(shifted_mask, dst);
560 other.storage_.reset();
561 other.impl_ =
nullptr;
596 impl_->materialize_to_uninitialized(
mask, dst);
601 impl_->materialize_compressed(
mask, dst);
606 impl_->materialize_compressed_to_uninitialized(
mask, dst);
611 if (
this == &other) {
620 if (
this == &other) {
623 storage_ = std::move(other.storage_);
625 other.storage_.reset();
626 other.impl_ =
nullptr;
657 impl_->type().default_construct(r_value);
690 if (
type.is_trivial &&
type.size <= 16 &&
type.alignment <= 8) {
814 return this->get_impl();
819 this->get_impl()->set_all(src);
#define BLI_assert_unreachable()
#define BUFFER_FOR_CPP_TYPE_VALUE(type, variable_name)
#define POINTER_OFFSET(v, ofs)
void fill_assign_n(const void *value, void *dst, int64_t n) const
void copy_assign(const void *src, void *dst) const
const CPPType * type_ptr() const
const CPPType & type() const
const GVMutableArray & varray() const
GMutableVArraySpan & operator=(GMutableVArraySpan &&other)
void disable_not_applied_warning()
const CPPType * type_ptr() const
const CPPType & type() const
GSpan slice(const int64_t start, int64_t size) const
CommonVArrayInfo common_info() const
void emplace(Args &&...args)
GSpan get_internal_span() const
void materialize_compressed_to_uninitialized(const IndexMask &mask, void *dst) const
const GVArrayImpl * impl_from_storage() const
void copy_from(const GVArrayCommon &other)
const CPPType & type() const
void move_from(GVArrayCommon &&other) noexcept
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(const IndexMask &mask, void *dst) const
void get_internal_single(void *r_value) const
GVArrayImpl_For_GArray(GArray<> array)
CommonVArrayInfo common_info() const override
void set_by_move(int64_t index, void *value) override
void get_to_uninitialized(int64_t index, void *r_value) const override
void materialize_compressed(const IndexMask &mask, void *dst) const override
void materialize_to_uninitialized(const IndexMask &mask, void *dst) const override
void set_by_relocate(int64_t index, void *value) override
void materialize(const IndexMask &mask, void *dst) const override
const int64_t element_size_
GVArrayImpl_For_GSpan(const GMutableSpan span)
void materialize_compressed_to_uninitialized(const IndexMask &mask, void *dst) const override
void get(int64_t index, void *r_value) const override
void set_by_copy(int64_t index, const void *value) override
void get(const int64_t index, void *r_value) const override
void materialize_compressed_to_uninitialized(const IndexMask &mask, void *dst) const override
void materialize_compressed(const IndexMask &mask, void *dst) const override
void materialize_to_uninitialized(const IndexMask &mask, void *dst) const override
void materialize(const IndexMask &mask, void *dst) const override
void get_to_uninitialized(const int64_t index, void *r_value) const override
CommonVArrayInfo common_info() const override
GVArrayImpl_For_SingleValueRef(const CPPType &type, const int64_t size, const void *value)
GVArrayImpl_For_SingleValue(const CPPType &type, const int64_t size, const void *value)
~GVArrayImpl_For_SingleValue() override
CommonVArrayInfo common_info() const override
void materialize_compressed_to_uninitialized(const IndexMask &mask, void *dst) const override
void materialize(const IndexMask &mask, void *dst) const final
void materialize_compressed(const IndexMask &mask, void *dst) const final
void get(const int64_t index, void *r_value) const override
void materialize_to_uninitialized(const IndexMask &mask, void *dst) const final
GVArrayImpl_For_SlicedGVArray(GVArray varray, const IndexRange slice)
void get_to_uninitialized(const int64_t index, void *r_value) const override
GVArrayImpl_For_SmallTrivialSingleValue(const CPPType &type, const int64_t size, const void *value)
virtual void materialize_compressed_to_uninitialized(const IndexMask &mask, void *dst) const
virtual void materialize(const IndexMask &mask, void *dst) const
virtual void get_to_uninitialized(int64_t index, void *r_value) const =0
virtual void materialize_compressed(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 void materialize_to_uninitialized(const IndexMask &mask, void *dst) const
GVArraySpan & operator=(GVArraySpan &&other)
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)
GVArray & operator=(const GVArray &other)
static GVArray For(Args &&...args)
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)
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)
virtual void set_by_relocate(int64_t index, void *value)
virtual void set_by_move(int64_t index, void *value)=0
void set_all(const void *src)
void set_by_copy(int64_t index, const void *value)
GVMutableArrayImpl * get_implementation() const
GMutableSpan get_internal_span() const
GVMutableArray & operator=(const GVMutableArray &other)
void fill(const void *value)
static GVMutableArray ForSpan(GMutableSpan span)
static GVMutableArray For(Args &&...args)
constexpr int64_t one_after_last() const
constexpr int64_t size() const
NonCopyable(const NonCopyable &other)=delete
NonMovable(NonMovable &&other)=delete
void * MEM_mallocN_aligned(size_t len, size_t alignment, const char *str)
void MEM_freeN(void *vmemh)
ccl_device_inline float2 mask(const MaskType mask, const float2 a)