Blender V4.5
WriteData Struct Reference

Public Attributes

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

Detailed Description

Definition at line 410 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 416 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 423 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 440 of file writefile.cc.

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

◆ debug_dst

std::ostream* WriteData::debug_dst = nullptr

◆ is_writing_id

bool WriteData::is_writing_id

Whether writefile code is currently writing an ID.

Definition at line 432 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 421 of file writefile.cc.

Referenced by mywrite(), and writedata_new().

◆ mem

MemFileWriteData WriteData::mem

MemFile writing (used for undo).

Definition at line 455 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 445 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 452 of file writefile.cc.

Referenced by BLO_write_shared(), and mywrite_id_end().

◆ sdna

const SDNA* WriteData::sdna

◆ use_memfile

bool WriteData::use_memfile

◆ used_len

size_t WriteData::used_len

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

Definition at line 418 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 464 of file writefile.cc.

Referenced by writedata_do_write(), and writedata_new().


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