Blender
V3.3
|
Base class for (de)serializing IDProperties. More...
Public Member Functions | |
constexpr | IDPropertySerializer ()=default |
virtual std::string | type_name () const =0 |
return the type name for (de)serializing. Type name is stored in the type or subtype attribute of the serialized id_property. More... | |
virtual std::optional< eIDPropertyType > | property_type () const =0 |
return the IDPropertyType for (de)serializing. More... | |
virtual std::shared_ptr< DictionaryValue > | idprop_to_dictionary (const struct IDProperty *id_property) const =0 |
create dictionary containing the given id_property. More... | |
virtual std::unique_ptr< IDProperty, IDPropertyDeleter > | entry_to_idprop (DictionaryEntryParser &entry_reader) const =0 |
convert the entry to an id property. More... | |
virtual bool | supports_serializing () const |
Can the serializer be used? More... | |
Protected Member Functions | |
std::shared_ptr< DictionaryValue > | create_dictionary (const struct IDProperty *id_property) const |
Create a new DictionaryValue instance. More... | |
Base class for (de)serializing IDProperties.
Has a subclass for supported IDProperties and one for unsupported IDProperties.
Definition at line 45 of file idprop_serialize.cc.
|
constexprdefault |
|
inlineprotected |
Create a new DictionaryValue instance.
Only fill the dictionary with common attributes (name, type).
Definition at line 88 of file idprop_serialize.cc.
References blender::bke::idprop::IDP_KEY_NAME(), blender::bke::idprop::IDP_KEY_TYPE(), IDProperty::name, and result.
|
pure virtual |
convert the entry to an id property.
Implemented in blender::bke::idprop::IDPGroupSerializer, blender::bke::idprop::IDPArraySerializer, blender::bke::idprop::IDPDoubleSerializer, blender::bke::idprop::IDPFloatSerializer, blender::bke::idprop::IDPIntSerializer, and blender::bke::idprop::IDPStringSerializer.
Referenced by blender::bke::idprop::idprop_from_value().
|
pure virtual |
create dictionary containing the given id_property.
Implemented in blender::bke::idprop::IDPGroupSerializer, blender::bke::idprop::IDPArraySerializer, blender::bke::idprop::IDPDoubleSerializer, blender::bke::idprop::IDPFloatSerializer, blender::bke::idprop::IDPIntSerializer, and blender::bke::idprop::IDPStringSerializer.
Referenced by blender::bke::idprop::convert_to_serialize_values(), and blender::bke::idprop::IDPGroupSerializer::idprop_to_dictionary().
|
pure virtual |
return the IDPropertyType for (de)serializing.
Implemented in blender::bke::idprop::IDPUnknownSerializer, blender::bke::idprop::IDPGroupSerializer, blender::bke::idprop::IDPArraySerializer, blender::bke::idprop::IDPDoubleSerializer, blender::bke::idprop::IDPFloatSerializer, blender::bke::idprop::IDPIntSerializer, and blender::bke::idprop::IDPStringSerializer.
|
inlinevirtual |
Can the serializer be used?
IDP_ID and IDP_IDPARRAY aren't supported for serialization.
Reimplemented in blender::bke::idprop::IDPUnknownSerializer.
Definition at line 77 of file idprop_serialize.cc.
Referenced by blender::bke::idprop::convert_to_serialize_values().
|
pure virtual |
return the type name for (de)serializing. Type name is stored in the type
or subtype
attribute of the serialized id_property.
Implemented in blender::bke::idprop::IDPUnknownSerializer, blender::bke::idprop::IDPGroupSerializer, blender::bke::idprop::IDPArraySerializer, blender::bke::idprop::IDPDoubleSerializer, blender::bke::idprop::IDPFloatSerializer, blender::bke::idprop::IDPIntSerializer, and blender::bke::idprop::IDPStringSerializer.
Referenced by blender::bke::idprop::IDPArraySerializer::idprop_to_dictionary().