| 1011 | |
| 1012 | @tparam T The type of the class being serialized */ |
| 1013 | template <class T> inline |
| 1014 | std::uint32_t loadClassVersion() |
| 1015 | { |
| 1016 | static const auto hash = std::type_index(typeid(T)).hash_code(); |
| 1017 | auto lookupResult = itsVersionedTypes.find( hash ); |
| 1018 | |
| 1019 | if( lookupResult != itsVersionedTypes.end() ) // already exists |
| 1020 | return lookupResult->second; |
| 1021 | else // need to load |
| 1022 | { |
| 1023 | std::uint32_t version; |
| 1024 | |
| 1025 | process( make_nvp<ArchiveType>("cereal_class_version", version) ); |
| 1026 | itsVersionedTypes.emplace_hint( lookupResult, hash, version ); |
| 1027 | |
| 1028 | return version; |
| 1029 | } |
| 1030 | } |
| 1031 | |
| 1032 | //! Member serialization |
| 1033 | /*! Versioning implementation */ |