Blender  V3.3
Public Member Functions | Protected Member Functions | List of all members
blender::bke::idprop::IDPropertySerializer Class Referenceabstract

Base class for (de)serializing IDProperties. More...

Inheritance diagram for blender::bke::idprop::IDPropertySerializer:
blender::bke::idprop::IDPArraySerializer blender::bke::idprop::IDPDoubleSerializer blender::bke::idprop::IDPFloatSerializer blender::bke::idprop::IDPGroupSerializer blender::bke::idprop::IDPIntSerializer blender::bke::idprop::IDPStringSerializer blender::bke::idprop::IDPUnknownSerializer

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< eIDPropertyTypeproperty_type () const =0
 return the IDPropertyType for (de)serializing. More...
 
virtual std::shared_ptr< DictionaryValueidprop_to_dictionary (const struct IDProperty *id_property) const =0
 create dictionary containing the given id_property. More...
 
virtual std::unique_ptr< IDProperty, IDPropertyDeleterentry_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< DictionaryValuecreate_dictionary (const struct IDProperty *id_property) const
 Create a new DictionaryValue instance. More...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ IDPropertySerializer()

constexpr blender::bke::idprop::IDPropertySerializer::IDPropertySerializer ( )
constexprdefault

Member Function Documentation

◆ create_dictionary()

std::shared_ptr<DictionaryValue> blender::bke::idprop::IDPropertySerializer::create_dictionary ( const struct IDProperty id_property) const
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.

◆ entry_to_idprop()

virtual std::unique_ptr<IDProperty, IDPropertyDeleter> blender::bke::idprop::IDPropertySerializer::entry_to_idprop ( DictionaryEntryParser entry_reader) const
pure virtual

◆ idprop_to_dictionary()

virtual std::shared_ptr<DictionaryValue> blender::bke::idprop::IDPropertySerializer::idprop_to_dictionary ( const struct IDProperty id_property) const
pure virtual

◆ property_type()

virtual std::optional<eIDPropertyType> blender::bke::idprop::IDPropertySerializer::property_type ( ) const
pure virtual

◆ supports_serializing()

virtual bool blender::bke::idprop::IDPropertySerializer::supports_serializing ( ) const
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().

◆ type_name()

virtual std::string blender::bke::idprop::IDPropertySerializer::type_name ( ) const
pure virtual

The documentation for this class was generated from the following file: