diff options
author | Jacques Lucke <jacques@blender.org> | 2021-04-15 10:35:56 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2021-04-15 10:35:56 +0300 |
commit | bbea79ce5eadff621dcca668487cd1248b0433aa (patch) | |
tree | ad3660cdbfd6f3e509df471bc6a6f4f9c1e42c54 /source/blender/nodes/NOD_node_tree_multi_function.hh | |
parent | 3810bcc1604756f433b5b799b66d8b81645767ca (diff) |
Cleanup: move type conversions to separate file
Diffstat (limited to 'source/blender/nodes/NOD_node_tree_multi_function.hh')
-rw-r--r-- | source/blender/nodes/NOD_node_tree_multi_function.hh | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/source/blender/nodes/NOD_node_tree_multi_function.hh b/source/blender/nodes/NOD_node_tree_multi_function.hh index de1f5a0dc70..e3f31e011e4 100644 --- a/source/blender/nodes/NOD_node_tree_multi_function.hh +++ b/source/blender/nodes/NOD_node_tree_multi_function.hh @@ -387,33 +387,4 @@ MFNetworkTreeMap insert_node_tree_into_mf_network(fn::MFNetwork &network, using MultiFunctionByNode = Map<DNode, const fn::MultiFunction *>; MultiFunctionByNode get_multi_function_per_node(const DerivedNodeTree &tree, ResourceScope &scope); -class DataTypeConversions { - private: - Map<std::pair<fn::MFDataType, fn::MFDataType>, const fn::MultiFunction *> conversions_; - - public: - void add(fn::MFDataType from_type, fn::MFDataType to_type, const fn::MultiFunction &fn) - { - conversions_.add_new({from_type, to_type}, &fn); - } - - const fn::MultiFunction *get_conversion(fn::MFDataType from, fn::MFDataType to) const - { - return conversions_.lookup_default({from, to}, nullptr); - } - - bool is_convertible(const CPPType &from_type, const CPPType &to_type) const - { - return conversions_.contains( - {fn::MFDataType::ForSingle(from_type), fn::MFDataType::ForSingle(to_type)}); - } - - void convert(const CPPType &from_type, - const CPPType &to_type, - const void *from_value, - void *to_value) const; -}; - -const DataTypeConversions &get_implicit_type_conversions(); - } // namespace blender::nodes |