Bitsery v4.2.0 Release Notes

Release Date: 2017-11-12 // over 6 years ago
  • ๐Ÿ”‹ Features

    • serializer/deserializer can now have internal context(s) via configuration. 0๏ธโƒฃ It is convenient way to pass context, when it doesn't convey useful information outside of serializer/deserializer and is default constructable.
    • added contextOrNull<T>() overload to BasicSerializer/BasicDeserializer. Difference between contextOrNull<T>() and context<T>() is, that using context<T>() code doesn't compile if T doesn't exists at all, while using contextOrNull<T>() code compiles, but returns nullptr at runtime.
    • โž• added inheritance support via extensions. In order to correctly manage virtual inheritance two extensions was created in **** header:
      • BaseClass<TBase> - use when inheriting from objects without virtual inheritance.
      • VirtualBaseClass<TBase> - ensures that only one copy of each virtual base class is serialized.

    To keep track of virtual base classes InheritanceContext is required, but it is optional if no virtual bases exists in serialization flow. I.e. if context is not defined, code will not compile only if virtual inheritance is used. See [inheritance](examples/inheritance.cpp) for usage example.

    ๐Ÿ‘Œ Improvements

    • added optional ctor parameter for PointerOwner and PointerObserver - PointerType, which specifies if pointer can be null or not. Default is Nullable.