|
Blender V5.3
|
#include <BLI_cpp_type.hh>
Inherits blender::blender::NonCopyable, and blender::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 |
| bool | is_printable () const |
| bool | is_equality_comparable () const |
| bool | is_hashable () 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 |
| void | hash_unique (const void *value, UniqueHashBytes &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> | |
| bool | to_static_type_try (Fn &&fn) const |
| template<typename... Types, typename Fn> | |
| void | to_static_type (Fn &&fn) const |
Static Public Member Functions | |
| template<typename T> | |
| static const CPPType & | get () |
| template<typename T> | |
| static const CPPType * | get_pre_register () |
| template<> | |
| const CPPType & | get ()=delete |
Public Attributes | |
| int64_t | size = 0 |
| int64_t | alignment = 0 |
| bool | is_trivial = false |
| bool | is_trivially_destructible = false |
| bool | has_special_member_functions = false |
| bool | is_default_constructible = false |
| bool | is_copy_constructible = false |
| bool | is_move_constructible = false |
| bool | is_destructible = false |
| bool | is_copy_assignable = false |
| bool | is_move_assignable = false |
| const CPPType * | base_type = nullptr |
| const CPPType * | generic_type = nullptr |
| int | type_index = -1 |
| void(*)(void *) | destruct_fn () const |
Definition at line 106 of file BLI_cpp_type.hh.
| blender::CPPType::CPPType | ( | TypeTag< T > | , |
| TypeForValue< CPPTypeFlags, Flags > | , | ||
| StringRef | debug_name ) |
Definition at line 338 of file BLI_cpp_type_make.hh.
References alignment, base_type, default_value(), blender::EqualityComparable, generic_type, get_pre_register(), has_special_member_functions, blender::Hashable, blender::IdentityDefaultValue, is_copy_assignable, is_copy_constructible, is_default_constructible, is_destructible, is_move_assignable, is_move_constructible, is_trivial, is_trivially_destructible, blender::Printable, size, T, and type_index.
Referenced by get(), get(), get_pre_register(), blender::detail::register_cpp_type(), and ~CPPType().
|
virtualdefault |
References b, can_exist_in_buffer(), copy_assign(), copy_assign_compressed(), copy_assign_indices(), copy_assign_n(), copy_construct(), copy_construct_compressed(), copy_construct_indices(), copy_construct_n(), CPPType(), default_construct(), default_construct_indices(), default_construct_n(), default_value(), destruct(), destruct_indices(), destruct_n(), fill_assign_indices(), fill_assign_n(), fill_construct_indices(), fill_construct_n(), get(), get_pre_register(), hash(), hash_or_fallback(), hash_unique(), is_equal(), is_equal_or_false(), is_equality_comparable(), is_hashable(), is_printable(), move_assign(), move_assign_indices(), move_assign_n(), move_construct(), move_construct_indices(), move_construct_n(), name(), pointer_can_point_to_instance(), pointer_has_valid_alignment(), print(), print_or_default(), relocate_assign(), relocate_assign_indices(), relocate_assign_n(), relocate_construct(), relocate_construct_indices(), relocate_construct_n(), to_string(), value_initialize(), value_initialize_indices(), and value_initialize_n().
|
inline |
Definition at line 700 of file BLI_cpp_type.hh.
Referenced by blender::fn::multi_function::ValueAllocator::obtain_OneSingle(), blender::fn::multi_function::ValueAllocator::obtain_Span(), blender::fn::multi_function::ValueAllocator::release_value(), and ~CPPType().
|
inline |
Copy an instance of this type from src to dst.
C++ equivalent: dst = src;
Definition at line 572 of file BLI_cpp_type.hh.
Referenced by blender::ed::mesh::set_attribute::bmesh_loop_layer_selected_values_set(), blender::ed::mesh::set_attribute::bmesh_vert_edge_face_layer_selected_values_set(), 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(), blender::ed::curves::validate_value(), blender::ed::pointcloud::validate_value(), and ~CPPType().
|
inline |
Similar to copy_assign_indices, but does not leave gaps in the #dst array.
Definition at line 587 of file BLI_cpp_type.hh.
Referenced by blender::GVArrayImpl_For_GSpan::materialize_compressed(), and ~CPPType().
|
inline |
Definition at line 582 of file BLI_cpp_type.hh.
Referenced by blender::GVArrayImpl_For_GSpan::materialize(), and ~CPPType().
|
inline |
Definition at line 577 of file BLI_cpp_type.hh.
Referenced by blender::GMutableSpan::copy_from(), blender::bke::bake::load_attributes(), blender::GVMutableArrayImpl::set_all(), blender::geometry::smooth_curve_attribute(), and ~CPPType().
|
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 594 of file BLI_cpp_type.hh.
Referenced by blender::GValueMap< Key >::add_new_by_copy(), blender::bke::DataTypeConversions::convert_to_uninitialized(), blender::bke::subdiv::copy_attrs(), blender::fn::multi_function::CustomMF_GenericConstant::CustomMF_GenericConstant(), blender::nodes::execute_multi_function_on_value_variant__list_individual(), blender::nodes::GList::SingleData::ForValue(), blender::fn::GField::from_constant(), blender::GVArrayImpl_For_GSpan::get_to_uninitialized(), blender::GVArrayImpl_For_SingleValueRef::get_to_uninitialized(), blender::GVArrayImpl_For_SingleValue::GVArrayImpl_For_SingleValue(), blender::GVArrayImpl_For_SmallTrivialSingleValue< BufferSize >::GVArrayImpl_For_SmallTrivialSingleValue(), blender::nodes::LazyFunctionForReduceForeachGeometryElement::handle_main_items_and_geometry(), blender::nodes::eval_log::NodeTreeLogger::log_value(), blender::bke::mesh_apply_spatial_organization(), blender::GVMutableArrayImpl::set_by_copy(), blender::bke::subdiv::subdiv_copy_edge_data(), and ~CPPType().
|
inline |
Similar to copy_construct_indices, but does not leave gaps in the #dst array.
Definition at line 611 of file BLI_cpp_type.hh.
Referenced by blender::bke::LegacyMeshInterpolator::copy(), blender::GVArrayImpl_For_GSpan::materialize_compressed(), and ~CPPType().
|
inline |
Definition at line 604 of file BLI_cpp_type.hh.
Referenced by blender::GVArrayImpl_For_GSpan::materialize(), and ~CPPType().
|
inline |
Definition at line 599 of file BLI_cpp_type.hh.
Referenced by blender::nodes::create_repeated_list(), blender::geometry::fill_new_attribute(), blender::nodes::node_geo_geometry_materials::node_geo_exec(), blender::geometry::reorder_attribute_groups(), blender::bke::AttributeStorage::resize(), blender::shrink_attribute_storage(), blender::nodes::GList::ArrayData::span_for_write(), and ~CPPType().
|
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 527 of file BLI_cpp_type.hh.
Referenced by blender::GVArray_For_GVVectorArrayIndex::get_to_uninitialized(), blender::ed::greasepencil::insert_selected_values(), blender::geometry::prepare_attribute_fallbacks(), blender::geometry::reverse_order(), blender::ed::greasepencil::select_similar_by_value(), blender::tests::TEST_F(), and ~CPPType().
|
inline |
Definition at line 537 of file BLI_cpp_type.hh.
Referenced by blender::fn::evaluate_fields(), and ~CPPType().
|
inline |
Definition at line 532 of file BLI_cpp_type.hh.
Referenced by blender::bke::Attribute::ArrayData::from_constructed(), blender::GArray< Allocator >::reinitialize(), blender::bke::AttributeStorage::resize(), and ~CPPType().
|
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 743 of file BLI_cpp_type.hh.
Referenced by blender::geometry::construct::build_output_mesh(), blender::fn::multi_function::CustomMF_DefaultOutput::call(), blender::nodes::node_geo_index_switch_cc::IndexSwitchFunction::call(), CPPType(), blender::bke::default_value_for_type(), blender::compositor::MultiFunctionProcedureOperation::execute(), blender::geometry::execute_instances_tasks(), blender::nodes::execute_multi_function_on_value_variant__list(), blender::nodes::execute_multi_function_on_value_variant__list_individual(), blender::nodes::node_geo_extrude_mesh_cc::extrude_mesh_edges(), blender::nodes::GList::ArrayData::ForDefaultValue(), blender::nodes::GList::SingleData::ForDefaultValue(), blender::GVArray::from_single_default(), blender::bke::get_default_for_fill(), blender::bke::get_mutable_attribute(), blender::compositor::Result::get_single_value_default(), blender::fn::GField::GField(), blender::bke::initialize_new_data(), blender::geometry::construct::interpolate_new_corner_attribute_from_faces(), blender::bke::AttributeAccessor::lookup_or_default(), blender::bke::mesh_calc_edges(), blender::nodes::node_geo_extrude_mesh_cc::mixing_default_value(), print_or_default(), blender::bke::subdiv::subdiv_copy_edge_data(), blender::nodes::node_geo_transfer_attributes_cc::transfer_attributes(), blender::geometry::try_join_single_value_attribute(), blender::geometry::construct::try_propagate_single_value(), blender::bke::validate_float_attribute(), and ~CPPType().
|
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 557 of file BLI_cpp_type.hh.
Referenced by blender::ResourceScope::allocate_owned(), blender::fn::multi_function::tests::GenericAppendFunction::call(), blender::fn::multi_function::VariableState::destruct(), blender::ed::spreadsheet::SpreadsheetLayoutDrawer::draw_content_cell(), blender::nodes::node_geo_viewer_cc::draw_generic_value_log(), blender::geometry_attribute_get_tarmat(), blender::GVArrayImpl::get(), blender::bke::AttributeFieldInput::get_varray_for_context(), blender::bke::EvaluateOnDomainInput::get_varray_for_context(), blender::nodes::LazyFunctionForReduceForeachGeometryElement::handle_generation_items_group(), blender::fn::make_field_constant_if_possible(), blender::ed::mesh::set_attribute::mesh_set_attribute_exec(), blender::bke::node_socket_move_default_value(), blender::fn::multi_function::ValueAllocator::release_value(), blender::geometry::reverse_order(), blender::ed::curves::set_attribute_exec(), blender::ed::pointcloud::set_attribute_exec(), blender::ed::curves::set_attribute_invoke(), blender::ed::pointcloud::set_attribute_invoke(), blender::GVMutableArrayImpl::set_by_copy(), blender::GVMutableArrayImpl::set_by_relocate(), blender::bke::detail::SocketValueVariantTypeInfo::try_convert_fn(), blender::nodes::eval_log::NodeTreeLog::try_convert_primitive_socket_value(), blender::ed::curves::validate_value(), blender::ed::pointcloud::validate_value(), ~CPPType(), and blender::GVArrayImpl_For_SingleValue::~GVArrayImpl_For_SingleValue().
|
inline |
Definition at line 567 of file BLI_cpp_type.hh.
Referenced by blender::fn::multi_function::VariableState::destruct(), blender::fn::evaluate_fields(), and ~CPPType().
|
inline |
Definition at line 562 of file BLI_cpp_type.hh.
Referenced by blender::GArray< Allocator >::reinitialize(), ~CPPType(), blender::GArray< Allocator >::~GArray(), blender::GMutableVArraySpan::~GMutableVArraySpan(), and blender::GVArraySpan::~GVArraySpan().
|
inline |
Definition at line 683 of file BLI_cpp_type.hh.
Referenced by blender::geometry::construct::build_output_mesh(), blender::ed::greasepencil::grease_pencil_join_fills_exec(), blender::geometry::construct::interpolate_new_corner_attribute_from_faces(), blender::GVArrayImpl_For_SingleValueRef::materialize(), blender::nodes::node_geo_extrude_mesh_cc::mix_groups_or_default(), blender::ed::curves::set_attribute_exec(), blender::ed::pointcloud::set_attribute_exec(), blender::bke::validate_float_attribute(), and ~CPPType().
|
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 678 of file BLI_cpp_type.hh.
Referenced by blender::nodes::node_composite_file_output_cc::FileOutputOperation::add_pass_for_result(), blender::geometry::convert_curves_to_catmull_rom_or_poly(), blender::GVMutableArray::fill(), blender::bke::fill_attribute_range_default(), blender::bke::curves::fill_points(), blender::nodes::LazyFunctionForReduceForeachGeometryElement::handle_generation_items_group(), blender::GVArrayImpl_For_SingleValueRef::materialize_compressed(), and ~CPPType().
|
inline |
Definition at line 693 of file BLI_cpp_type.hh.
Referenced by blender::fn::multi_function::CustomMF_DefaultOutput::call(), blender::nodes::node_geo_index_switch_cc::IndexSwitchFunction::call(), blender::fn::multi_function::VariableState::ensure_is_mutable(), blender::GVArrayImpl_For_SingleValueRef::materialize(), blender::nodes::node_geo_transfer_attributes_cc::transfer_attributes(), and ~CPPType().
|
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 688 of file BLI_cpp_type.hh.
Referenced by blender::bke::copy_attributes_group_to_group(), blender::nodes::GList::ArrayData::ForValue(), blender::bke::Attribute::ArrayData::from_value(), blender::bke::initialize_new_data(), blender::GVArrayImpl_For_SingleValueRef::materialize_compressed(), blender::bke::mesh_calc_edges(), and ~CPPType().
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_REGISTER.
Definition at line 481 of file BLI_cpp_type.hh.
References blender::BLI_assert(), blender::detail::cpp_type_impl, CPPType(), and blender::detail::is_cpp_type_registered.
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::attribute_type_to_cpp_type(), blender::bke::MutableAttributeAccessor::convert_or_add_for_write(), blender::compositor::Result::cpp_type(), blender::bke::custom_data_type_to_cpp_type(), blender::bke::bake::deserialize_value_list(), blender::fn::multi_function::CustomMF_Constant< T >::equals(), blender::fn::FieldEvaluator::evaluate(), blender::nodes::evaluate_closure_eagerly(), blender::nodes::LazyFunctionForClosureZone::execute_impl(), blender::fn::lazy_function::detail::execute_lazy_function_eagerly_impl(), blender::fn::Field< T >::Field(), blender::bke::CurvesGeometry::fill_curve_types(), blender::nodes::eval_log::NodeTreeLog::find_primitive_socket_value(), blender::nodes::node_fn_format_string_cc::format_strings(), blender::fn::multi_function::DataType::ForSingle(), blender::fn::multi_function::DataType::ForVector(), blender::bke::AttributeExistsFieldInput::from(), blender::bke::AttributeFieldInput::from(), blender::nodes::GList::from_container(), blender::bke::AttributeIter::get(), blender::bke::SocketValueVariant::get(), blender::bke::SocketValueVariant::get(), blender::bke::AttributeFieldInput::get_field(), blender::bke::SocketValueVariant::get_if(), blender::compositor::get_input_socket_value(), blender::bke::get_mutable_attribute(), blender::nodes::node_fn_format_string_cc::get_pattern_by_type(), blender::bke::get_span_attribute(), blender::bke::get_varray_attribute(), blender::GVArray::GVArray(), blender::GVMutableArray::GVMutableArray(), blender::fn::multi_function::CustomMF_Constant< T >::hash_unique(), blender::bke::SocketValueVariant::init_default(), blender::nodes::initialize_zone_wrapper(), blender::ed::greasepencil::insert_selected_values(), is(), blender::bke::detail::SocketValueVariantTypeInfo::is_interpretable_as_fn(), blender::nodes::lazy_function_interface_from_node(), blender::nodes::LazyFunctionForBakeInputsUsage::LazyFunctionForBakeInputsUsage(), blender::nodes::node_geo_bake_cc::LazyFunctionForBakeNode::LazyFunctionForBakeNode(), blender::nodes::LazyFunctionForClosureZone::LazyFunctionForClosureZone(), blender::nodes::node_geo_enable_output_cc::LazyFunctionForEnableOutputNode::LazyFunctionForEnableOutputNode(), blender::nodes::LazyFunctionForEnableOutputSocketUsage::LazyFunctionForEnableOutputSocketUsage(), blender::nodes::LazyFunctionForExtractingReferenceSet::LazyFunctionForExtractingReferenceSet(), blender::nodes::LazyFunctionForGeometryNode::LazyFunctionForGeometryNode(), blender::nodes::LazyFunctionForGizmoInputsUsage::LazyFunctionForGizmoInputsUsage(), blender::nodes::LazyFunctionForGizmoNode::LazyFunctionForGizmoNode(), blender::nodes::LazyFunctionForImplicitConversion::LazyFunctionForImplicitConversion(), blender::nodes::LazyFunctionForImplicitSceneFrame< T >::LazyFunctionForImplicitSceneFrame(), blender::nodes::LazyFunctionForImplicitSelfObject::LazyFunctionForImplicitSelfObject(), blender::nodes::node_geo_index_switch_cc::LazyFunctionForIndexSwitchNode::LazyFunctionForIndexSwitchNode(), blender::nodes::LazyFunctionForIndexSwitchSocketUsage::LazyFunctionForIndexSwitchSocketUsage(), blender::nodes::LazyFunctionForJoinReferenceSets::LazyFunctionForJoinReferenceSets(), blender::nodes::LazyFunctionForLogicalOr::LazyFunctionForLogicalOr(), blender::nodes::node_geo_menu_switch_cc::LazyFunctionForMenuSwitchNode::LazyFunctionForMenuSwitchNode(), blender::nodes::node_geo_menu_switch_cc::LazyFunctionForMenuSwitchSocketUsage::LazyFunctionForMenuSwitchSocketUsage(), blender::nodes::LazyFunctionForMultiInput::LazyFunctionForMultiInput(), blender::nodes::LazyFunctionForRerouteNode::LazyFunctionForRerouteNode(), blender::nodes::node_geo_simulation_cc::sim_input_node::LazyFunctionForSimulationInputNode::LazyFunctionForSimulationInputNode(), blender::nodes::LazyFunctionForSimulationInputsUsage::LazyFunctionForSimulationInputsUsage(), blender::nodes::node_geo_simulation_cc::sim_output_node::LazyFunctionForSimulationOutputNode::LazyFunctionForSimulationOutputNode(), blender::nodes::node_geo_switch_cc::LazyFunctionForSwitchNode::LazyFunctionForSwitchNode(), blender::nodes::LazyFunctionForSwitchSocketUsage::LazyFunctionForSwitchSocketUsage(), blender::nodes::LazyFunctionForViewerInputUsage::LazyFunctionForViewerInputUsage(), blender::nodes::node_geo_warning_cc::LazyFunctionForWarningNode::LazyFunctionForWarningNode(), blender::nodes::node_geo_menu_switch_cc::LazyFunctionMenuSwitchBooleanOutputs::LazyFunctionMenuSwitchBooleanOutputs(), blender::bke::AttributeAccessor::lookup(), blender::bke::MutableAttributeAccessor::lookup_or_add_for_write(), blender::make_socket_type_bool(), blender::make_socket_type_bundle(), blender::make_socket_type_closure(), blender::make_socket_type_collection(), blender::make_socket_type_float(), blender::make_socket_type_font(), blender::make_socket_type_geometry(), blender::make_socket_type_image(), blender::make_socket_type_int(), blender::make_socket_type_int_vector(), blender::make_socket_type_mask(), blender::make_socket_type_material(), blender::make_socket_type_matrix(), blender::make_socket_type_menu(), blender::make_socket_type_object(), blender::make_socket_type_rgba(), blender::make_socket_type_rotation(), blender::make_socket_type_scene(), blender::make_socket_type_sound(), blender::make_socket_type_string(), blender::make_socket_type_text(), blender::make_socket_type_texture(), blender::make_socket_type_vector(), blender::ed::mesh::set_attribute::mesh_set_attribute_exec(), blender::nodes::node_geo_geometry_materials::node_geo_exec(), blender::fn::FieldOperation::output_cpp_type(), blender::fn::lazy_function::tests::PartialEvaluationTestFunction::PartialEvaluationTestFunction(), blender::geometry::points_rasterize_attribute_type(), blender::geometry::points_rasterize_grid_type(), blender::bke::bake::read_blob_shared_simple_span(), blender::ed::greasepencil::select_similar_by_value(), blender::ed::curves::set_attribute_exec(), blender::ed::pointcloud::set_attribute_exec(), blender::fn::multi_function::SignatureBuilder::single_input(), blender::fn::multi_function::SignatureBuilder::single_mutable(), blender::fn::multi_function::SignatureBuilder::single_output(), blender::nodes::socket_type_info_by_static_type(), blender::bke::socket_type_to_geo_nodes_base_cpp_type(), blender::fn::lazy_function::tests::StoreValueFunction::StoreValueFunction(), blender::tests::TEST(), blender::bke::socket_value_visitor::tests::TEST_F(), blender::bke::tests::TEST_F(), blender::fn::lazy_function::tests::TEST_F(), blender::fn::lazy_function::tests::TEST_F(), blender::fn::multi_function::tests::TEST_F(), blender::fn::multi_function::tests::TEST_F(), blender::tests::TEST_F(), blender::tests::TEST_F(), blender::tests::TEST_F(), blender::tests::TEST_F(), blender::tests::TEST_F(), blender::tests::TEST_F(), blender::tests::TEST_F(), blender::tests::TEST_F(), blender::tests::TEST_F(), blender::tests::TEST_F(), blender::tests::TEST_F(), blender::tests::TEST_F(), blender::tests::TEST_F(), blender::tests::TEST_F(), blender::tests::TEST_F(), blender::tests::TEST_F(), blender::tests::TEST_F(), blender::tests::TEST_F(), blender::tests::TEST_F(), blender::tests::TEST_F(), to_static_type_try(), blender::bke::DataTypeConversions::try_convert(), blender::bke::SocketValueVariant::try_convert(), blender::bke::detail::SocketValueVariantTypeInfo::try_convert_fn(), blender::fn::multi_function::SignatureBuilder::vector_input(), blender::fn::multi_function::SignatureBuilder::vector_mutable(), blender::fn::multi_function::SignatureBuilder::vector_output(), and ~CPPType().
Version of CPPType::get that can be used before type registration code is called. The returned CPPType may not be constructed yet, but the pointer is valid already.
Definition at line 492 of file BLI_cpp_type.hh.
References blender::detail::cpp_type_impl, and CPPType().
Referenced by CPPType(), blender::bke::detail::SocketValueVariantTypeInfo::get(), and ~CPPType().
|
inline |
Definition at line 748 of file BLI_cpp_type.hh.
References blender::get_default_hash().
|
inline |
Definition at line 725 of file BLI_cpp_type.hh.
Referenced by hash_or_fallback(), hash_unique(), and ~CPPType().
|
inline |
Definition at line 730 of file BLI_cpp_type.hh.
References hash(), and is_hashable().
Referenced by blender::NodesModifierUsageInferenceCache::ensure(), and ~CPPType().
|
inline |
|
inline |
Definition at line 758 of file BLI_cpp_type.hh.
References get().
Referenced by blender::bke::SocketValueVariant::allocate(), blender::ed::spreadsheet::apply_row_filter(), blender::ed::curves::apply_selection_operation_at_index(), attr_create_motion_corner_normals(), attr_need_motion_vertex_normals(), blender::ed::object::bake_targets_output_vertex_colors(), blender::BKE_mesh_mirror_apply_mirror_on_axis_for_modifier(), blender::bke::socket_value_visitor::RecursiveVisitor::check_GList(), blender::bke::socket_value_visitor::RecursiveVisitor::check_GPointer(), blender::nodes::node_geo_tool_set_selection_cc::clamp_selection(), blender::nodes::node_geo_duplicate_elements_cc::copy_stable_id_curves(), blender::nodes::node_geo_duplicate_elements_cc::copy_stable_id_edges(), blender::nodes::node_geo_duplicate_elements_cc::copy_stable_id_faces(), blender::nodes::node_geo_duplicate_elements_cc::copy_stable_id_point(), blender::bke::SocketValueVariant::count_memory(), blender::bke::cpp_type_to_attribute_type(), blender::ed::spreadsheet::cpp_type_to_column_type(), blender::bke::cpp_type_to_custom_data_type(), blender::geometry::create_id_index_map(), blender::bke::default_value_for_type(), blender::ed::spreadsheet::SpreadsheetLayoutDrawer::draw_content_cell_value(), blender::bke::socket_value_visitor::RecursiveVisitor::edit_GList(), blender::bke::socket_value_visitor::RecursiveVisitor::edit_GPointer(), blender::GValueMap< Key >::extract(), blender::ed::curves::extrude_curves(), blender::ed::curves::fill_selection(), blender::ed::curves::fill_selection_false(), blender::ed::curves::fill_selection_false(), blender::ed::pointcloud::fill_selection_false(), blender::ed::curves::fill_selection_true(), blender::ed::curves::fill_selection_true(), blender::ed::pointcloud::fill_selection_true(), blender::ed::spreadsheet::ColumnValues::fit_column_values_width_px(), blender::nodes::node_fn_format_string_cc::format_with_fmt(), blender::nodes::node_fn_format_string_cc::format_with_hash_syntax(), blender::nodes::node_fn_format_string_cc::format_without_format_specifier(), blender::geometry::gather_realize_tasks_for_instances(), blender::bke::geo_nodes_base_cpp_type_to_socket_type(), blender::nodes::node_fn_format_string_cc::get_pattern_by_type(), blender::nodes::node_fn_format_string_cc::get_pattern_by_type_impl(), blender::ed::curves::has_anything_selected(), blender::bke::SocketValueVariant::init_default(), blender::ed::curves::invert_selection(), blender::ed::pointcloud::invert_selection(), blender::nodes::node_geo_tool_set_selection_cc::invert_selection(), is_any(), blender::ed::curves::is_everything_selected(), blender::bke::SocketValueVariant::is_field(), blender::bke::detail::SocketValueVariantTypeInfo::is_interpretable_as_fn(), blender::bke::SocketValueVariant::is_list(), blender::bke::SocketValueVariant::is_volume_grid(), blender::nodes::eval_log::NodeTreeLogger::log_value(), blender::nodes::node_geo_extrude_mesh_cc::mixing_default_value(), blender::nodes::node_geo_construct_curves_cc::node_geo_exec(), blender::nodes::node_geo_list_get_item_cc::node_geo_exec(), blender::geometry::preprocess_curves(), blender::geometry::preprocess_meshes(), blender::geometry::preprocess_pointclouds(), blender::ed::curves::select_adjacent(), blender::ed::curves::select_ends_exec(), blender::bke::bake::serialize_list(), blender::bke::bake::serialize_single_value(), blender::ed::sculpt_paint::color::to_static_color_type(), blender::bke::transform_custom_normal_attribute(), blender::bke::detail::SocketValueVariantTypeInfo::try_convert_fn(), blender::GMutableSpan::typed(), and blender::GSpan::typed().
|
inline |
Definition at line 763 of file BLI_cpp_type.hh.
Referenced by blender::ed::spreadsheet::cpp_type_to_column_type(), and blender::bke::geo_nodes_base_cpp_type_to_socket_type().
|
inline |
Definition at line 712 of file BLI_cpp_type.hh.
References b.
Referenced by blender::bke::fill_attribute_range_default(), is_equal_or_false(), blender::ed::mesh::try_join_single_value_attribute(), blender::geometry::try_join_single_value_attribute(), blender::geometry::try_join_single_value_attribute(), and ~CPPType().
|
inline |
Definition at line 717 of file BLI_cpp_type.hh.
References b, is_equal(), and is_equality_comparable().
Referenced by blender::fn::multi_function::CustomMF_Constant< T >::equals(), blender::fn::GField::operator==, blender::geometry::construct::try_propagate_single_value(), and ~CPPType().
|
inline |
Definition at line 507 of file BLI_cpp_type.hh.
Referenced by is_equal_or_false(), and ~CPPType().
|
inline |
Definition at line 512 of file BLI_cpp_type.hh.
Referenced by hash_or_fallback(), and ~CPPType().
|
inline |
Definition at line 502 of file BLI_cpp_type.hh.
Referenced by print_or_default(), blender::fn::lazy_function::Graph::to_dot(), and ~CPPType().
|
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 618 of file BLI_cpp_type.hh.
Referenced by blender::geometry::reverse_order(), and ~CPPType().
|
inline |
Definition at line 628 of file BLI_cpp_type.hh.
Referenced by ~CPPType().
|
inline |
Definition at line 623 of file BLI_cpp_type.hh.
Referenced by ~CPPType().
|
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 633 of file BLI_cpp_type.hh.
Referenced by blender::GValueMap< Key >::add_new_by_move(), blender::nodes::LazyFunctionForRerouteNode::execute_impl(), blender::nodes::node_geo_index_switch_cc::LazyFunctionForIndexSwitchNode::execute_single(), blender::nodes::node_geo_switch_cc::LazyFunctionForSwitchNode::execute_single(), blender::nodes::node_geo_closure_to_list_cc::node_geo_exec(), blender::nodes::node_geo_combine_list_cc::node_geo_exec(), blender::GVArrayImpl_For_GSpan::set_by_move(), blender::bke::detail::SocketValueVariantTypeInfo::try_convert_fn(), and ~CPPType().
|
inline |
Definition at line 643 of file BLI_cpp_type.hh.
Referenced by ~CPPType().
|
inline |
Definition at line 638 of file BLI_cpp_type.hh.
Referenced by ~CPPType().
|
inline |
Returns the name of the type for debugging purposes. This name should not be used as identifier.
Definition at line 497 of file BLI_cpp_type.hh.
Referenced by blender::bke::add_implicit_conversion(), blender::nodes::node_fn_format_string_cc::format_with_hash_syntax(), blender::nodes::node_fn_format_string_cc::format_without_format_specifier(), blender::nodes::node_fn_format_string_cc::preprocess_python_compatible_syntax(), blender::fn::lazy_function::Graph::to_dot(), and ~CPPType().
|
inline |
Definition at line 522 of file BLI_cpp_type.hh.
References pointer_has_valid_alignment().
Referenced by print(), and ~CPPType().
|
inline |
Returns true, when the given pointer fulfills the alignment requirement of this type.
Definition at line 517 of file BLI_cpp_type.hh.
Referenced by blender::GMutableSpan::GMutableSpan(), blender::GSpan::GSpan(), pointer_can_point_to_instance(), and ~CPPType().
|
inline |
Definition at line 706 of file BLI_cpp_type.hh.
References blender::BLI_assert(), and pointer_can_point_to_instance().
Referenced by print_or_default(), blender::tests::TEST_F(), to_string(), and ~CPPType().
| void blender::CPPType::print_or_default | ( | const void * | value, |
| std::stringstream & | ss, | ||
| StringRef | default_value ) const |
Definition at line 22 of file cpp_type.cc.
References default_value(), is_printable(), and print().
Referenced by ~CPPType().
|
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 648 of file BLI_cpp_type.hh.
Referenced by blender::GValueMap< Key >::extract(), blender::GVArrayImpl_For_GSpan::set_by_relocate(), and ~CPPType().
|
inline |
Definition at line 658 of file BLI_cpp_type.hh.
Referenced by ~CPPType().
|
inline |
Definition at line 653 of file BLI_cpp_type.hh.
Referenced by ~CPPType().
|
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 663 of file BLI_cpp_type.hh.
Referenced by ~CPPType().
|
inline |
Definition at line 673 of file BLI_cpp_type.hh.
Referenced by ~CPPType().
|
inline |
Definition at line 668 of file BLI_cpp_type.hh.
Referenced by ~CPPType().
|
inline |
Same as to_static_type_try, but asserts if the type is valid.
Definition at line 768 of file BLI_cpp_type.hh.
References BLI_assert_unreachable, and to_static_type_try().
Referenced by blender::geometry::curve_simplify(), blender::nodes::node_geo_accumulate_field_cc::AccumulateFieldInput::get_varray_for_context(), blender::nodes::node_geo_accumulate_field_cc::TotalFieldInput::get_varray_for_context(), blender::nodes::node_geo_field_average_cc::FieldAverageInput::get_varray_for_context(), blender::nodes::node_geo_field_min_and_max_cc::FieldMinMaxInput::get_varray_for_context(), blender::nodes::node_geo_field_variance_cc::FieldVarianceInput::get_varray_for_context(), blender::nodes::node_geo_sort_list_cc::node_geo_exec(), blender::geometry::simplify_curve_attribute(), blender::bke::attribute_math::to_static_type(), blender::nodes::node_geo_blur_attribute_cc::to_static_type_for_blur(), and blender::transform_active_color_data().
|
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. |
Definition at line 776 of file BLI_cpp_type.hh.
References array< T, alignment >::array(), get(), blender::Array< T, InlineBufferCapacity, Allocator >::size(), and type_index.
Referenced by to_static_type().
| std::string blender::CPPType::to_string | ( | const void * | value | ) | const |
Definition at line 15 of file cpp_type.cc.
References print().
Referenced by blender::fn::lazy_function::Graph::to_dot(), and ~CPPType().
|
inline |
Same as default_construct, but does zero initialization for trivial types.
C++ equivalent: new (ptr) T();
Definition at line 542 of file BLI_cpp_type.hh.
Referenced by blender::fn::evaluate_constant_field(), blender::tests::TEST_F(), and ~CPPType().
|
inline |
Definition at line 552 of file BLI_cpp_type.hh.
Referenced by blender::bke::SampleIndexFunction::call(), blender::nodes::LazyFunctionForReduceForeachGeometryElement::handle_main_items_and_geometry(), and ~CPPType().
|
inline |
Definition at line 547 of file BLI_cpp_type.hh.
Referenced by blender::geometry::resample_to_evaluated(), blender::geometry::resample_to_uniform(), blender::ed::curves::resize_curves(), and ~CPPType().
| int64_t blender::CPPType::alignment = 0 |
Required memory alignment for an instance of this type.
C++ equivalent: alignof(T);
Definition at line 122 of file BLI_cpp_type.hh.
Referenced by blender::LinearAllocator< Allocator >::allocate(), blender::LinearAllocator< Allocator >::allocate_array(), blender::fn::GField::TrivialInlineConstant::cpp_type_supported(), CPPType(), blender::fn::multi_function::CustomMF_GenericConstant::CustomMF_GenericConstant(), blender::nodes::GList::ArrayData::ForValue(), blender::fn::GField::from_constant(), blender::bke::Attribute::ArrayData::from_value(), blender::GVArray::GVArray(), blender::GVArrayImpl_For_SingleValue::GVArrayImpl_For_SingleValue(), blender::GVArrayImpl_For_SmallTrivialSingleValue< BufferSize >::GVArrayImpl_For_SmallTrivialSingleValue(), blender::fn::multi_function::ValueAllocator::obtain_OneSingle(), and blender::fn::multi_function::ValueAllocator::obtain_Span().
Comes from T::base_type.
Definition at line 161 of file BLI_cpp_type.hh.
Referenced by CPPType(), blender::bke::detail::SocketValueVariantTypeInfo::is_interpretable_as_fn(), and blender::bke::detail::SocketValueVariantTypeInfo::try_convert_fn().
| void(*)(void *) blender::CPPType::destruct_fn() const |
Definition at line 410 of file BLI_cpp_type.hh.
Comes from T::generic_type.
Definition at line 163 of file BLI_cpp_type.hh.
Referenced by CPPType(), blender::bke::detail::SocketValueVariantTypeInfo::is_interpretable_as_fn(), blender::bke::detail::to_storage_type(), and blender::bke::detail::SocketValueVariantTypeInfo::try_convert_fn().
| bool blender::CPPType::has_special_member_functions = false |
Returns true, when the type has the following functions:
Definition at line 151 of file BLI_cpp_type.hh.
Referenced by CPPType().
| bool blender::CPPType::is_copy_assignable = false |
Definition at line 157 of file BLI_cpp_type.hh.
Referenced by CPPType().
| bool blender::CPPType::is_copy_constructible = false |
Definition at line 154 of file BLI_cpp_type.hh.
Referenced by CPPType().
| bool blender::CPPType::is_default_constructible = false |
Definition at line 153 of file BLI_cpp_type.hh.
Referenced by CPPType().
| bool blender::CPPType::is_destructible = false |
Definition at line 156 of file BLI_cpp_type.hh.
Referenced by CPPType().
| bool blender::CPPType::is_move_assignable = false |
Definition at line 158 of file BLI_cpp_type.hh.
Referenced by CPPType().
| bool blender::CPPType::is_move_constructible = false |
Definition at line 155 of file BLI_cpp_type.hh.
Referenced by CPPType().
| bool blender::CPPType::is_trivial = false |
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 131 of file BLI_cpp_type.hh.
Referenced by blender::fn::GField::TrivialInlineConstant::cpp_type_supported(), CPPType(), blender::GVArray::GVArray(), blender::GVArrayImpl_For_SmallTrivialSingleValue< BufferSize >::GVArrayImpl_For_SmallTrivialSingleValue(), blender::bke::bake::serialize_list(), and blender::nodes::node_geo_transfer_attributes_cc::transfer_attributes().
| bool blender::CPPType::is_trivially_destructible = false |
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 140 of file BLI_cpp_type.hh.
Referenced by blender::ResourceScope::allocate_owned(), CPPType(), and blender::fn::evaluate_fields().
| int64_t blender::CPPType::size = 0 |
Required memory in bytes for an instance of this type.
C++ equivalent: sizeof(T);
Definition at line 114 of file BLI_cpp_type.hh.
Referenced by blender::LinearAllocator< Allocator >::allocate(), blender::LinearAllocator< Allocator >::allocate_array(), blender::bm_to_mesh_copy_info_calc(), blender::GVArrayImpl_For_SlicedGVArray::common_info(), blender::array_utils::copy(), blender::array_utils::copy(), blender::bke::SocketValueVariant::count_memory(), blender::nodes::GList::ArrayData::count_memory(), blender::nodes::GList::SingleData::count_memory(), blender::fn::GField::TrivialInlineConstant::cpp_type_supported(), CPPType(), blender::fn::multi_function::CustomMF_GenericConstant::CustomMF_GenericConstant(), blender::GMutableSpan::drop_front(), blender::GSpan::drop_front(), blender::bke::evaluate_attribute(), blender::nodes::GList::ArrayData::ForValue(), blender::fn::GField::from_constant(), blender::bke::Attribute::ArrayData::from_value(), blender::array_utils::gather(), blender::GVMutableArray::get_internal_span(), blender::bke::get_span_attribute(), blender::GVArray::GVArray(), blender::GVArrayImpl_For_SingleValue::GVArrayImpl_For_SingleValue(), blender::GVArrayImpl_For_SmallTrivialSingleValue< BufferSize >::GVArrayImpl_For_SmallTrivialSingleValue(), blender::GVArrayImpl::materialize(), blender::GVArrayImpl_For_SlicedGVArray::materialize(), blender::GVArrayImpl::materialize_compressed(), blender::mesh_to_bm_copy_info_calc(), blender::fn::multi_function::ValueAllocator::obtain_OneSingle(), blender::fn::multi_function::ValueAllocator::obtain_Span(), blender::GArray< Allocator >::operator[](), blender::GArray< Allocator >::operator[](), blender::GMutableSpan::operator[](), blender::GSpan::operator[](), blender::fn::multi_function::ValueAllocator::release_value(), blender::geometry::reorder_attribute_domain(), blender::reorder_attribute_domain(), blender::geometry::reorder_attribute_groups(), blender::bke::AttributeStorage::resize(), blender::GVMutableArrayImpl::set_all(), blender::shrink_attribute_storage(), blender::compositor::Result::size_in_bytes(), 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::bke::write_shared_array().
| int blender::CPPType::type_index = -1 |
An index that is assigned when the type is registered. Each #CPPtype has a unique index. While the pointer of a CPPType is also unique, sometimes it's easier to work with an index that is a relatively small number (generally <100).
Definition at line 169 of file BLI_cpp_type.hh.
Referenced by CPPType(), and to_static_type_try().