Blender V4.3
WriteData Struct Reference

Public Attributes

const SDNAsdna
 
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 
 
blender::Set< const void * > per_id_written_shared_addresses
 
MemFileWriteData mem
 
bool use_memfile
 
WriteWrapww
 

Detailed Description

Definition at line 402 of file writefile.cc.

Member Data Documentation

◆ buf

uchar* WriteData::buf

Use for file and memory writing (size stored in max_size).

Definition at line 407 of file writefile.cc.

Referenced by mywrite(), mywrite_end(), mywrite_flush(), writedata_free(), and writedata_new().

◆ [struct]

struct { ... } WriteData::buffer

◆ chunk_size

size_t WriteData::chunk_size

Threshold above which writes get their own chunk.

Definition at line 414 of file writefile.cc.

Referenced by mywrite(), and writedata_new().

◆ critical_error

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 431 of file writefile.cc.

Referenced by mywrite(), mywrite_end(), and writedata_do_write().

◆ is_writing_id

bool WriteData::is_writing_id

Whether writefile code is currently writing an ID.

Definition at line 423 of file writefile.cc.

Referenced by mywrite_id_begin(), mywrite_id_end(), and write_at_address_validate().

◆ max_size

size_t WriteData::max_size

Maximum size of the buffer.

Definition at line 412 of file writefile.cc.

Referenced by mywrite(), and writedata_new().

◆ mem

MemFileWriteData WriteData::mem

MemFile writing (used for undo).

Definition at line 446 of file writefile.cc.

Referenced by BLO_write_shared(), mywrite_begin(), mywrite_end(), mywrite_id_begin(), mywrite_id_end(), and writedata_do_write().

◆ per_id_addresses_set

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 436 of file writefile.cc.

Referenced by mywrite_id_begin(), mywrite_id_end(), and write_at_address_validate().

◆ per_id_written_shared_addresses

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 443 of file writefile.cc.

Referenced by BLO_write_shared(), and mywrite_id_end().

◆ sdna

const SDNA* WriteData::sdna

◆ use_memfile

bool WriteData::use_memfile

When true, write to #WriteData.current, could also call 'is_undo'.

Definition at line 448 of file writefile.cc.

Referenced by BLO_write_is_undo(), mywrite_begin(), mywrite_end(), mywrite_id_begin(), mywrite_id_end(), write_at_address_validate(), write_file_handle(), write_global(), write_libraries(), and writedata_do_write().

◆ used_len

size_t WriteData::used_len

Number of bytes used in WriteData.buf (flushed when exceeded).

Definition at line 409 of file writefile.cc.

Referenced by mywrite(), mywrite_end(), and mywrite_flush().

◆ [struct]

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().

◆ ww

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 455 of file writefile.cc.

Referenced by writedata_do_write(), and writedata_new().


The documentation for this struct was generated from the following file: