MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ encode_property() [1/2]

template<typename Class , typename T >
static void MayaFlux::IO::JSONSerializer::encode_property ( nlohmann::json &  j,
const Class &  obj,
const Reflect::OptionalProperty< Class, T > &  prop 
)
inlinestaticprivate

Definition at line 208 of file JSONSerializer.hpp.

212 {
213 const auto& opt = obj.*prop.member;
214 if (opt.has_value()) {
215 j[prop.key] = to_json(*opt);
216 }
217 }
static nlohmann::json to_json(const T &val)

References MayaFlux::Reflect::OptionalProperty< Class, T >::key, and MayaFlux::Reflect::OptionalProperty< Class, T >::member.