22 prop_template.
i = value;
24 return std::unique_ptr<IDProperty, IDPropertyDeleter>(property);
32 prop_template.
i = value;
34 return std::unique_ptr<IDProperty, IDPropertyDeleter>(property);
42 prop_template.
f = value;
44 return std::unique_ptr<IDProperty, IDPropertyDeleter>(property);
52 prop_template.
d = value;
54 return std::unique_ptr<IDProperty, IDPropertyDeleter>(property);
62 return std::unique_ptr<IDProperty, IDPropertyDeleter>(property);
73 prop_template.
id = value;
75 return std::unique_ptr<IDProperty, IDPropertyDeleter>(property);
87 return std::unique_ptr<IDProperty, IDPropertyDeleter>(property);
113 "Allowed values for PrimitiveType are int32_t, float and double.");
114 static_assert(!std::is_same_v<PrimitiveType, int32_t> || id_property_subtype ==
IDP_INT,
115 "PrimitiveType and id_property_type do not match (int32_t).");
116 static_assert(!std::is_same_v<PrimitiveType, float> || id_property_subtype ==
IDP_FLOAT,
117 "PrimitiveType and id_property_type do not match (float).");
118 static_assert(!std::is_same_v<PrimitiveType, double> || id_property_subtype ==
IDP_DOUBLE,
119 "PrimitiveType and id_property_type do not match (double).");
123 std::unique_ptr<IDProperty, IDPropertyDeleter>
property =
array_create(
124 prop_name, id_property_subtype, values_len, flags);
126 property.get(),
static_cast<const void *
>(values.
data()), values_len,
sizeof(
PrimitiveType));
156 return std::unique_ptr<IDProperty, IDPropertyDeleter>(property);
IDProperty * IDP_NewString(const char *st, blender::StringRef name, eIDPropertyFlag flags={}) ATTR_WARN_UNUSED_RESULT
#define IDP_array_voidp_get(prop)
IDProperty * IDP_New(char type, const IDPropertyTemplate *val, blender::StringRef name, eIDPropertyFlag flags={}) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
ID and Library types, which are fundamental for SDNA.
constexpr const T * data() const
constexpr int64_t size() const
constexpr const char * c_str() const
std::unique_ptr< IDProperty, IDPropertyDeleter > create_array(StringRef prop_name, Span< PrimitiveType > values, const eIDPropertyFlag flags)
std::unique_ptr< IDProperty, IDPropertyDeleter > create_bool(StringRef prop_name, bool value, eIDPropertyFlag flags={})
Allocate a new IDProperty of type IDP_BOOLEAN, set its name and value.
static void array_values_set(IDProperty *property, const void *values, size_t values_len, size_t value_size)
std::unique_ptr< IDProperty, IDPropertyDeleter > create(StringRef prop_name, int32_t value, eIDPropertyFlag flags={})
Allocate a new IDProperty of type IDP_INT, set its name and value.
static std::unique_ptr< IDProperty, IDPropertyDeleter > array_create(const StringRef prop_name, eIDPropertyType subtype, size_t array_len, const eIDPropertyFlag flags)
std::unique_ptr< IDProperty, IDPropertyDeleter > create_group(StringRef prop_name, eIDPropertyFlag flags={})
Allocate a new IDProperty of type IDP_GROUP.
constexpr bool is_same_any_v
struct IDPropertyTemplate::@032057005265002020267344110225167212360002125060 array