Blender V4.5
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 81 of file DNA_array_utils.hh.

References MEM_SAFE_FREE.

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

Moves one element from one index to another, moving other elements if necessary.

Definition at line 98 of file DNA_array_utils.hh.

References BLI_assert, and UNUSED_VARS_NDEBUG.

Referenced by blender::nodes::socket_items::ops::add_item(), blender::nodes::socket_items::ops::move_active_item(), and blender::ed::spreadsheet::reorder_columns_modal().

◆ 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 60 of file DNA_array_utils.hh.

References blender::IndexRange::from_begin_end(), and value.

Referenced by blender::ed::spreadsheet::spreadsheet_table_remove_unused().

◆ remove_index()