|
Blender V4.5
|
#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 |
| 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 |
| 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 | |
| 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 |
| void(*)(void *) | destruct_fn () const |
Definition at line 100 of file BLI_cpp_type.hh.
| blender::CPPType::CPPType | ( | TypeTag< T > | , |
| TypeForValue< CPPTypeFlags, Flags > | , | ||
| StringRef | debug_name ) |
Definition at line 316 of file BLI_cpp_type_make.hh.
References alignment, default_value(), EqualityComparable, has_special_member_functions, Hashable, IdentityDefaultValue, is_copy_assignable, is_copy_constructible, is_default_constructible, is_destructible, is_move_assignable, is_move_constructible, is_trivial, is_trivially_destructible, Printable, size, and T.
Referenced by get(), get_impl(), and ~CPPType().
|
virtualdefault |
References CPPType().
|
inline |
Definition at line 674 of file BLI_cpp_type.hh.
Referenced by blender::fn::multi_function::ValueAllocator::obtain_OneSingle(), blender::fn::multi_function::ValueAllocator::obtain_Span(), and blender::fn::multi_function::ValueAllocator::release_value().
|
inline |
Copy an instance of this type from src to dst.
C++ equivalent: dst = src;
Definition at line 546 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::GVArrayCommon::get_internal_single(), blender::compositor::Result::load_pixel_generic_type(), blender::compositor::Result::sample_bilinear_extended(), blender::compositor::Result::sample_bilinear_wrap(), blender::compositor::Result::sample_bilinear_zero(), blender::compositor::Result::sample_cubic_extended(), blender::compositor::Result::sample_cubic_wrap(), blender::compositor::Result::sample_ewa_extended(), blender::compositor::Result::sample_ewa_zero(), blender::compositor::Result::sample_nearest_extended(), blender::compositor::Result::sample_nearest_wrap(), blender::compositor::Result::sample_nearest_zero(), blender::compositor::Result::store_pixel_generic_type(), blender::compositor::Result::update_single_value_data(), blender::ed::curves::validate_value(), and blender::ed::pointcloud::validate_value().
|
inline |
Similar to copy_assign_indices, but does not leave gaps in the #dst array.
Definition at line 561 of file BLI_cpp_type.hh.
References mask().
Referenced by blender::tests::TEST().
|
inline |
Definition at line 556 of file BLI_cpp_type.hh.
References mask().
|
inline |
Definition at line 551 of file BLI_cpp_type.hh.
Referenced by blender::geometry::fill_new_attribute(), blender::bke::bake::load_attributes(), and blender::geometry::smooth_curve_attribute().
|
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 568 of file BLI_cpp_type.hh.
Referenced by blender::nodes::Bundle::add_new(), blender::GValueMap< Key >::add_new_by_copy(), blender::nodes::construct_socket_default_value(), blender::bke::DataTypeConversions::convert_to_uninitialized(), blender::fn::multi_function::CustomMF_GenericConstant::CustomMF_GenericConstant(), blender::bke::bake::default_initialize_socket_value(), blender::nodes::evaluate_closure_eagerly(), blender::nodes::LazyFunctionForReduceForeachGeometryElement::handle_main_items_and_geometry(), blender::nodes::implicitly_convert_socket_value(), and blender::nodes::geo_eval_log::GeoTreeLogger::log_value().
|
inline |
Similar to copy_construct_indices, but does not leave gaps in the #dst array.
Definition at line 585 of file BLI_cpp_type.hh.
References mask().
|
inline |
Definition at line 578 of file BLI_cpp_type.hh.
References mask().
|
inline |
Definition at line 573 of file BLI_cpp_type.hh.
Referenced by blender::bke::Attribute::data_for_write().
|
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 501 of file BLI_cpp_type.hh.
References ptr.
Referenced by blender::ed::greasepencil::insert_selected_values(), blender::geometry::reverse_order(), blender::ed::greasepencil::select_similar_by_value(), and blender::tests::TEST().
|
inline |
Definition at line 511 of file BLI_cpp_type.hh.
|
inline |
Definition at line 506 of file BLI_cpp_type.hh.
References ptr.
|
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 712 of file BLI_cpp_type.hh.
Referenced by blender::fn::multi_function::CustomMF_DefaultOutput::call(), blender::nodes::node_geo_index_switch_cc::IndexSwitchFunction::call(), CPPType(), blender::geometry::execute_instances_tasks(), blender::bke::SocketValueVariant::extract(), blender::bke::fill_attribute_range_default(), get_impl(), blender::bke::AttributeAccessor::lookup_or_default(), blender::geometry::mesh_triangulate(), 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 531 of file BLI_cpp_type.hh.
References ptr.
Referenced by blender::ResourceScope::allocate_owned(), blender::fn::multi_function::tests::GenericAppendFunction::call(), blender::bke::bake::copy_bake_item_to_socket_value(), 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::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::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::nodes::Bundle::remove(), 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::nodes::geo_eval_log::GeoTreeLog::try_convert_primitive_socket_value(), blender::ed::curves::validate_value(), and blender::ed::pointcloud::validate_value().
|
inline |
Definition at line 541 of file BLI_cpp_type.hh.
Referenced by blender::fn::multi_function::VariableState::destruct(), and blender::fn::evaluate_fields().
|
inline |
Definition at line 536 of file BLI_cpp_type.hh.
References ptr.
Referenced by blender::bke::DataTypeConversions::convert_to_initialized_n(), and blender::bke::try_capture_fields_on_geometry().
|
inline |
Definition at line 657 of file BLI_cpp_type.hh.
References mask().
Referenced by blender::ed::curves::set_attribute_exec(), and blender::ed::pointcloud::set_attribute_exec().
|
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 652 of file BLI_cpp_type.hh.
Referenced by blender::bke::add_custom_data_layer_from_attribute_init(), blender::geometry::convert_curves_to_catmull_rom_or_poly(), blender::geometry::execute_instances_tasks(), blender::GVMutableArray::fill(), blender::bke::fill_attribute_range_default(), blender::bke::curves::fill_points(), blender::nodes::LazyFunctionForReduceForeachGeometryElement::handle_generation_items_group(), and blender::nodes::node_composite_file_output_cc::FileOutputOperation::inflate_result().
|
inline |
Definition at line 667 of file BLI_cpp_type.hh.
References mask().
Referenced by blender::fn::multi_function::CustomMF_DefaultOutput::call(), blender::nodes::node_geo_index_switch_cc::IndexSwitchFunction::call(), and blender::fn::multi_function::VariableState::ensure_is_mutable().
|
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 662 of file BLI_cpp_type.hh.
Referenced by blender::bke::convert_storage_to_customdata(), and blender::geometry::mesh_triangulate().
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 464 of file BLI_cpp_type.hh.
References CPPType(), and 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::attribute_type_to_cpp_type(), blender::compositor::Result::cpp_type(), blender::bke::AttributeExistsFieldInput::Create(), blender::bke::AttributeFieldInput::Create(), blender::bke::custom_data_type_to_cpp_type(), blender::fn::multi_function::CustomMF_Constant< T >::equals(), blender::nodes::LazyFunctionForClosureZone::execute_impl(), 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::nodes::node_fn_format_string_cc::format_strings(), blender::fn::multi_function::DataType::ForSingle(), blender::fn::multi_function::DataType::ForVector(), blender::bke::AttributeIter::get(), blender::nodes::get_geometry_nodes_input_base_values(), blender::nodes::GeoNodeExecParams::get_input(), blender::bke::get_mutable_attribute(), blender::bke::greasepencil::get_mutable_attribute(), blender::nodes::node_fn_format_string_cc::get_pattern_by_type(), blender::compositor::get_result_data(), blender::compositor::get_result_data(), blender::compositor::get_result_single_value(), blender::compositor::get_result_single_value(), blender::bke::get_span_attribute(), blender::bke::get_varray_attribute(), blender::GVArray::GVArray(), blender::GVMutableArray::GVMutableArray(), blender::nodes::node_composite_file_output_cc::FileOutputOperation::inflate_result(), blender::nodes::initialize_zone_wrapper(), is(), blender::nodes::LazyFunctionForBakeInputsUsage::LazyFunctionForBakeInputsUsage(), blender::nodes::LazyFunctionForClosureZone::LazyFunctionForClosureZone(), blender::nodes::LazyFunctionForExtractingReferenceSet::LazyFunctionForExtractingReferenceSet(), blender::nodes::LazyFunctionForGeometryNode::LazyFunctionForGeometryNode(), blender::nodes::LazyFunctionForGizmoInputsUsage::LazyFunctionForGizmoInputsUsage(), blender::nodes::LazyFunctionForImplicitConversion::LazyFunctionForImplicitConversion(), 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::node_geo_simulation_cc::sim_input_node::LazyFunctionForSimulationInputNode::LazyFunctionForSimulationInputNode(), blender::nodes::LazyFunctionForSimulationInputsUsage::LazyFunctionForSimulationInputsUsage(), 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::bke::AttributeAccessor::lookup(), blender::bke::MutableAttributeAccessor::lookup_or_add_for_write(), blender::fn::make_constant_field(), make_socket_type_bool(), make_socket_type_bundle(), make_socket_type_closure(), 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::nodes::node_geo_tool_set_selection_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::ed::pointcloud::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().
|
inline |
Definition at line 717 of file BLI_cpp_type.hh.
References blender::get_default_hash().
Referenced by hash_or_fallback().
|
inline |
Definition at line 699 of file BLI_cpp_type.hh.
|
inline |
Definition at line 704 of file BLI_cpp_type.hh.
References hash(), and is_hashable().
|
inline |
Definition at line 727 of file BLI_cpp_type.hh.
References get().
Referenced by blender::ed::spreadsheet::apply_row_filter(), blender::ed::curves::apply_selection_operation_at_index(), BKE_mesh_mirror_apply_mirror_on_axis_for_modifier(), blender::nodes::node_geo_tool_set_selection_cc::clamp_selection(), blender::bke::cpp_type_to_attribute_type(), blender::ed::spreadsheet::cpp_type_to_column_type(), blender::bke::cpp_type_to_custom_data_type(), blender::ed::space_node::create_inspection_string_for_field_info(), blender::ed::space_node::create_inspection_string_for_generic_value(), blender::GValueMap< Key >::extract(), blender::ed::curves::extrude_curves(), blender::ed::sculpt_paint::fill_mesh_color(), 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::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::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::ed::curves::invert_selection(), blender::ed::pointcloud::invert_selection(), blender::nodes::node_geo_tool_set_selection_cc::invert_selection(), is_any(), blender::nodes::geo_eval_log::GeoTreeLogger::log_value(), blender::bke::MutableAttributeAccessor::lookup_for_write(), blender::bke::bake::read_blob_simple_gspan(), blender::ed::curves::select_adjacent(), blender::ed::curves::select_ends_exec(), blender::ed::sculpt_paint::color::to_static_color_type(), and blender::bke::bake::write_blob_simple_gspan().
|
inline |
Definition at line 732 of file BLI_cpp_type.hh.
Referenced by blender::ed::spreadsheet::cpp_type_to_column_type(), and blender::bke::bake::read_blob_simple_gspan().
|
inline |
|
inline |
Definition at line 691 of file BLI_cpp_type.hh.
References b, is_equal(), and is_equality_comparable().
Referenced by blender::fn::multi_function::CustomMF_Constant< T >::equals().
|
inline |
Definition at line 481 of file BLI_cpp_type.hh.
Referenced by is_equal_or_false().
|
inline |
Definition at line 486 of file BLI_cpp_type.hh.
Referenced by hash_or_fallback().
|
inline |
Definition at line 476 of file BLI_cpp_type.hh.
Referenced by blender::bke::SocketValueVariant::operator<<, print_or_default(), and blender::fn::lazy_function::Graph::to_dot().
|
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 592 of file BLI_cpp_type.hh.
Referenced by blender::geometry::reverse_order().
|
inline |
Definition at line 602 of file BLI_cpp_type.hh.
References mask().
|
inline |
Definition at line 597 of file BLI_cpp_type.hh.
|
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 607 of file BLI_cpp_type.hh.
Referenced by blender::GValueMap< Key >::add_new_by_move(), blender::nodes::evaluate_closure_eagerly(), blender::nodes::LazyFunctionForClosureZone::execute_impl(), blender::nodes::LazyFunctionForRerouteNode::execute_impl(), blender::nodes::node_geo_index_switch_cc::LazyFunctionForIndexSwitchNode::execute_single(), and blender::nodes::node_geo_switch_cc::LazyFunctionForSwitchNode::execute_single().
|
inline |
Definition at line 617 of file BLI_cpp_type.hh.
References mask().
|
inline |
Definition at line 612 of file BLI_cpp_type.hh.
|
inline |
Returns the name of the type for debugging purposes. This name should not be used as identifier.
Definition at line 471 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(), and blender::fn::lazy_function::Graph::to_dot().
|
inline |
Definition at line 496 of file BLI_cpp_type.hh.
References pointer_has_valid_alignment(), and ptr.
Referenced by print().
|
inline |
Returns true, when the given pointer fulfills the alignment requirement of this type.
Definition at line 491 of file BLI_cpp_type.hh.
References ptr.
Referenced by pointer_can_point_to_instance().
|
inline |
Definition at line 680 of file BLI_cpp_type.hh.
References BLI_assert, and pointer_can_point_to_instance().
Referenced by blender::bke::SocketValueVariant::operator<<, 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 22 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 622 of file BLI_cpp_type.hh.
Referenced by blender::GValueMap< Key >::extract().
|
inline |
Definition at line 632 of file BLI_cpp_type.hh.
References mask().
|
inline |
Definition at line 627 of file BLI_cpp_type.hh.
|
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 637 of file BLI_cpp_type.hh.
|
inline |
Definition at line 647 of file BLI_cpp_type.hh.
References mask().
|
inline |
Definition at line 642 of file BLI_cpp_type.hh.
|
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 737 of file BLI_cpp_type.hh.
References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add_new(), 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 428 of file BLI_cpp_type.hh.
References to_static_type().
Referenced by blender::bke::attribute_math::convert_to_static_type(), blender::tests::TEST(), blender::nodes::node_geo_blur_attribute_cc::to_static_type_for_blur(), and transform_active_color_data().
| 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().
|
inline |
Same as default_construct, but does zero initialization for trivial types.
C++ equivalent: new (ptr) T();
Definition at line 516 of file BLI_cpp_type.hh.
References ptr.
Referenced by blender::nodes::construct_socket_default_value(), blender::bke::bake::default_initialize_socket_value(), blender::fn::evaluate_constant_field(), blender::bke::node_socket_move_default_value(), and blender::tests::TEST().
|
inline |
|
inline |
Definition at line 521 of file BLI_cpp_type.hh.
References ptr.
Referenced by blender::geometry::resample_to_evaluated(), blender::geometry::resample_to_uniform(), blender::ed::curves::resize_curves(), and vpaint_init_vpaint().
| int64_t blender::CPPType::alignment = 0 |
Required memory alignment for an instance of this type.
C++ equivalent: alignof(T);
Definition at line 116 of file BLI_cpp_type.hh.
Referenced by blender::nodes::Bundle::add_new(), blender::LinearAllocator< Allocator >::allocate(), blender::LinearAllocator< Allocator >::allocate_array(), blender::nodes::compute_attributes_to_store(), blender::ed::geometry::convert_attribute(), CPPType(), blender::fn::multi_function::CustomMF_GenericConstant::CustomMF_GenericConstant(), blender::bke::Attribute::data_for_write(), blender::fn::multi_function::ValueAllocator::obtain_OneSingle(), blender::fn::multi_function::ValueAllocator::obtain_Span(), blender::bke::bake::read_blob_shared_simple_gspan(), and blender::bke::try_capture_fields_on_geometry().
| void(*)(void *) blender::CPPType::destruct_fn() const |
Definition at line 387 of file BLI_cpp_type.hh.
| bool blender::CPPType::has_special_member_functions = false |
Returns true, when the type has the following functions:
Definition at line 145 of file BLI_cpp_type.hh.
Referenced by CPPType(), and blender::nodes::get_socket_cpp_type().
| bool blender::CPPType::is_copy_assignable = false |
Definition at line 151 of file BLI_cpp_type.hh.
Referenced by CPPType().
| bool blender::CPPType::is_copy_constructible = false |
Definition at line 148 of file BLI_cpp_type.hh.
Referenced by CPPType().
| bool blender::CPPType::is_default_constructible = false |
Definition at line 147 of file BLI_cpp_type.hh.
Referenced by CPPType().
| bool blender::CPPType::is_destructible = false |
Definition at line 150 of file BLI_cpp_type.hh.
Referenced by CPPType().
| bool blender::CPPType::is_move_assignable = false |
Definition at line 152 of file BLI_cpp_type.hh.
Referenced by CPPType().
| bool blender::CPPType::is_move_constructible = false |
Definition at line 149 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 125 of file BLI_cpp_type.hh.
Referenced by CPPType(), blender::bke::bake::read_blob_simple_gspan(), and blender::bke::bake::write_blob_simple_gspan().
| 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 134 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 108 of file BLI_cpp_type.hh.
Referenced by blender::nodes::Bundle::add_new(), blender::LinearAllocator< Allocator >::allocate(), blender::LinearAllocator< Allocator >::allocate_array(), blender::nodes::compute_attributes_to_store(), blender::ed::geometry::convert_attribute(), CPPType(), blender::ed::curves::set_selection_domain::curves_set_selection_domain_exec(), blender::fn::multi_function::CustomMF_GenericConstant::CustomMF_GenericConstant(), blender::bke::Attribute::data_for_write(), blender::ed::greasepencil::ensure_selection_domain(), blender::bke::evaluate_attribute(), blender::fn::multi_function::ValueAllocator::obtain_OneSingle(), blender::fn::multi_function::ValueAllocator::obtain_Span(), blender::bke::bake::read_blob_shared_simple_gspan(), blender::bke::bake::read_blob_simple_gspan(), blender::fn::multi_function::ValueAllocator::release_value(), blender::bke::try_capture_fields_on_geometry(), blender::bke::bake::write_blob_simple_gspan(), and blender::bke::write_shared_array().