Inviwo 0.9.12-pre
Inviwo documentation
Loading...
Searching...
No Matches
inviwo::util::IndexedDeserializer< T > Class Template Reference

#include <deserializer.h>

Public Member Functions

 IndexedDeserializer (std::string_view key, std::string_view 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:

.onNew([&](std::unique_ptr<TFPrimitiveSet>& primitive) {
notifyControlPointAdded(primitive.get());
})
.onRemove([&](std::unique_ptr<TFPrimitiveSet>& primitive) {
notifyControlPointRemoved(primitive.get());
})(d, values_);
Definition deserializer.h:420

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