Blender V4.3
SDNA Struct Reference

#include <DNA_sdna_types.h>

Public Attributes

const char * data
 
int data_size
 
bool data_alloc
 
int pointer_size
 
int types_num
 
const char ** types
 
short * types_size
 
inttypes_alignment
 
int structs_num
 
SDNA_Struct ** structs
 
int members_num
 
int members_num_alloc
 
const char ** members
 
short * members_array_num
 
struct GHashtypes_to_structs_map
 
struct { 
 
   const char **   types 
 
   const char **   members 
 
   struct GHash *   types_to_structs_map 
 
alias 
 
struct MemArenamem_arena
 

Detailed Description

Definition at line 38 of file DNA_sdna_types.h.

Member Data Documentation

◆ [struct]

struct { ... } SDNA::alias

Runtime versions of data stored in DNA, lazy initialized, only different when renaming is done.

Contains mapping from original (static) types/members names to their current (alias) DNA-defined versions (i.e. results from calling DNA_alias_maps with DNA_RENAME_ALIAS_FROM_STATIC).

Referenced by DNA_sdna_alias_data_ensure(), DNA_sdna_alias_data_ensure_structs_map(), DNA_sdna_free(), DNA_sdna_patch_struct_member(), DNA_struct_find_index_with_alias_ex(), DNA_struct_identifier(), elem_exists_with_alias(), elem_offset_with_alias(), init_structDNA(), and rna_find_sdna_member().

◆ data

const char* SDNA::data

The 'encoded' data (full copy when data_alloc is set, otherwise borrowed memory).

Definition at line 40 of file DNA_sdna_types.h.

Referenced by DNA_sdna_free(), DNA_sdna_from_data(), init_structDNA(), and write_file_handle().

◆ data_alloc

bool SDNA::data_alloc

Definition at line 43 of file DNA_sdna_types.h.

Referenced by DNA_sdna_free(), and DNA_sdna_from_data().

◆ data_size

int SDNA::data_size

Length of data, in bytes.

Definition at line 42 of file DNA_sdna_types.h.

Referenced by DNA_sdna_from_data(), and write_file_handle().

◆ mem_arena

struct MemArena* SDNA::mem_arena

Temporary memory currently only used for version patching DNA.

Definition at line 131 of file DNA_sdna_types.h.

Referenced by DNA_sdna_alias_data_ensure(), dna_sdna_alias_from_static_elem_full(), DNA_sdna_free(), DNA_sdna_patch_struct_member(), init_structDNA(), and sdna_expand_names().

◆ members

◆ members_array_num

short* SDNA::members_array_num

Aligned with members. The total number of items in the array defined by the matching member, if any, otherwise 1.

Result of DNA_member_array_num.

Definition at line 102 of file DNA_sdna_types.h.

Referenced by DNA_sdna_free(), DNA_sdna_patch_struct_member(), DNA_struct_member_size(), DNA_struct_switch_endian(), get_member_size_in_bytes(), init_reconstruct_step_for_member(), init_structDNA(), and sdna_expand_names().

◆ members_num

int SDNA::members_num

Total number of struct members.

Definition at line 86 of file DNA_sdna_types.h.

Referenced by DNA_sdna_alias_data_ensure(), DNA_sdna_patch_struct_member(), init_structDNA(), and sdna_expand_names().

◆ members_num_alloc

int SDNA::members_num_alloc

Contains the number of allocated items in both members and members_array_num arrays below.

Typically same as #members_len, unless after versioning DNA info (these arrays are reallocated by chunks, see DNA_sdna_patch_struct_member).

Definition at line 93 of file DNA_sdna_types.h.

Referenced by DNA_sdna_patch_struct_member(), and init_structDNA().

◆ pointer_size

◆ structs

◆ structs_num

int SDNA::structs_num

This covers all known structs from SDNA (pointers to SDNA_Struct data).

NOTE: See comment above about SDNA types above for differences between structs and types definitions. Number of struct definitions.

Definition at line 79 of file DNA_sdna_types.h.

Referenced by DNA_reconstruct_info_create(), DNA_reconstruct_info_free(), DNA_sdna_alias_data_ensure(), DNA_sdna_alias_data_ensure_structs_map(), DNA_struct_find_index_with_alias_ex(), DNA_struct_find_index_without_alias_ex(), DNA_struct_get_compareflags(), init_structDNA(), and sdna_expand_names().

◆ types

◆ types_alignment

int* SDNA::types_alignment

Alignment used when allocating pointers to this type. The actual minimum alignment of the type may be lower in some cases. For example, the pointer alignment of a single char is at least 8 bytes, but the alignment of the type itself is 1.

Definition at line 68 of file DNA_sdna_types.h.

Referenced by DNA_sdna_free(), DNA_struct_alignment(), and init_structDNA().

◆ types_num

int SDNA::types_num

This covers all known types (basic and structs ones) from SDNA.

NOTE: This data is not in sync with the SDNA structs info below. Among other things:

  • Basic types (int, float, etc.) have no matching struct definitions currently.
  • Types can be discovered and added before their struct definition, when they are used for members of another struct which gets parsed first. Number of types.

Definition at line 58 of file DNA_sdna_types.h.

Referenced by DNA_sdna_alias_data_ensure(), DNA_struct_find_index_with_alias_ex(), DNA_struct_find_index_without_alias_ex(), and init_structDNA().

◆ types_size

◆ types_to_structs_map

struct GHash* SDNA::types_to_structs_map

Mapping between type names (from types array above) and struct indices (into structs array above).

Requires WITH_DNA_GHASH to be used for now.

A version of SDNA.types_to_structs_map that uses SDNA.alias.types for its keys.

Definition at line 111 of file DNA_sdna_types.h.

Referenced by DNA_sdna_alias_data_ensure_structs_map(), DNA_sdna_free(), DNA_sdna_patch_struct(), DNA_struct_find_index_with_alias_ex(), DNA_struct_find_index_without_alias_ex(), and init_structDNA().


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