All Versions
23
Latest Version
Avg Release Cycle
62 days
Latest Release
221 days ago

Changelog History
Page 2

  • v4.5.0 Changes

    January 10, 2019

    ๐Ÿ”‹ Features

    • 0๏ธโƒฃ ability to create non default constructible objects, by defining private default constructor and making friend class bitsery::Access; to access it. It is not necessary to enforce class invariant immediately, because internal object representation will be overriden anyway.

    ๐Ÿ‘Œ Improvements

    • ๐Ÿ‘ StdSmartPtr supports std::unique_ptr with custom deleter.
    • *InputBufferAdapter(all) can also accept const buffer;

    ๐Ÿ› Bug fixes

    • ๐Ÿ›  fixed deserialization in bitsery/ext/std_map{set} when target container is not empty.
    • โž• added missing template parameters for specializations on std containers in multiple files in bitsery/ext/*.
  • v4.4.0 Changes

    January 08, 2019

    ๐Ÿ”‹ Features

    • new extensions CompactValue and CompactValueAsObject, stores integral values in less space if possible. This is useful when you're working with mostly small values, that in rare cases can be large. E.g. int64_t money = 8000; will only use 2 bytes, instead of 8. CompactValueAsObject allows to use ext() overload, without specifying size of underlying type and sets BUFFER_OVERFLOW error if value doesn't fit in underlying type during deserialization.

    ๐Ÿ‘Œ Improvements

    • improved PolymorphicContext, allows to extend already registered hierarchy in one translation unit, using different type other than PolymorphicBaseClass to avoid symbol collision between translation units or libraries. 0๏ธโƒฃ registerBasesList was modified, so that it could accept user defined type (instead of PolymorphicBaseClass) that is used to declare hierarchy, by default it is PolymorphicBaseClass. This introduced breaking change, for those who used this syntax (registerBasesList<MySerializer, Shape>({})) during registration. It is encouraged to define helper type, that could be used for registering hierarchy for serialization and deserialization [example](examples/smart_pointers_with_polymorphism.cpp). This is only relevant then you want to use **PolymorphicContext** between different translation units or libraries. ```cpp //libA namespace bitsery { namespace ext { template<> struct PolymorphicBaseClass : PolymorphicDerivedClasses {}; } } using MyPolymorphicClassesForRegistering = bitsery::ext::PolymorphicClassesList; ... ctx.registerBasesList(MyPolymorphicClassesForRegistering{}).

    //otherLib struct MySquare: Shape {...} //now it must define different type (exactly the same as PolymorphicBaseClass) to declare hierarchy template struct MyHierarchy { using Childs = PolymorphicClassesList<>; };

    template <> struct MyHierarchy: bitsery::ext::bitsery::ext::PolymorphicClassesList {}; ... //notice that we pass MyHierarchy as second argument ctx.registerBasesList(MyPolymorphicClassesForRegistering{}).

    * **PolymorphicContext** also get optional method `registerSingleBaseBranch`, that allows manually register hierarchies, this might be more convenient when using you need to register in different translation units (or libraries), but it is error-prone.
    
  • v4.3.0 Changes

    August 23, 2018

    ๐Ÿ”‹ Features

    • โž• added runtime polymorphism support for pointer like types (raw and smart pointers). In order to enable polymorphism new PolymorphicContext was created. It provides capability to register classes with serializer/deserializer.
      • runtime polymorphism can be customized, by replacing StandardRTTI from header.
    • added smart pointers support for std::unique_ptr, std::shared_ptr and std::weak_ptr via StdSmartPtr extension.
    • new UnsafeInputBufferAdapter doesn't check for buffer size on deserialization, on some compilers can improve deserialization performance up to ~40%.

    ๐Ÿ‘Œ Improvements

    • creatly improved interface for extending/implementing support for pointer like types. Now all pointer like types extends from PointerObjectExtensionBase and implements/configures required details.
    • reimplemented PointerOwner, PointerObserver, ReferencedByPointer.
    • reimplemented PointerLinkingContext to properly support shared objects and runtime polymorphism, pointer ownership for shared objects now has two states: SharedOwner e.g. std::shared_ptr and SharedObserver std::weak_ptr.

    Other notes

    There is one minor? issue/limitation for pointer like types that uses virtual inheritance. When several pointers points to same object through different static type. it will not work correctly e.g.:

    struct Derived: virtual Base {...};
    struct MyData {
        std::shared_ptr<Derived> sptr;
        std::weak_ptr<Base> wptddr;
    }
    

    In this example wptr and sptr have different static type, and Derived is virtually inherited from Base, so I get different pointer address for different types.

  • v4.2.1 Changes

    March 09, 2018

    ๐Ÿ‘Œ Improvements

    • changed CMake structure, to follow Modern CMake principles.
      • bitsery now has install target and find_package(Bitsery) exports Bitsery::bitsery target.
      • GTest no longer downloads as external application, but tries to find via find_package.
      • removed ext folder, and instead added scripts folder that contains few helper scripts for development, currently tested on Ubuntu.
    • ๐Ÿ›  fixed/added few tests cases.

    Other notes

    • ๐ŸŽ some work was done on polymorphism support, but current solution, although working, but has many design and performance issues, and interfaces for extensibility might change drastically.
  • v4.2.0 Changes

    November 12, 2017

    ๐Ÿ”‹ 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.
  • v4.1.0 Changes

    October 27, 2017

    ๐Ÿ”‹ Features

    • โž• added raw pointers support via extensions. In order to correctly manage pointer ownership, three extensions was created in **** header:
      • PointerOwner - manages life time of the pointer, creates or destroys if required.
      • PointerObserver - doesn't own pointer so it doesn't create or destroy anything.
      • ReferencedByPointer - when non-owning pointer (PointerObserver) points to reference type, this extension marks this object as a valid target for PointerObserver.

    To validate and update pointers PointerLinkingContext have to be passed to serialization/deserialization. It ensures that all pointers are valid, that same pointer doesn't have multiple owners, and non-owning pointers doesn't point outside of scope (i.e. non owning pointers points to data that is serialized/deserialized), see [raw_pointers example](examples/raw_pointers.cpp) for usage example.

    Currently polimorphism and std::shared_ptr, std::unique_ptr is not supported.

    • added context<T>() overload to BasicSerializer/BasicDeserializer and now they became typesafe. For better extensions support, added posibility to have multiple types in context with std::tuple. E.g. when using multiple extensions, that requires specific contexts, together with your custom context, you can define your context as std::tuple<PointerLinkingContext, MyContext> and in serialization function you can correctly get your data via context<MyContext>().

    ๐Ÿ‘Œ Improvements

    • new OutputBufferedStreamAdapter use internal buffer instead of directly writing to stream, can get more than 2x performance increase.
      • can use any contiguous container as internal buffer.
      • when using fixed-size, stack allocated container (std::array), buffer size via constructor is ignored.
      • default internal buffer is std::array.
    • added static_assert when trying to use BufferAdapter with non contiguous container.
  • v4.0.1 Changes

    October 18, 2017

    ๐Ÿ‘Œ Improvements

    • ๐Ÿ‘Œ improved usage with Visual Studio:
      • improved CMake.
      • Visual Studio doesn't properly support expression SFINAE using std::void_t, so it was rewritten.
    • refactorings to remove compiler warnings when using -Wextra -Wno-missing-braces -Wpedantic -Weffc++
    • added assertion when session is empty (sessions is created via growable extension).
    • stream adapter manually setstate to std::ios_base::eofbit when unable to read required bytes.
  • v4.0.0 Changes

    October 13, 2017

    I feel that current library public API is complete, and should be stable for long time. ๐ŸŽ Most changes was made to improve performance or/and make library usage easier.

    ๐Ÿ”‹ Features

    • new flexible syntax similar to cereal library. This syntax no longer requires to specify explicit fundamental type sizes and container maxsize (container max size can be enforced by special function maxSize). Be careful when using deserializing untrusted data and make sure to enforce fundamental type sizes when using on multiple platforms. (use helper function assertFundamentalTypeSizes to enforce type sizes for multiple platforms)
    • added streaming support, by introducing new adapter concept. Two adapter implementations is available: stream adapter, or buffer adapter.
    • added missing std containers support: forward_list, deque, stack, queue, priority_queue, set, multiset, unordered_set, unordered_multiset.

    ๐Ÿ’ฅ Breaking changes

    • a lot of classes and files were renamed.
    • ๐Ÿ‘Œ improved error messages.
    • traits reworked:
      • ContainerTraits get isContiguous.
      • TextTraits is separate from ContainerTraits, only has length, and addNUL.
      • buffer traits renamed to BufferAdapterTraits and removed difference type.
      • added TValue to all trait types, this is used to diagnose better errors.
    • BasicBufferReader/Writer is split in two different types: AdapterReader/Writer and separate type that enables bit-packing operations AdapterBitPacking(Reader/Writer)Wrapper.
    • Serializer/Deserializer reworked
      • No longer copyable, because it stores adapter writer/reader.
      • Removed boolByte, boolBit, and added boolValue and it writes bit or byte, depeding on if bit-packing is enabled or not.
      • Bit-packing is enabled by calling enableBitPacking, if bitpacking is already enabled, this method will return same instance.
    • 0๏ธโƒฃ changed defaults for DefaultConfig, BufferSessionsEnabled is false by default, because it doesn't work with input streams.
    • serialization config no longer needs typedef Buffer.
  • v3.0.0 Changes

    September 21, 2017

    ๐Ÿ”‹ Features

    • โ™ป๏ธ refactored interface, now works with C++11 compiler.
    • new extension Growable, that allows to have forward/backward compatability within this functions serialization flow. It only allows to append new data at the end of to existing flow without breaking old consumers.
      • old consumer: correctly read old interfce and ignore new data.
      • new consumer: get defaults (zero values) for new fields, when reading old data.
    • added new extension for associative map containers ContainerMap.
    • friendly static_assert message when serializing object, that doesn't have serialize function defined.
    • added object overload, that invokes user function/lambda with object. It is the same as calling user function directly, but makes more consistent API.
    • Serializer/Deserializer now have optional context parameter, that might be required in some specific serialization cases.
    • added traits for custom types specialization, in details/traits.h
    • ๐Ÿ‘Œ improved serialization performance: added support for fixed size buffer for BufferWriter for best performance.
    • ๐Ÿ‘Œ improved performance for reading/writing container sizes.
    • added new method to BufferReader getError which returns on of three values: NO_ERROR, BUFFER_OVERFLOW, INVALID_BUFFER_DATA, also added setError method, that is only used by Deserializer.

    ๐Ÿ’ฅ Breaking changes

    • now all serializer/deserializer functions return void, to avoid undefined behaviour for functions parameters evaluation when using method chaining. There was no benefits apart from nicer syntax, but could have undefined behaviour when building complex serialization flows.
    • removed SERIALIZE macro, and changed interface for all functions that use custom lambdas, to work with C++11. Now lambda function must capture serializer/deserializer.
    • to make serializer a little bit lighter removed advanced features and made available as extensions via extend method
      • removed range method, instead added ValueRange extension.
      • removed substitution method, instead added Entropy extension, to sound more familiar to entropy encoding term.
    • removed array, instead added fixed sizes overloads for container.
    • removed isValid method from Deserializer, only BufferReader/Writer store states.
    • container and text sizes representation changed, to allow much faster size reads/writes for small values.
    • ๐Ÿ“‡ renamed functions:
      • ext to extend and changed its interface, to make it more easy to extend.
      • alias functions that write bytes directly no has b (meaning bytes) at the end of the name eg. value4 now is value4b.
    • ๐Ÿ”„ changed BufferWriter/Reader behaviour:
      • added support for fixed size buffers for better serializer performance (more than 50% improvement). Default config is resizable buffer (std::vector).
      • after serialization, call getWrittenRange to get valid range written to buffer, because BufferWritter for resizable buffer now always resize to capacity to avoid using back_insert_iterator for better performance.
      • BufferReader has constructor with iterators (range), and raw value type pointers (begin, end).
    • renamed BufferReader isCompleted to isCompletedSuccessfully, that returns true only when there is no errors and buffer is fully read.

    ๐Ÿ› Bug fixes

    • readBytes was reading in aligned mode, when scratch value from previous bit operations was zero.
    • writeBits had incorrect assert when writing negative int64_t.
  • v2.0.1 Changes

    August 12, 2017

    Other notes

    • โž• added travis build status