|
Blender V4.3
|
#include <BLI_cpp_type.hh>
Inherits blender::NonCopyable, and blender::NonMovable.
Public Member Functions | |
| template<typename T , CPPTypeFlags Flags> | |
| CPPType (TypeTag< T >, TypeForValue< CPPTypeFlags, Flags >, StringRef debug_name) | |
| virtual | ~CPPType ()=default |
| StringRefNull | name () const |
| int64_t | size () const |
| int64_t | alignment () const |
| bool | is_trivially_destructible () const |
| bool | is_trivial () const |
| bool | is_default_constructible () const |
| bool | is_copy_constructible () const |
| bool | is_move_constructible () const |
| bool | is_destructible () const |
| bool | is_copy_assignable () const |
| bool | is_move_assignable () const |
| bool | is_printable () const |
| bool | is_equality_comparable () const |
| bool | is_hashable () const |
| bool | has_special_member_functions () const |
| bool | pointer_has_valid_alignment (const void *ptr) const |
| bool | pointer_can_point_to_instance (const void *ptr) const |
| void | default_construct (void *ptr) const |
| void | default_construct_n (void *ptr, int64_t n) const |
| void | default_construct_indices (void *ptr, const IndexMask &mask) const |
| void | value_initialize (void *ptr) const |
| void | value_initialize_n (void *ptr, int64_t n) const |
| void | value_initialize_indices (void *ptr, const IndexMask &mask) const |
| void | destruct (void *ptr) const |
| void | destruct_n (void *ptr, int64_t n) const |
| void | destruct_indices (void *ptr, const IndexMask &mask) const |
| void | copy_assign (const void *src, void *dst) const |
| void | copy_assign_n (const void *src, void *dst, int64_t n) const |
| void | copy_assign_indices (const void *src, void *dst, const IndexMask &mask) const |
| void | copy_assign_compressed (const void *src, void *dst, const IndexMask &mask) const |
| void | copy_construct (const void *src, void *dst) const |
| void | copy_construct_n (const void *src, void *dst, int64_t n) const |
| void | copy_construct_indices (const void *src, void *dst, const IndexMask &mask) const |
| void | copy_construct_compressed (const void *src, void *dst, const IndexMask &mask) const |
| void | move_assign (void *src, void *dst) const |
| void | move_assign_n (void *src, void *dst, int64_t n) const |
| void | move_assign_indices (void *src, void *dst, const IndexMask &mask) const |
| void | move_construct (void *src, void *dst) const |
| void | move_construct_n (void *src, void *dst, int64_t n) const |
| void | move_construct_indices (void *src, void *dst, const IndexMask &mask) const |
| void | relocate_assign (void *src, void *dst) const |
| void | relocate_assign_n (void *src, void *dst, int64_t n) const |
| void | relocate_assign_indices (void *src, void *dst, const IndexMask &mask) const |
| void | relocate_construct (void *src, void *dst) const |
| void | relocate_construct_n (void *src, void *dst, int64_t n) const |
| void | relocate_construct_indices (void *src, void *dst, const IndexMask &mask) const |
| void | fill_assign_n (const void *value, void *dst, int64_t n) const |
| void | fill_assign_indices (const void *value, void *dst, const IndexMask &mask) const |
| void | fill_construct_n (const void *value, void *dst, int64_t n) const |
| void | fill_construct_indices (const void *value, void *dst, const IndexMask &mask) const |
| bool | can_exist_in_buffer (const int64_t buffer_size, const int64_t buffer_alignment) const |
| void | print (const void *value, std::stringstream &ss) const |
| std::string | to_string (const void *value) const |
| void | print_or_default (const void *value, std::stringstream &ss, StringRef default_value) const |
| bool | is_equal (const void *a, const void *b) const |
| bool | is_equal_or_false (const void *a, const void *b) const |
| uint64_t | hash (const void *value) const |
| uint64_t | hash_or_fallback (const void *value, uint64_t fallback_hash) const |
| const void * | default_value () const |
| uint64_t | hash () const |
| template<typename T > | |
| bool | is () const |
| template<typename... T> | |
| bool | is_any () const |
| template<typename... Types, typename Fn > | |
| void | to_static_type (const Fn &fn) const |
| template<typename... Types, typename Fn > | |
| void | to_static_type_tag (const Fn &fn) const |
Static Public Member Functions | |
| template<typename T > | |
| static const CPPType & | get () |
| template<typename T > | |
| static const CPPType & | get_impl () |
Public Attributes | |
| void(*)(void *) | destruct_fn () const |
Friends | |
| bool | operator== (const CPPType &a, const CPPType &b) |
| bool | operator!= (const CPPType &a, const CPPType &b) |
Definition at line 101 of file BLI_cpp_type.hh.
| blender::CPPType::CPPType | ( | TypeTag< T > | , |
| TypeForValue< CPPTypeFlags, Flags > | , | ||
| StringRef | debug_name ) |
Definition at line 218 of file BLI_cpp_type_make.hh.
References default_value(), EqualityComparable, Hashable, IdentityDefaultValue, Printable, and T.
|
virtualdefault |
|
inline |
Required memory alignment for an instance of this type.
C++ equivalent: alignof(T);
Definition at line 208 of file BLI_cpp_type.hh.
Referenced by ED_geometry_attribute_convert(), blender::GMutableVArraySpan::GMutableVArraySpan(), blender::GVArraySpan::GVArraySpan(), blender::bke::bake::read_blob_shared_simple_gspan(), and blender::tests::TEST().
|
inline |
Definition at line 630 of file BLI_cpp_type.hh.
|
inline |
Copy an instance of this type from src to dst.
C++ equivalent: dst = src;
Definition at line 394 of file BLI_cpp_type.hh.
References BLI_assert, and pointer_can_point_to_instance().
Referenced by blender::GVArrayImpl_For_GSpan::get(), blender::GVArrayImpl_For_SingleValueRef::get(), blender::GVArrayCommon::get_internal_single(), blender::GVVectorArray_For_GVectorArray::get_vector_element_impl(), blender::GVVectorArray_For_SingleGSpan::get_vector_element_impl(), blender::GVArrayImpl_For_GSpan::set_by_copy(), and blender::tests::TEST().
|
inline |
Similar to copy_assign_indices, but does not leave gaps in the #dst array.
Definition at line 419 of file BLI_cpp_type.hh.
References BLI_assert.
Referenced by blender::GVArrayImpl_For_GSpan::materialize_compressed(), and blender::tests::TEST().
|
inline |
Definition at line 407 of file BLI_cpp_type.hh.
References BLI_assert.
Referenced by copy_assign_n(), blender::GVArrayImpl_For_GSpan::materialize(), and blender::tests::TEST().
|
inline |
Definition at line 402 of file BLI_cpp_type.hh.
References copy_assign_indices().
Referenced by blender::GMutableSpan::copy_from(), blender::geometry::fill_new_attribute(), blender::bke::bake::load_attributes(), blender::GVMutableArrayImpl::set_all(), blender::geometry::smooth_curve_attribute(), and blender::tests::TEST().
|
inline |
Copy an instance of this type from src to dst.
The memory pointed to by dst should be uninitialized.
C++ equivalent: new (dst) T(src);
Definition at line 436 of file BLI_cpp_type.hh.
References BLI_assert, and pointer_can_point_to_instance().
Referenced by blender::GVectorArray::append(), blender::bke::DataTypeConversions::convert_to_uninitialized(), blender::bke::bake::default_initialize_socket_value(), blender::GVArrayImpl_For_GSpan::get_to_uninitialized(), blender::GVArrayImpl_For_SingleValueRef::get_to_uninitialized(), blender::nodes::LazyFunctionForReduceForeachGeometryElement::handle_main_items_and_geometry(), blender::GVMutableArrayImpl::set_by_copy(), blender::nodes::set_default_value_for_output_socket(), and blender::tests::TEST().
|
inline |
Similar to copy_construct_indices, but does not leave gaps in the #dst array.
Definition at line 462 of file BLI_cpp_type.hh.
References BLI_assert.
Referenced by blender::GVArrayImpl_For_GSpan::materialize_compressed_to_uninitialized().
|
inline |
Definition at line 450 of file BLI_cpp_type.hh.
References BLI_assert.
Referenced by copy_construct_n(), blender::GVArrayImpl_For_GSpan::materialize_to_uninitialized(), and blender::tests::TEST().
|
inline |
Definition at line 445 of file BLI_cpp_type.hh.
References copy_construct_indices().
Referenced by blender::tests::TEST().
|
inline |
Call the default constructor at the given memory location. The memory should be uninitialized before this method is called. For some trivial types (like int), this method does nothing.
C++ equivalent: new (ptr) T;
Definition at line 317 of file BLI_cpp_type.hh.
References BLI_assert, pointer_can_point_to_instance(), and ptr.
Referenced by blender::GVArrayCommon::get_internal_single_to_uninitialized(), blender::GVArray_For_GVVectorArrayIndex::get_to_uninitialized(), blender::geometry::reverse_order(), blender::tests::TEST(), and blender::tests::TEST().
|
inline |
Definition at line 329 of file BLI_cpp_type.hh.
References BLI_assert, and ptr.
Referenced by default_construct_n(), and blender::tests::TEST().
|
inline |
Definition at line 324 of file BLI_cpp_type.hh.
References default_construct_indices().
Referenced by blender::GMutableVArraySpan::GMutableVArraySpan(), blender::GArray< Allocator >::reinitialize(), and blender::tests::TEST().
|
inline |
Get a pointer to a constant value of this type. The specific value depends on the type. It is usually a zero-initialized or default constructed value.
Definition at line 678 of file BLI_cpp_type.hh.
Referenced by blender::nodes::node_geo_menu_switch_cc::MenuSwitchFn::call(), blender::bke::SocketValueVariant::convert_to_single(), CPPType(), blender::geometry::execute_instances_tasks(), blender::bke::SocketValueVariant::extract(), and print_or_default().
|
inline |
Call the destructor on the given instance of this type. The pointer must not be nullptr.
For some trivial types, this does nothing.
C++ equivalent: ptr->~T();
Definition at line 369 of file BLI_cpp_type.hh.
References BLI_assert, pointer_can_point_to_instance(), and ptr.
Referenced by blender::ed::space_node::create_inspection_string_for_default_socket_value(), blender::ed::space_node::create_inspection_string_for_generic_value(), blender::fn::multi_function::VariableState::destruct(), blender::GMutablePointer::destruct(), blender::GVectorArray::extend(), blender::GVArrayImpl::get(), blender::bke::AttributeFieldInput::get_varray_for_context(), blender::bke::EvaluateOnDomainInput::get_varray_for_context(), blender::ed::mesh::set_attribute::mesh_set_attribute_exec(), blender::bke::node_socket_move_default_value(), blender::nodes::node_geo_bake_cc::LazyFunctionForBakeNode::output_mixed_cached_state(), blender::nodes::node_geo_simulation_cc::sim_output_node::LazyFunctionForSimulationOutputNode::output_mixed_cached_state(), blender::fn::multi_function::ValueAllocator::release_value(), blender::geometry::reverse_order(), blender::ed::curves::set_attribute_exec(), blender::GVMutableArrayImpl::set_by_copy(), blender::GVMutableArrayImpl::set_by_relocate(), blender::tests::TEST(), blender::nodes::geo_eval_log::GeoTreeLog::try_convert_primitive_socket_value(), blender::fn::FieldConstant::~FieldConstant(), blender::GVArrayImpl_For_SingleValue::~GVArrayImpl_For_SingleValue(), and blender::bke::bake::PrimitiveBakeItem::~PrimitiveBakeItem().
|
inline |
Definition at line 381 of file BLI_cpp_type.hh.
References BLI_assert, and ptr.
Referenced by blender::fn::multi_function::VariableState::destruct(), destruct_n(), and blender::tests::TEST().
|
inline |
Definition at line 376 of file BLI_cpp_type.hh.
References destruct_indices().
Referenced by blender::GVectorArray::clear(), blender::bke::DataTypeConversions::convert_to_initialized_n(), blender::GArray< Allocator >::reinitialize(), blender::tests::TEST(), blender::GArray< Allocator >::~GArray(), blender::GMutableVArraySpan::~GMutableVArraySpan(), blender::GVArraySpan::~GVArraySpan(), and blender::GVectorArray::~GVectorArray().
|
inline |
Definition at line 604 of file BLI_cpp_type.hh.
References BLI_assert.
Referenced by fill_assign_n(), blender::GVArrayImpl_For_SingleValueRef::materialize(), blender::ed::curves::set_attribute_exec(), and blender::tests::TEST().
|
inline |
Copy the given value to the first n elements in an array starting at dst.
Other instances of the same type should live in the array before this method is called.
Definition at line 599 of file BLI_cpp_type.hh.
References fill_assign_indices().
Referenced by blender::geometry::convert_curves_to_catmull_rom_or_poly(), blender::geometry::execute_instances_tasks(), blender::GVMutableArray::fill(), blender::GVArrayImpl_For_SingleValueRef::materialize_compressed(), and blender::tests::TEST().
|
inline |
Definition at line 622 of file BLI_cpp_type.hh.
References BLI_assert.
Referenced by blender::fn::multi_function::CustomMF_DefaultOutput::call(), blender::fn::multi_function::CustomMF_GenericConstant::call(), blender::nodes::node_geo_menu_switch_cc::MenuSwitchFn::call(), fill_construct_n(), blender::GVArrayImpl_For_SingleValueRef::materialize_to_uninitialized(), and blender::tests::TEST().
|
inline |
Copy the given value to the first n elements in an array starting at dst.
The array should be uninitialized before this method is called.
Definition at line 617 of file BLI_cpp_type.hh.
References fill_construct_indices().
Referenced by blender::GVArrayImpl_For_SingleValueRef::materialize_compressed_to_uninitialized(), and blender::tests::TEST().
Get the CPPType that corresponds to a specific static type. This only works for types that actually implement the template specialization using BLI_CPP_TYPE_MAKE.
Definition at line 174 of file BLI_cpp_type.hh.
References get_impl().
Referenced by blender::bke::MutableAttributeAccessor::add(), blender::bke::add_implicit_conversion(), blender::fn::multi_function::ParamsBuilder::add_readonly_single_input(), blender::fn::multi_function::ParamsBuilder::add_readonly_single_input_value(), blender::fn::multi_function::ProcedureBuilder::add_single_input_parameter(), blender::fn::multi_function::ProcedureBuilder::add_single_mutable_parameter(), blender::fn::multi_function::ParamsBuilder::add_uninitialized_single_output(), blender::fn::lazy_function::tests::AddLazyFunction::AddLazyFunction(), blender::bke::AttributeExistsFieldInput::Create(), blender::bke::AttributeFieldInput::Create(), blender::ed::space_node::create_inspection_string_for_generic_value(), blender::bke::custom_data_type_to_cpp_type(), blender::fn::multi_function::CustomMF_Constant< T >::equals(), blender::fn::lazy_function::detail::execute_lazy_function_eagerly_impl(), blender::nodes::GeoNodeExecParams::extract_input(), blender::nodes::geo_eval_log::GeoTreeLog::find_primitive_socket_value(), blender::fn::multi_function::DataType::ForSingle(), blender::fn::multi_function::DataType::ForVector(), blender::bke::AttributeIter::get(), blender::nodes::GeoNodeExecParams::get_input(), blender::bke::get_mutable_attribute(), blender::bke::greasepencil::get_mutable_attribute(), blender::bke::get_span_attribute(), blender::bke::get_varray_attribute(), blender::GVArray::GVArray(), blender::GVMutableArray::GVMutableArray(), is(), blender::nodes::LazyFunctionForGeometryNode::LazyFunctionForGeometryNode(), blender::nodes::LazyFunctionForGizmoNode::LazyFunctionForGizmoNode(), blender::nodes::node_geo_index_switch_cc::LazyFunctionForIndexSwitchNode::LazyFunctionForIndexSwitchNode(), blender::nodes::node_geo_menu_switch_cc::LazyFunctionForMenuSwitchNode::LazyFunctionForMenuSwitchNode(), blender::nodes::node_geo_menu_switch_cc::LazyFunctionForMenuSwitchSocketUsage::LazyFunctionForMenuSwitchSocketUsage(), blender::nodes::LazyFunctionForMultiFunctionConversion::LazyFunctionForMultiFunctionConversion(), blender::nodes::LazyFunctionForReduceForeachGeometryElement::LazyFunctionForReduceForeachGeometryElement(), blender::nodes::node_geo_simulation_cc::sim_input_node::LazyFunctionForSimulationInputNode::LazyFunctionForSimulationInputNode(), blender::nodes::node_geo_switch_cc::LazyFunctionForSwitchNode::LazyFunctionForSwitchNode(), blender::nodes::LazyFunctionForViewerInputUsage::LazyFunctionForViewerInputUsage(), blender::nodes::node_geo_warning_cc::LazyFunctionForWarningNode::LazyFunctionForWarningNode(), blender::bke::AttributeAccessor::lookup(), blender::bke::MutableAttributeAccessor::lookup_or_add_for_write(), blender::fn::make_constant_field(), make_socket_type_bool(), make_socket_type_collection(), make_socket_type_float(), make_socket_type_geometry(), make_socket_type_image(), make_socket_type_int(), make_socket_type_material(), make_socket_type_matrix(), make_socket_type_menu(), make_socket_type_object(), make_socket_type_rgba(), make_socket_type_rotation(), make_socket_type_string(), make_socket_type_texture(), make_socket_type_vector(), blender::ed::mesh::set_attribute::mesh_set_attribute_exec(), blender::nodes::node_geo_sample_uv_surface_cc::node_geo_exec(), blender::fn::FieldOperation::output_cpp_type(), blender::fn::lazy_function::tests::PartialEvaluationTestFunction::PartialEvaluationTestFunction(), blender::bke::bake::read_blob_shared_simple_span(), blender::ed::curves::set_attribute_exec(), blender::nodes::GeoNodeExecParams::set_output(), blender::fn::multi_function::SignatureBuilder::single_input(), blender::fn::multi_function::SignatureBuilder::single_mutable(), blender::fn::multi_function::SignatureBuilder::single_output(), blender::bke::socket_type_to_geo_nodes_base_cpp_type(), blender::fn::lazy_function::tests::StoreValueFunction::StoreValueFunction(), blender::fn::lazy_function::tests::TEST(), blender::fn::lazy_function::tests::TEST(), blender::fn::multi_function::tests::TEST(), blender::fn::multi_function::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), to_static_type(), blender::fn::multi_function::SignatureBuilder::vector_input(), blender::fn::multi_function::SignatureBuilder::vector_mutable(), and blender::fn::multi_function::SignatureBuilder::vector_output().
Referenced by get().
|
inline |
Returns true, when the type has the following functions:
Definition at line 291 of file BLI_cpp_type.hh.
|
inline |
Definition at line 683 of file BLI_cpp_type.hh.
References blender::get_default_hash().
Referenced by hash_or_fallback().
|
inline |
Definition at line 660 of file BLI_cpp_type.hh.
References BLI_assert, and pointer_can_point_to_instance().
|
inline |
Definition at line 666 of file BLI_cpp_type.hh.
References hash(), and is_hashable().
Referenced by blender::fn::multi_function::CustomMF_GenericConstant::hash().
|
inline |
Definition at line 693 of file BLI_cpp_type.hh.
References get().
Referenced by blender::ed::spreadsheet::apply_row_filter(), blender::ed::space_node::create_inspection_string_for_field_info(), blender::ed::space_node::create_inspection_string_for_generic_value(), blender::ed::curves::extrude_curves(), blender::GVectorArray_TypedMutableRef< T >::GVectorArray_TypedMutableRef(), blender::GMutablePointer::is_type(), blender::GPointer::is_type(), blender::tests::TEST(), blender::GVArrayCommon::try_assign_VArray(), blender::GVMutableArray::try_assign_VMutableArray(), blender::GMutableSpan::typed(), blender::GSpan::typed(), and blender::GVArray::typed().
|
inline |
Definition at line 698 of file BLI_cpp_type.hh.
|
inline |
Definition at line 257 of file BLI_cpp_type.hh.
|
inline |
Definition at line 242 of file BLI_cpp_type.hh.
|
inline |
Definition at line 237 of file BLI_cpp_type.hh.
|
inline |
Definition at line 252 of file BLI_cpp_type.hh.
|
inline |
Definition at line 645 of file BLI_cpp_type.hh.
References b, BLI_assert, and pointer_can_point_to_instance().
Referenced by blender::fn::multi_function::CustomMF_GenericConstant::equals(), and is_equal_or_false().
|
inline |
Definition at line 652 of file BLI_cpp_type.hh.
References b, is_equal(), and is_equality_comparable().
|
inline |
Definition at line 272 of file BLI_cpp_type.hh.
Referenced by is_equal_or_false().
|
inline |
Definition at line 277 of file BLI_cpp_type.hh.
Referenced by hash_or_fallback().
|
inline |
Definition at line 262 of file BLI_cpp_type.hh.
|
inline |
Definition at line 247 of file BLI_cpp_type.hh.
|
inline |
Definition at line 267 of file BLI_cpp_type.hh.
Referenced by print_or_default().
|
inline |
When true, the value is like a normal C type, it can be copied around with #memcpy and does not have to be destructed.
C++ equivalent: std::is_trivial_v<T>;
Definition at line 232 of file BLI_cpp_type.hh.
|
inline |
When true, the destructor does not have to be called on this type. This can sometimes be used for optimization purposes.
C++ equivalent: std::is_trivially_destructible_v<T>;
Definition at line 220 of file BLI_cpp_type.hh.
Referenced by blender::GVectorArray::~GVectorArray().
|
inline |
Move an instance of this type from src to dst.
The memory pointed to by dst should be initialized.
C++ equivalent: dst = std::move(src);
Definition at line 479 of file BLI_cpp_type.hh.
References BLI_assert, and pointer_can_point_to_instance().
Referenced by blender::geometry::reverse_order().
|
inline |
Definition at line 492 of file BLI_cpp_type.hh.
References BLI_assert.
Referenced by move_assign_n().
|
inline |
Definition at line 487 of file BLI_cpp_type.hh.
References move_assign_indices().
|
inline |
Move an instance of this type from src to dst.
The memory pointed to by dst should be uninitialized.
C++ equivalent: new (dst) T(std::move(src));
Definition at line 509 of file BLI_cpp_type.hh.
References BLI_assert, and pointer_can_point_to_instance().
Referenced by blender::nodes::LazyFunctionForRerouteNode::execute_impl(), blender::nodes::node_geo_menu_switch_cc::LazyFunctionForMenuSwitchNode::execute_single(), and blender::GVArrayImpl_For_GSpan::set_by_move().
|
inline |
Definition at line 523 of file BLI_cpp_type.hh.
References BLI_assert.
Referenced by move_construct_n().
|
inline |
Definition at line 518 of file BLI_cpp_type.hh.
References move_construct_indices().
|
inline |
Returns the name of the type for debugging purposes. This name should not be used as identifier.
Definition at line 186 of file BLI_cpp_type.hh.
Referenced by blender::bke::add_implicit_conversion(), blender::nodes::node_geo_switch_cc::LazyFunctionForSwitchNode::LazyFunctionForSwitchNode(), and blender::fn::multi_function::DataType::to_string().
|
inline |
Definition at line 304 of file BLI_cpp_type.hh.
References pointer_has_valid_alignment(), and ptr.
Referenced by copy_assign(), copy_construct(), default_construct(), destruct(), hash(), is_equal(), move_assign(), move_construct(), print(), relocate_assign(), relocate_construct(), and value_initialize().
|
inline |
Returns true, when the given pointer fulfills the alignment requirement of this type.
Definition at line 299 of file BLI_cpp_type.hh.
References ptr.
Referenced by pointer_can_point_to_instance().
|
inline |
Definition at line 635 of file BLI_cpp_type.hh.
References BLI_assert, and pointer_can_point_to_instance().
Referenced by print_or_default(), blender::tests::TEST(), and to_string().
| void blender::CPPType::print_or_default | ( | const void * | value, |
| std::stringstream & | ss, | ||
| StringRef | default_value ) const |
Definition at line 18 of file cpp_type.cc.
References default_value(), is_printable(), and print().
|
inline |
Relocates an instance of this type from src to dst. src will point to uninitialized memory afterwards.
C++ equivalent: dst = std::move(src); src->~T();
Definition at line 540 of file BLI_cpp_type.hh.
References BLI_assert, and pointer_can_point_to_instance().
Referenced by blender::GMutablePointer::relocate_out(), blender::GVArrayImpl_For_GSpan::set_by_relocate(), and blender::tests::TEST().
|
inline |
Definition at line 554 of file BLI_cpp_type.hh.
References BLI_assert.
Referenced by relocate_assign_n(), and blender::tests::TEST().
|
inline |
Definition at line 549 of file BLI_cpp_type.hh.
References relocate_assign_indices().
Referenced by blender::tests::TEST().
|
inline |
Relocates an instance of this type from src to dst. src will point to uninitialized memory afterwards.
C++ equivalent: new (dst) T(std::move(src)) src->~T();
Definition at line 571 of file BLI_cpp_type.hh.
References BLI_assert, and pointer_can_point_to_instance().
Referenced by blender::tests::TEST().
|
inline |
Definition at line 585 of file BLI_cpp_type.hh.
References BLI_assert.
Referenced by relocate_construct_n(), and blender::tests::TEST().
|
inline |
Definition at line 580 of file BLI_cpp_type.hh.
References relocate_construct_indices().
Referenced by blender::tests::TEST().
|
inline |
Required memory in bytes for an instance of this type.
C++ equivalent: sizeof(T);
Definition at line 197 of file BLI_cpp_type.hh.
Referenced by blender::GVArrayImpl_For_SlicedGVArray::common_info(), blender::GMutableSpan::drop_front(), blender::GSpan::drop_front(), ED_geometry_attribute_convert(), blender::bke::evaluate_attribute(), blender::GVMutableArray::get_internal_span(), blender::GMutableVArraySpan::GMutableVArraySpan(), blender::GVArray::GVArray(), blender::GVArraySpan::GVArraySpan(), blender::nodes::geo_eval_log::GeoTreeLogger::log_value(), blender::GVArrayImpl::materialize(), blender::GVArrayImpl_For_SlicedGVArray::materialize(), blender::GVArrayImpl::materialize_compressed(), blender::GVArrayImpl::materialize_compressed_to_uninitialized(), blender::GVArrayImpl::materialize_to_uninitialized(), blender::GVArrayImpl_For_SlicedGVArray::materialize_to_uninitialized(), blender::GArray< Allocator >::operator[](), blender::GArray< Allocator >::operator[](), blender::GMutableSpan::operator[](), blender::GSpan::operator[](), blender::bke::bake::read_blob_shared_simple_gspan(), blender::GVMutableArrayImpl::set_all(), blender::GMutableSpan::size_in_bytes(), blender::GSpan::size_in_bytes(), blender::GMutableSpan::slice(), blender::GSpan::slice(), blender::GMutableSpan::take_back(), blender::GSpan::take_back(), and blender::tests::TEST().
|
inline |
Convert a CPPType that is only known at run-time, to a static type that is known at compile-time. This allows the compiler to optimize a function for specific types, while all other types can still use a generic fallback function.
| Types | The types that code should be generated for. |
| fn | The function object to call. This is expected to have a templated operator() and a non-templated operator(). The templated version will be called if the current CPPType matches any of the given types. Otherwise, the non-templated function is called. |
Definition at line 713 of file BLI_cpp_type.hh.
References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add_new(), callback, get(), and blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_default().
Referenced by to_static_type_tag().
|
inline |
Similar to to_static_type but is easier to use with a lambda function. The function is expected to take a single auto TypeTag parameter. To extract the static type, use: using T = typename decltype(TypeTag)type;
If the current CPPType is not in #Types, the type tag is void.
Definition at line 764 of file BLI_cpp_type.hh.
References to_static_type().
Referenced by blender::bke::attribute_math::convert_to_static_type(), blender::nodes::LazyFunctionForMultiInput::execute_impl(), blender::nodes::node_geo_switch_cc::LazyFunctionForSwitchNode::get_switch_multi_function(), and blender::tests::TEST().
| std::string blender::CPPType::to_string | ( | const void * | value | ) | const |
Definition at line 11 of file cpp_type.cc.
References print().
Referenced by blender::fn::lazy_function::Graph::to_dot().
|
inline |
Same as default_construct, but does zero initialization for trivial types.
C++ equivalent: new (ptr) T();
Definition at line 342 of file BLI_cpp_type.hh.
References BLI_assert, pointer_can_point_to_instance(), and ptr.
Referenced by blender::bke::bake::default_initialize_socket_value(), blender::fn::evaluate_constant_field(), blender::bke::node_socket_move_default_value(), blender::nodes::set_default_value_for_output_socket(), blender::tests::TEST(), and blender::tests::TEST().
|
inline |
Definition at line 354 of file BLI_cpp_type.hh.
References BLI_assert, and ptr.
Referenced by blender::nodes::node_geo_sample_index_cc::SampleIndexFunction::call(), blender::nodes::LazyFunctionForReduceForeachGeometryElement::handle_main_items_and_geometry(), blender::tests::TEST(), and value_initialize_n().
|
inline |
Definition at line 349 of file BLI_cpp_type.hh.
References value_initialize_indices().
Referenced by blender::tests::TEST().
Definition at line 164 of file BLI_cpp_type.hh.
Two types only compare equal when their pointer is equal. No two instances of CPPType for the same C++ type should be created.
Definition at line 159 of file BLI_cpp_type.hh.
|
inline |
Definition at line 688 of file BLI_cpp_type.hh.