Inviwo  0.9.10.1
Inviwo documentation
inviwo::util::IndexedDeserializer< T > Class Template Reference

#include <deserializer.h>

Public Member Functions

 IndexedDeserializer (std::string key, std::string itemKey)
 
IndexedDeserializer< T > & setMakeNew (std::function< T()> makeNewItem)
 
IndexedDeserializer< T > & onNew (std::function< void(T &)> onNewItem)
 
IndexedDeserializer< T > & onRemove (std::function< void(T &)> onRemoveItem)
 
template<typename C >
void operator() (Deserializer &d, C &container)
 

Detailed Description

template<typename T>
class inviwo::util::IndexedDeserializer< T >

A helper class for more advanced deserialization. useful when one has to call observer notifications for example. Example usage, serialize as usual

s.serialize("TFPrimitives", values_, "point");

Then deserialize with notifications:

util::IndexedDeserializer<std::unique_ptr<TFPrimitiveSet>>("TFPrimitives", "point")
.onNew([&](std::unique_ptr<TFPrimitiveSet>& primitive) {
notifyControlPointAdded(primitive.get());
})
.onRemove([&](std::unique_ptr<TFPrimitiveSet>& primitive) {
notifyControlPointRemoved(primitive.get());
})(d, values_);

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