@Haocheng_Liu I’m writing from_json()
and to_json()
methods for a new subclass of smtk::attribute::Item
(ReferenceItem which holds references to smtk::resource::PersistentObject
) and want to understand why the signature for from_json
is
from_json(
const json& j,
smtk::attribute::ReferenceItemPtr& itemPtr,
smtk::attribute::CollectionPtr colPtr)
Why do we need to pass in colPtr
? We should be able to obtain it by calling itemPtr->attribute()->collection()
, since the item must already have been created before calling from_json()
. Right?