openMSX
Static Public Attributes | List of all members
openmsx::SerializeClassVersion< T > Struct Template Reference

Store serialization-version number of a class. More...

#include <serialize.hh>

Static Public Attributes

static const unsigned value = 1
 

Detailed Description

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

Store serialization-version number of a class.

Classes are individually versioned. Use the SERIALIZE_CLASS_VERSION macro below as a convenient way to set the version of a class.

The initial (=default) version is 1. When the layout of a class changes in an incompatible way, you should increase the version number. But remember: to be able to load older version the (de)serialize code for the older version(s) must be kept.

Version number 0 is special. It means the layout for this class will NEVER change. This can be a bit more efficient because the version number must not be stored in the stream. Though be careful to only use version 0 for VERY stable classes, std::pair is a good example of a stable class.

Definition at line 26 of file serialize.hh.

Member Data Documentation

◆ value

template<typename T >
const unsigned openmsx::SerializeClassVersion< T >::value = 1
static

Definition at line 446 of file serialize_meta.hh.


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