diff options
author | Jacques Lucke <jacques@blender.org> | 2020-07-08 16:02:47 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2020-07-08 16:10:30 +0300 |
commit | 840941215d42bb48fdc4724ed4d7058d275df740 (patch) | |
tree | bd90b1512fc3012be2de8348190ed9cfd094f651 /source | |
parent | 36a547af7b72cd45f541c3cf7ab35c24b989bf60 (diff) |
Functions: allow multi-functions to override a hash and equals function
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/functions/FN_multi_function.hh | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/functions/FN_multi_function.hh b/source/blender/functions/FN_multi_function.hh index 452fd5472ce..c53959203cb 100644 --- a/source/blender/functions/FN_multi_function.hh +++ b/source/blender/functions/FN_multi_function.hh @@ -45,6 +45,8 @@ * 3. Override the `call` function. */ +#include "BLI_hash.hh" + #include "FN_multi_function_context.hh" #include "FN_multi_function_params.hh" @@ -61,6 +63,16 @@ class MultiFunction { virtual void call(IndexMask mask, MFParams params, MFContext context) const = 0; + virtual uint32_t hash() const + { + return DefaultHash<const MultiFunction *>{}(this); + } + + virtual bool equals(const MultiFunction &UNUSED(other)) const + { + return false; + } + IndexRange param_indices() const { return signature_.param_types.index_range(); |