Blender V5.0
blender::dna::array Namespace Reference

Functions

template<typename T>
void remove_index (T **items, int *items_num, int *active_index, const int index, void(*destruct_item)(T *))
template<typename T>
void remove_if (T **items, int *items_num, FunctionRef< bool(const T &)> predicate, void(*destruct_item)(T *))
template<typename T>
void clear (T **items, int *items_num, int *active_index, void(*destruct_item)(T *))
template<typename T>
void move_index (T *items, const int items_num, const int from_index, const int to_index)

Function Documentation

◆ clear()

template<typename T>
void blender::dna::array::clear ( T ** items,
int * items_num,
int * active_index,
void(* destruct_item )(T *) )
inline

Removes all elements from an array and frees it.

Definition at line 83 of file DNA_array_utils.hh.

References i, MEM_SAFE_FREE, and T.

Referenced by blender::ed::object::bake_simulation::clear_data_block_references(), and blender::animrig::Channelbag::fcurves_clear().

◆ move_index()

template<typename T>
void blender::dna::array::move_index ( T * items,
const int items_num,
const int from_index,
const int to_index )
inline

◆ remove_if()

template<typename T>
void blender::dna::array::remove_if ( T ** items,
int * items_num,
FunctionRef< bool(const T &)> predicate,
void(* destruct_item )(T *) )
inline

Removes all elements for which the predicate is true. The remaining ones stay in the order they were in before.

Definition at line 62 of file DNA_array_utils.hh.

References blender::IndexRange::from_begin_end(), i, and T.

Referenced by blender::ed::spreadsheet::spreadsheet_table_remove_unused(), and blender::ed::spreadsheet::spreadsheet_table_remove_unused_columns().

◆ remove_index()