utils/include/serialize_extra

namespace feasst

Functions

template<typename T>
std::shared_ptr<T> template_deserialize(std::map<std::string, std::shared_ptr<T>> &map, std::istream &istr, bool rewind = false)

Return a shared pointer to the base class of model after construction of the full derived class. see https://isocpp.org/wiki/faq/serialization

param rewind:

Rewind istr position to read class name again (default: false).

template<typename T>
std::shared_ptr<T> template_factory(std::map<std::string, std::shared_ptr<T>> &map, std::string class_name, argtype *args)

A factory method to construct objects from argtype.

template<typename T>
std::shared_ptr<T> deep_copy_derived(std::shared_ptr<T> object)

Return a deep copy of a feasst derived class object. This is implemented via serialization/deserialization.

template<typename T>
std::shared_ptr<T> deep_copy_derived(T *object)
template<typename T>
T deep_copy(const T &object)

Return a deep copy. This is implemented via serialization/deserialization.