|
Blender V5.0
|
Public Attributes | |
| const SDNA * | sdna |
| std::ostream * | debug_dst = nullptr |
| struct { | |
| uchar * buf | |
| size_t used_len | |
| size_t max_size | |
| size_t chunk_size | |
| } | buffer |
| bool | is_writing_id |
| struct { | |
| bool critical_error | |
| blender::Set< const void * > per_id_addresses_set | |
| } | validation_data |
| struct { | |
| std::unique_ptr< blender::dna::pointers::PointersInDNA > sdna_pointers | |
| blender::Map< const void *, uint64_t > pointer_map | |
| blender::Set< uint64_t > used_ids | |
| uint64_t next_id_hint = 0 | |
| } | stable_address_ids |
| blender::Set< const void * > | per_id_written_shared_addresses |
| MemFileWriteData | mem |
| bool | use_memfile |
| WriteWrap * | ww |
Definition at line 414 of file writefile.cc.
| uchar* WriteData::buf |
Use for file and memory writing (size stored in max_size).
Definition at line 420 of file writefile.cc.
Referenced by mywrite(), mywrite_end(), mywrite_flush(), writedata_free(), and writedata_new().
| struct { ... } WriteData::buffer |
Referenced by mywrite(), mywrite_end(), mywrite_flush(), writedata_free(), and writedata_new().
| size_t WriteData::chunk_size |
Threshold above which writes get their own chunk.
Definition at line 427 of file writefile.cc.
Referenced by mywrite(), and writedata_new().
| bool WriteData::critical_error |
Set on unlikely case of an error (ignores further file writing). Only used for very low-level errors (like if the actual write on file fails).
Definition at line 444 of file writefile.cc.
Referenced by mywrite(), mywrite_end(), and writedata_do_write().
| std::ostream* WriteData::debug_dst = nullptr |
Definition at line 416 of file writefile.cc.
Referenced by write_file_handle(), write_raw_data_in_debug_file(), writedata(), and writestruct_at_address_nr().
| bool WriteData::is_writing_id |
Whether writefile code is currently writing an ID.
Definition at line 436 of file writefile.cc.
Referenced by mywrite_id_begin(), mywrite_id_end(), and write_at_address_validate().
| size_t WriteData::max_size |
Maximum size of the buffer.
Definition at line 425 of file writefile.cc.
Referenced by mywrite(), and writedata_new().
| MemFileWriteData WriteData::mem |
MemFile writing (used for undo).
Definition at line 499 of file writefile.cc.
Referenced by BLO_write_shared(), mywrite_begin(), mywrite_end(), mywrite_id_begin(), mywrite_id_end(), and writedata_do_write().
| uint64_t WriteData::next_id_hint = 0 |
The next stable address id is derived from this. This is modified in two cases:
When creating the new address id, keep in mind that this may be 0 and it may collide with previous hints.
Definition at line 489 of file writefile.cc.
Referenced by get_address_id_int(), and mywrite_id_begin().
| blender::Set<const void *> WriteData::per_id_addresses_set |
A set of all 'old' addresses used as UID of written blocks for the current ID. Allows detecting invalid re-uses of the same address multiple times.
Definition at line 449 of file writefile.cc.
Referenced by mywrite_id_begin(), mywrite_id_end(), and write_at_address_validate().
| blender::Set<const void *> WriteData::per_id_written_shared_addresses |
Keeps track of which shared data has been written for the current ID. This is necessary to avoid writing the same data more than once.
Definition at line 496 of file writefile.cc.
Referenced by BLO_write_shared(), and mywrite_id_end().
| blender::Map<const void *, uint64_t> WriteData::pointer_map |
Maps each runtime-pointer to a unique identifier that's written in the .blend file.
Currently, no pointers are ever removed from this map during writing of a single file. Correctness wise, this is fine. However, when some data-blocks write temporary addresses, those may be reused across IDs while actually pointing to different data. This can break address id stability in some situations. In the future this could be improved by clearing such temporary pointers before writing the next data-block.
Definition at line 467 of file writefile.cc.
Referenced by BLO_write_shared_tag(), get_address_id_int(), and prepare_stable_data_block_ids().
| const SDNA* WriteData::sdna |
Definition at line 415 of file writefile.cc.
Referenced by BLO_get_struct_id_by_name(), write_file_handle(), writedata_new(), and writestruct_at_address_nr().
| std::unique_ptr<blender::dna::pointers::PointersInDNA> WriteData::sdna_pointers |
Knows which DNA members are pointers. Those members are overridden when serializing the .blend file to get more stable pointer identifiers.
Definition at line 457 of file writefile.cc.
Referenced by writedata_new(), and writestruct_at_address_nr().
| struct { ... } WriteData::stable_address_ids |
| bool WriteData::use_memfile |
When true, write to #WriteData.current, could also call 'is_undo'.
Definition at line 501 of file writefile.cc.
Referenced by BLO_write_is_undo(), mywrite_begin(), mywrite_end(), mywrite_id_begin(), mywrite_id_end(), prepare_stable_data_block_ids(), write_at_address_validate(), write_file_handle(), write_global(), write_id(), write_id_placeholder(), write_libraries(), and writedata_do_write().
| blender::Set<uint64_t> WriteData::used_ids |
Contains all the #pointer_map.values(). This is used to make sure that the same id is never reused for a different pointer. While this is technically allowed in .blend files (when the pointers are local data of different objects), we currently don't always know what type a pointer points to when writing it. So we can't determine if a pointer is local or not.
Definition at line 474 of file writefile.cc.
Referenced by get_next_stable_address_id().
| size_t WriteData::used_len |
Number of bytes used in WriteData.buf (flushed when exceeded).
Definition at line 422 of file writefile.cc.
Referenced by mywrite(), mywrite_end(), and mywrite_flush().
| struct { ... } WriteData::validation_data |
Some validation and error handling data.
Referenced by mywrite(), mywrite_end(), mywrite_id_begin(), mywrite_id_end(), write_at_address_validate(), and writedata_do_write().
| WriteWrap* WriteData::ww |
Wrap writing, so we can use zstd or other compression types later, see: G_FILE_COMPRESS Will be nullptr for UNDO.
Definition at line 508 of file writefile.cc.
Referenced by writedata_do_write(), and writedata_new().