openMSX
|
Serialize (local) constructor arguments. More...
#include <serialize_constr.hh>
Public Types | |
using | type = std::tuple<> |
Public Member Functions | |
template<typename Archive > | |
void | save (Archive &, const T &) const |
template<typename Archive > | |
type | load (Archive &, unsigned) const |
Serialize (local) constructor arguments.
Some classes don't have a default constructor. To be able to create new instances of such classes, we need to invoke the constructor with some parameters (see also Creator utility class above).
SerializeConstructorArgs can be specialized for classes that need such extra constructor arguments.
This only stores the 'local' constructor arguments, this means the arguments that are specific per instance. There can also be 'global' args, these are known in the context where the class is being loaded (so these don't need to be stored in the archive). See below for more details on global constr args.
The serialize_as_enum class has the following members: using type = tuple<...> Tuple that holds the result of load() (see below) void save(Archive& ar, const T& t) This method should store the constructor args in the given archive type load(Archive& ar, unsigned version) This method should load the args from the given archive and return them in a tuple.
Definition at line 31 of file serialize_constr.hh.
using openmsx::SerializeConstructorArgs< T >::type = std::tuple<> |
Definition at line 33 of file serialize_constr.hh.
|
inline |
Definition at line 37 of file serialize_constr.hh.
Referenced by openmsx::NonPolymorphicPointerLoader< T >::operator()().
|
inline |
Definition at line 35 of file serialize_constr.hh.
Referenced by openmsx::ClassSaver< T >::operator()().