openMSX
Public Types | Public Member Functions | List of all members
openmsx::SerializeConstructorArgs< T > Struct Template Reference

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
 

Detailed Description

template<typename T>
struct openmsx::SerializeConstructorArgs< T >

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.

Member Typedef Documentation

◆ type

template<typename T >
using openmsx::SerializeConstructorArgs< T >::type = std::tuple<>

Definition at line 33 of file serialize_constr.hh.

Member Function Documentation

◆ load()

template<typename T >
template<typename Archive >
type openmsx::SerializeConstructorArgs< T >::load ( Archive &  ,
unsigned   
) const
inline

◆ save()

template<typename T >
template<typename Archive >
void openmsx::SerializeConstructorArgs< T >::save ( Archive &  ,
const T &   
) const
inline

Definition at line 35 of file serialize_constr.hh.

Referenced by openmsx::ClassSaver< T >::operator()().


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