Skip to content

Releases: simulton/gpds

1.9.0

02 Oct 17:06
Compare
Choose a tag to compare

This release introduces C++20 concepts Serializable, Deserializable and SerializableRange and corresponding API to the container class. The main purpose/benefit of this new interface is to serialize/deserialize types without forcing inheritance from the gpds::serializable interface.

  • Introduce concept Serializable (0dd4eff).
  • Introduce concept Deserializable (fc9360a).
  • Add container::add_value() overload accepting Serializable object (475f1b0).
  • Add container::get_value() overload accepting Deserializable object (9d130f2).
  • Add container::get_values() overload accepting Deserializable object (049a4b9).
  • Add missing nullptr check to archiver_xml (27c2abe).
  • Update examples to use new Serializable and Deserializable concept interfaces.
  • Various code improvements.

1.8.4

17 Feb 22:40
Compare
Choose a tag to compare

This is a patch/maintenance release:

  • Previously, GPDS linked to the spdlog dependency if the CMake option GPDS_FEATURE_SPDLOG was set to ON. This is no longer the case. Everything spdlog related is contained in a header-only file. It's up to the consumer to link to spdlog if necessary. The CMake option GPDS_FEATURE_SPDLOG has been removed entirely and the spdlog_sink.hpp file is always installed (2e4c121).
  • Previously, consumers were in need to create the CMake library aliases gpds::gpds-static and gpds::gpds-shared when consuming GPDS in a superbuild scenario instead of via find_package(). From now on, GPDS provides those library aliases itself (thanks to @bjornstromberg) (36ea6e8).

1.8.3

04 Feb 21:16
Compare
Choose a tag to compare

This is a patch release only addressing an issue in the generated gpds-config.cmake script which resulted in always calling find_dependency(PkgConfig REQUIRED) (and subsequent call to located tinyxml2) even if the consuming system did not choose to use pkg-config to located tinyxml2.

1.8.2

02 Feb 02:20
Compare
Choose a tag to compare

Patch release adding support to optionally ingest the tinyxml2 dependency via CMake's find_package() or via pkg-config.
Thanks to @bjornstromberg

1.8.1

01 Dec 16:19
Compare
Choose a tag to compare

This release only has one change: The previous v1.8.0 release changed the default build settings to no longer build the static library with -fPIC. However, this library is often linked into downstream shared libraries to provide built-in de-serialization capabilities. Static libraries being linked into a shared library still require to be built with -fPIC.

1.8.0

01 Dec 00:11
Compare
Choose a tag to compare
  • Features
    • Add support for float.
    • Make value::get() more robust. Previously, this was potentially throwing std::bad_variant_access when calling with a POD template parameter type while storing a nested container instead.
    • Decay type template parameters where reasonable. Previously, something like gpds::value::get<const int>() or gpds::container::get_value<const int>() would have failed. These template parameters are now decayed before performing type conversions.
  • Fixes
    • Add missing include to utils.hpp (reported by @aboelens).
  • CMake
    • Set feature GPDS_FEATURE_SPDLOG to OFF by default
    • Remove setting of the POSITION_INDEPENDENT_CODE property on the static library target
    • Introduce GPDS_BUILD_STATIC and GPDS_BUILD_SHARED options to independently control which libraries are being built. When using MSVC, these two options are mutually exclusive as they would result in naming conflicts/collisions of the generated *.LIB files (reported by @aboelens)..

1.7.0

05 Oct 14:41
Compare
Choose a tag to compare
  • Add support for std::size_t
  • Add container::get_value() and container::get_attribute() overloads accepting a default value parameter
  • Refactor & simplify interfaces
    • archiver no longer provides high-level interfaces to (de)serialize to/from strings, files etc. Archivers only operate on streams.
    • serializable no longer provides high-level interfaces for (de)serialization to/from strings, files etc.
    • All (de)serialization operations are now performed through the various free standing functions:
      • gpds::to_stream() / gpds::from_stream:
      • gpds::to_string() / gpds::from_string():
      • gpds::to_file() / gpds::from_file():
  • Minor internal code improvements

Note: This bumps the minimum required C++ standard to C++20.

1.6.0

14 Jul 16:16
Compare
Choose a tag to compare

General

  • Add YAML support (thanks to @vowstar)
  • Improve testing infrastructure
  • Various minor internal improvements

Serialization interface

The serialization interface gpds::serialize was extended. These previously existing functions are now marked as deprecated:

  • gpds::serialize::to_string()
  • gpds::serialize::from_string()
  • gpds::serialize::to_file()
  • gpds::serialize::from_file()

As a replacement, free-standing function templates have been introduced which provide the following benefits:

  • They accept the archiver as a template parameter (for example gpds::archiver_xml or gpds::archiver_yaml).
  • They can optionally automatically fetch the serialization root name from a serializable via the T::gpds_name static member (if present).
  • Once the now deprecated member functions are removed, potential function/name collisions are avoided.

As such, consuming code should replace the now deprecated functions listed above with call to the corresponding replacements:

  • gpds::to_string()
  • gpds::from_string()
  • gpds::to_file()
  • gpds::from_file()

As an example, previous consuming code would have looked like this:

class dut :
    public gpds::serialize
{
    // ...
};

dut d;
const auto& [success, msg] = d.to_string(str, "dut");

Now looks like this:

class dut :
    public gpds::serialize
{
    static constexpr const char* gpds_name = "dut";

    // ...
};

dut d;
const auto& [success, msg] = gpds::to_string<gpds::archiver_xml>(str, d);

Refer to /examples/basic/ for more information.

1.5.1

07 Mar 17:22
Compare
Choose a tag to compare

General

  • Add support for std::string_view (99b44ec)
  • Fix potential memory leak in example (2d48534)
  • Remove custom exporting in favor of exporting all symbols via CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS (c38c594)
  • Minor internal improvements

CMake

  • Remove non-existing target from install() (f5fc8b4)
  • Remove redundant setting of some CPack variables (f397214)

1.5.0

12 May 13:04
Compare
Choose a tag to compare
  • Fix bug in archiver::save(std::string&).
  • Fix bug in CMake install() usage.
  • Add serialize::to_string() and serialize::from_string() convenience functions.
  • Add an spdlog sink for easy sinking of log messages to GPDS containers (optional, see CMake option GPDS_FEATURE_SPDLOG).
  • Add explicit support for handling <![CDATA[]]>. Values can now explicitly request to be serialized to XML using CDATA via value::set_use_cdata().
  • Internal improvements to archiver_xml implementation.
  • Pass std::string_view by value instead of by const-ref where applicable.
  • Use std::string_view instead of const std::string& to pass root name where applicable.

Furthermore:

  • Improve/extend examples
  • Improve/extend test cases
  • Minor CMake improvements