Changelog History
Page 2
-
v4.6.0 Changes
March 12, 2019๐ Features
- new extensions StdTuple and StdVariant for
std::tuple
andstd::variant
. These are the first extensions that requires C++17, or higher, standard enabled. Althoughstd::tuple
is C++11 type, but from usage perspective it has exactly the same requirements asstd::variant
and relies heavily on having class template argument deduction guides to make it convenient to use. You can easily usestd::tuple
without any extension at all, so the main motivation was to create convenient interface for StdVariant and use the same interface for StdTuple as well.- instead of providing custom lambda to overload each type in tuple or variant, there was added several helper callable objects.
OverloadValue wrapper around
s.value<N>(o)
, OverloadExtValue wrapper arounds.ext<N>(o, Ext{})
and OverloadExtObject wrapper arounds.ext(o, Ext{})
.
- instead of providing custom lambda to overload each type in tuple or variant, there was added several helper callable objects.
OverloadValue wrapper around
- new extensions StdDuration and StdTimePoint for
std::chrono::duration
andstd::chrono::time_point
.
๐ Improvements
tests now uses
gtest_discover_tests
function, to automatically discover tests, which requires CMake 3.10. - new extensions StdTuple and StdVariant for
-
v4.5.1 Changes
January 16, 2019๐ Improvements
- template specializations, where possible, was changed to avoid using variadics, some Visual Studio compilers has issues with variadic templates.
- โฌ๏ธ reduced compile warnings for VisualStudio:
- added explicit casts
- renamed
struct
toclass
where class is used as friend. e.g.friend class bitsery::Access
, because it is more conventional usage.
-
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
supportsstd::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 inbitsery/ext/*
.
- 0๏ธโฃ ability to create non default constructible objects, by defining private default constructor and making
-
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 useext()
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 ofPolymorphicBaseClass
) that is used to declare hierarchy, by default it isPolymorphicBaseClass
. 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.
- 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.
-
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.
- โ 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.
-
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.
- changed CMake structure, to follow Modern CMake principles.
-
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.
- โ added raw pointers support via extensions.
In order to correctly manage pointer ownership, three extensions was created in **** header:
-
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.
- ๐ improved usage with Visual Studio:
-
v4.0.0 Changes
October 13, 2017I 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.