125#define blo_blend_struct_writer_fn_typed(T, fn) \
126 ((fn) ? BlendStructWriterFn([fn](BlendStructWriterVoid &struct_writer) { \
127 BlendStructWriter<T> typed_writer(struct_writer); \
220 size_t approximate_size_in_bytes,
324 const void *id_address,
350 shallow_id.
prev =
nullptr;
351 shallow_id.
next =
nullptr;
353 shallow_id.
newid =
nullptr;
420 static constexpr int static_size = 8192;
429 return static_cast<ID *
>(buffer_.buffer());
467#define BLO_read_raw_address(reader, ptr_p) \
468 *((void **)ptr_p) = blo_read_raw_address_impl((reader), *(ptr_p))
476void *
blo_read_struct_impl(BlendDataReader *reader,
const void *old_address,
size_t expected_size);
477#define BLO_read_struct(reader, struct_name, ptr_p) \
478 (*((void **)ptr_p) = blo_read_struct_impl(reader, *((void **)ptr_p), sizeof(struct_name)))
485 const void *old_address,
486 size_t expected_size);
487#define BLO_read_struct_nonnull(reader, struct_name, ptr_p) \
488 (*((void **)ptr_p) = blo_read_struct_nonnull_impl( \
489 reader, *((void **)ptr_p), sizeof(struct_name)))
501 const void *old_address,
502 size_t expected_size);
504#define BLO_read_struct_no_us(reader, struct_name, ptr_p) \
505 (*((void **)ptr_p) = blo_read_struct_no_us_impl(reader, *((void **)ptr_p), sizeof(struct_name)))
507#define BLO_read_struct_array_no_us(reader, struct_name, ptr_p, array_size) \
508 (*((void **)ptr_p) = blo_read_struct_no_us_impl( \
509 reader, *((void **)ptr_p), sizeof(struct_name) * size_t(array_size)))
515 const void *old_address,
516 size_t expected_size);
518#define BLO_read_struct_no_us_nonnull(reader, struct_name, ptr_p) \
519 (*((void **)ptr_p) = blo_read_struct_no_us_nonnull_impl( \
520 reader, *((void **)ptr_p), sizeof(struct_name)))
529 StringRef struct_name,
531 const void *old_address);
539 size_t expected_elem_size,
542#define BLO_read_struct_list(reader, struct_name, list) \
543 BLO_read_struct_list_with_size(reader, sizeof(struct_name), list)
553 FunctionRef<
size_t(
const void *
data)> type_size_fn);
555 const void *old_address,
557 FunctionRef<
size_t(
const void *
data)> type_size_fn);
566 return type_size_fn(*
static_cast<const T *
>(
data));
575 *ptr_p =
static_cast<T *
>(
577 return type_size_fn(*
static_cast<const T *
>(
data));
594 BlendDataReader *reader,
int64_t array_size,
int elems,
size_t elem_size,
void **ptr_p);
596template<
typename T,
typename SizeT>
597 requires(!std::is_void_v<T> && !std::is_pointer_v<T>)
600 const SizeT array_size,
604 reader,
int64_t(array_size), elems,
sizeof(
T),
reinterpret_cast<void **
>(ptr_p));
607template<
typename T,
typename SizeT>
608 requires(!std::is_void_v<T> && !std::is_pointer_v<T>)
615 reader,
int64_t(*array_size), elems,
sizeof(
T),
reinterpret_cast<void **
>(ptr_p)))
629template<
typename T,
typename SizeT>
630 requires(std::is_pointer_v<T> || std::is_void_v<T>)
633 const SizeT array_size)
638template<
typename T,
typename SizeT>
639 requires(std::is_pointer_v<T> || std::is_void_v<T>)
672 reader, (
const void **)data_ptr, read_fn);
675 *data_ptr =
const_cast<T *
>(
static_cast<const T *
>(shared_data.
data));
708 const bool is_linked_only,
#define blo_blend_struct_writer_fn_typed(T, fn)
ID and Library types, which are fundamental for SDNA.
#define ID_TAG_KEEP_ON_UNDO
These structs are the foundation for all linked lists in the library system.
BlendStructWriterVoid(WriteData &wd, const int struct_nr, MutableSpan< char > data)
BlendStructWriter< T > typed()
void generated_ptr(int64_t offset)
MutableSpan< char > data_
BlendStructWriter(const BlendStructWriterVoid &writer)
void BLO_read_struct_with_type_size(BlendDataReader *reader, T **ptr_p, FunctionRef< size_t(const T &data)> type_size_fn)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
bool blo_read_array_impl(BlendDataReader *reader, int64_t array_size, int elems, size_t elem_size, void **ptr_p)
void BLO_read_glob_list(BlendDataReader *reader, ListBase *list)
struct Library * BLO_read_data_current_library(BlendDataReader *reader)
const ImplicitSharingInfo * BLO_read_shared(BlendDataReader *reader, T **data_ptr, FunctionRef< const ImplicitSharingInfo *()> read_fn)
void BLO_read_struct_list_with_size(BlendDataReader *reader, size_t expected_elem_size, ListBase *list)
void * blo_read_struct_no_us_impl(BlendDataReader *reader, const void *old_address, size_t expected_size)
BlendFileReadReport * BLO_read_data_reports(BlendDataReader *reader)
void * BLO_read_struct_by_name_array(BlendDataReader *reader, StringRef struct_name, int64_t items_num, const void *old_address)
void BLO_read_data_globmap_add(BlendDataReader *reader, void *oldaddr, void *newaddr)
void BLO_read_pointer_array_and_validate_size(BlendDataReader *reader, T **ptr_p, SizeT *array_size)
ImplicitSharingInfoAndData blo_read_shared_impl(BlendDataReader *reader, const void **ptr_p, FunctionRef< const ImplicitSharingInfo *()> read_fn)
void BLO_read_data_invalidate(BlendDataReader *reader, const char *message)
void * blo_read_raw_address_impl(BlendDataReader *reader, const void *old_address)
bool BLO_read_data_is_undo(BlendDataReader *reader)
std::type_identity_t< FunctionRef< void(BlendStructWriter< T > &struct_writer)> > BlendStructWriterTypedFn
void * blo_read_struct_nonnull_impl(BlendDataReader *reader, const void *old_address, size_t expected_size)
BMesh const char void * data
void * blo_read_struct_with_type_size_impl(BlendDataReader *reader, const void *old_address, size_t base_size, FunctionRef< size_t(const void *data)> type_size_fn)
bool BLO_read_pointer_array(BlendDataReader *reader, T **ptr_p, const SizeT array_size)
BlendFileReadReport * BLO_read_lib_reports(BlendLibReader *reader)
void BLO_read_struct_list_with_type_size(BlendDataReader *reader, size_t base_size, ListBase *list, FunctionRef< size_t(const void *data)> type_size_fn)
ID * BLO_read_get_new_id_address(BlendLibReader *reader, ID *self_id, const bool is_linked_only, ID *id) ATTR_NONNULL(2)
bool blo_read_pointer_array_impl(BlendDataReader *reader, int64_t array_size, void **ptr_p)
void BLO_read_data_set_need_preview_render_restart(BlendDataReader *reader)
ATTR_WARN_UNUSED_RESULT const size_t num
void BLO_reportf_wrap(BlendFileReadReport *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
bool BLO_read_array(BlendDataReader *reader, T **ptr_p, const SizeT array_size, const int elems=1)
void BLO_read_array_and_validate_size(BlendDataReader *reader, T **ptr_p, SizeT *array_size, const int elems=1)
Main * BLO_read_lib_get_main(BlendLibReader *reader)
size_t ATTR_PRINTF_FORMAT(3, 4)
int BLO_read_fileversion_get(BlendDataReader *reader)
ID_Type GS(const char *name)
bool BLO_read_lib_is_undo(BlendLibReader *reader)
void * blo_read_struct_no_us_nonnull_impl(BlendDataReader *reader, const void *old_address, size_t expected_size)
FunctionRef< void(BlendStructWriterVoid &struct_writer)> BlendStructWriterFn
void * blo_read_struct_impl(BlendDataReader *reader, const void *old_address, size_t expected_size)
ID * BLO_read_get_new_id_address_from_session_uid(BlendLibReader *reader, uint session_uid) ATTR_NONNULL(1)
void BLO_read_string(BlendDataReader *reader, char **ptr_p)
BLO_Write_IDBuffer(ID &id, bool is_undo, bool is_placeholder)
Map< uint64_t, ImplicitSharingInfoAndData > shared_data_by_stored_address
void write_struct_array_cast(const int64_t array_size, const void *data, BlendStructWriterTypedFn< T > fn=nullptr)
void write_pointer_array(int64_t num, const void *data)
void write_struct_by_id(int struct_id, const void *data, BlendStructWriterFn fn=nullptr)
void write_struct_array_by_id(int struct_id, int64_t array_size, const void *data, BlendStructWriterFn fn=nullptr)
void write_struct_array_by_name(const char *struct_name, int64_t array_size, const void *data, BlendStructWriterFn fn=nullptr)
int struct_id_by_name(const char *struct_name) const
void write_shared(const void *data, size_t approximate_size_in_bytes, const ImplicitSharingInfo *sharing_info, FunctionRef< void()> write_fn)
void generated_pointer_tag(const void *data)
void write_string(const char *data)
void write_struct_by_name(const char *struct_name, const void *data, BlendStructWriterFn fn=nullptr)
void write_embedded_id_struct(const void *id_address, const T *id, BlendStructWriterTypedFn< T > fn=nullptr)
void write_uint8_array(int64_t num, const uint8_t *data)
void write_struct_list_by_id(int struct_id, const ListBase *list, BlendStructWriterFn fn=nullptr)
void write_int8_array(int64_t num, const int8_t *data)
void write_struct_at_address_by_id(int struct_id, const void *address, const void *data, BlendStructWriterFn fn=nullptr)
void write_float_array(int64_t num, const float *data)
void write_struct_list_by_name(const char *struct_name, ListBase *list, BlendStructWriterFn fn=nullptr)
void write_struct_array_at_address_by_id(int struct_id, int64_t array_size, const void *address, const void *data, BlendStructWriterFn fn=nullptr)
void write_struct_at_address(const void *address, const T *data, BlendStructWriterTypedFn< T > fn=nullptr)
void write_id_struct(const int filecode, const void *id_address, const T *id, BlendStructWriterTypedFn< T > fn=nullptr)
void write_float3_array(int64_t num, const float *data)
void write_struct_at_address_cast(const void *address, const void *data, BlendStructWriterTypedFn< T > fn=nullptr)
void write_id_struct(const void *id_address, const T *id, BlendStructWriterTypedFn< T > fn=nullptr)
void write_char_array(int64_t num, const char *data)
void write_struct_list(const ListBaseT< T > *list, BlendStructWriterTypedFn< T > fn=nullptr)
void write_int16_array(int64_t num, const int16_t *data)
void write_struct_cast(const void *data, BlendStructWriterTypedFn< T > fn=nullptr)
void write_uint32_array(int64_t num, const uint32_t *data)
void write_struct(const T *data, BlendStructWriterTypedFn< T > fn=nullptr)
void write_double_array(int64_t num, const double *data)
void write_struct_at_address_by_id_with_filecode(int filecode, int struct_id, const void *address, const void *data, BlendStructWriterFn fn=nullptr)
void write_raw(size_t size_in_bytes, const void *data)
void write_struct_array_at_address(const int64_t array_size, const void *address, const T *data, BlendStructWriterTypedFn< T > fn=nullptr)
void write_struct_array(const int64_t array_size, const T *data, BlendStructWriterTypedFn< T > fn=nullptr)
void write_int32_array(int64_t num, const int32_t *data)
StringRefNull filepath() const
bke::id::ID_Runtime * runtime
unsigned int recalc_up_to_undo_push
unsigned int recalc_after_undo_push
const ImplicitSharingInfo * sharing_info