Blender V4.3
blender::io::serialize::Value Class Reference

#include <BLI_serialize.hh>

Inherited by blender::io::serialize::ArrayValue, blender::io::serialize::DictionaryValue, blender::io::serialize::NullValue, blender::io::serialize::PrimitiveValue< T, V >, and blender::io::serialize::StringValue.

Public Member Functions

virtual ~Value ()=default
 
eValueType type () const
 
const StringValueas_string_value () const
 
const IntValueas_int_value () const
 
const DoubleValueas_double_value () const
 
const BooleanValueas_boolean_value () const
 
const EnumValueas_enum_value () const
 
const ArrayValueas_array_value () const
 
const DictionaryValueas_dictionary_value () const
 

Protected Member Functions

 Value ()=delete
 
 Value (eValueType type)
 

Detailed Description

Class containing a (de)serializable value.

To serialize from or to a specific format the Value will be used as an intermediate container holding the values. Value class is abstract. There are concrete classes to for different data types.

  • StringValue: contains a string.
  • IntValue: contains an integer.
  • ArrayValue: contains an array of elements. Elements don't need to be the same type.
  • NullValue: represents nothing (null pointer or optional).
  • BooleanValue: contains a boolean (true/false).
  • DoubleValue: contains a double precision floating point number.
  • DictionaryValue: represents an object (key value pairs where keys are strings and values can be of different types.

Definition at line 112 of file BLI_serialize.hh.

Constructor & Destructor Documentation

◆ Value() [1/2]

blender::io::serialize::Value::Value ( )
protecteddelete

◆ Value() [2/2]

blender::io::serialize::Value::Value ( eValueType type)
inlineexplicitprotected

Definition at line 118 of file BLI_serialize.hh.

◆ ~Value()

virtual blender::io::serialize::Value::~Value ( )
virtualdefault

Member Function Documentation

◆ as_array_value()

const ArrayValue * blender::io::serialize::Value::as_array_value ( ) const

◆ as_boolean_value()

const BooleanValue * blender::io::serialize::Value::as_boolean_value ( ) const

Casts to a BooleanValue. Will return nullptr when it is a different type.

Definition at line 36 of file serialize.cc.

References blender::io::serialize::Boolean.

Referenced by blender::bke::bake::deserialize_primitive_value().

◆ as_dictionary_value()

◆ as_double_value()

const DoubleValue * blender::io::serialize::Value::as_double_value ( ) const

Casts to a DoubleValue. Will return nullptr when it is a different type.

Definition at line 28 of file serialize.cc.

References blender::io::serialize::Double.

Referenced by blender::bke::bake::deserialize_float(), and blender::io::serialize::DictionaryValue::lookup_double().

◆ as_enum_value()

const EnumValue * blender::io::serialize::Value::as_enum_value ( ) const

Casts to a EnumValue. Will return nullptr when it is a different type.

Definition at line 44 of file serialize.cc.

References blender::io::serialize::Enum.

◆ as_int_value()

const IntValue * blender::io::serialize::Value::as_int_value ( ) const

Casts to an IntValue. Will return nullptr when it is a different type.

Definition at line 20 of file serialize.cc.

References blender::io::serialize::Int.

Referenced by blender::bke::bake::deserialize_float(), blender::bke::bake::deserialize_int(), and blender::io::serialize::DictionaryValue::lookup_int().

◆ as_string_value()

const StringValue * blender::io::serialize::Value::as_string_value ( ) const

Casts to a StringValue. Will return nullptr when it is a different type.

Definition at line 12 of file serialize.cc.

References blender::io::serialize::String.

Referenced by blender::io::serialize::DictionaryValue::lookup_str().

◆ type()

eValueType blender::io::serialize::Value::type ( ) const
inline

Definition at line 122 of file BLI_serialize.hh.


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