Blender
V3.3
|
#include <spreadsheet_cache.hh>
Classes | |
class | Key |
class | Value |
Public Member Functions | |
void | add (std::unique_ptr< Key > key, std::unique_ptr< Value > value) |
Value * | lookup (const Key &key) |
Value & | lookup_or_add (std::unique_ptr< Key > key, FunctionRef< std::unique_ptr< Value >()> create_value) |
void | set_all_unused () |
void | remove_all_unused () |
template<typename T > | |
T & | lookup_or_add (std::unique_ptr< Key > key) |
A generic cache for the spreadsheet. Different data sources can cache custom data using custom keys.
Elements are removed from the cache when they are not used during a redraw.
Definition at line 19 of file spreadsheet_cache.hh.
void blender::ed::spreadsheet::SpreadsheetCache::add | ( | std::unique_ptr< Key > | key, |
std::unique_ptr< Value > | value | ||
) |
Definition at line 7 of file spreadsheet_cache.cc.
Referenced by lookup_or_add().
SpreadsheetCache::Value * blender::ed::spreadsheet::SpreadsheetCache::lookup | ( | const Key & | key | ) |
Definition at line 14 of file spreadsheet_cache.cc.
References blender::ed::spreadsheet::SpreadsheetCache::Key::is_used.
Referenced by lookup_or_add().
|
inline |
Definition at line 57 of file spreadsheet_cache.hh.
References lookup_or_add(), and T.
SpreadsheetCache::Value & blender::ed::spreadsheet::SpreadsheetCache::lookup_or_add | ( | std::unique_ptr< Key > | key, |
FunctionRef< std::unique_ptr< Value >()> | create_value | ||
) |
Definition at line 25 of file spreadsheet_cache.cc.
References add(), and lookup().
Referenced by blender::ed::spreadsheet::add_fields_as_extra_columns(), and lookup_or_add().
void blender::ed::spreadsheet::SpreadsheetCache::remove_all_unused | ( | ) |
Definition at line 45 of file spreadsheet_cache.cc.
References blender::ed::spreadsheet::SpreadsheetCache::Key::is_used.
Referenced by spreadsheet_main_region_draw().
void blender::ed::spreadsheet::SpreadsheetCache::set_all_unused | ( | ) |
Definition at line 38 of file spreadsheet_cache.cc.
Referenced by spreadsheet_main_region_draw().