diff options
author | Jacques Lucke <mail@jlucke.com> | 2019-12-06 15:30:10 +0300 |
---|---|---|
committer | Jacques Lucke <mail@jlucke.com> | 2019-12-06 15:30:10 +0300 |
commit | 7c035655944d53dd3c449a6da24173adb117156e (patch) | |
tree | 092fad938be3722169f32d325b616a0b47c35798 /source/blender/functions/FN_generic_virtual_list_list_ref.h | |
parent | e93fe105d10943b791d8e6bfa8c3f65d66e61dc6 (diff) |
add utility to check if an input is only a single value
Diffstat (limited to 'source/blender/functions/FN_generic_virtual_list_list_ref.h')
-rw-r--r-- | source/blender/functions/FN_generic_virtual_list_list_ref.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/functions/FN_generic_virtual_list_list_ref.h b/source/blender/functions/FN_generic_virtual_list_list_ref.h index 7a309780bb7..9ccaef6b019 100644 --- a/source/blender/functions/FN_generic_virtual_list_list_ref.h +++ b/source/blender/functions/FN_generic_virtual_list_list_ref.h @@ -81,6 +81,18 @@ class GenericVirtualListListRef { return *m_type; } + bool is_single_list() const + { + switch (m_category) { + case Category::SingleArray: + return true; + case Category::FullArrayList: + return m_virtual_list_size == 1; + } + BLI_assert(false); + return false; + } + GenericVirtualListRef operator[](uint index) const { BLI_assert(index < m_virtual_list_size); |