Skip to content

Releases: pnxs/dots-cpp

v1.8.0

16 Nov 15:44
41ebb36

Choose a tag to compare

v1.8.0: Designated Initialization / C++20

THIS VERSION INCLUDES BREAKING CHANGES. SEE MIGRATION NOTES BELOW FOR MORE DETAILS.

C++20

  • The library is now based on C++20 to allow usage of certain features; particularly designated initialization (6b5b840).
  • Note that the project will only use a selected subset of C++20 that is provided by the set of officially supported compilers (03481bf), which did not change with this release.

Structs

  • DOTS struct types now use an init approach based on C++20's designated initialization, which was previously available experimentally and has proven to be both viable and stable (d5c572e).
  • Note that this is a breaking change, because the previous initialization approach was removed entirely. See migration notes for assistance on how to migrate projects.

Channels

  • TCP channels and listeners now use a version specific default port when none is specified (51e6856).
  • Note that this is a breaking change, because the previous '11234' port is now used by tcp-v1 channels to be backwards compatible with legacy applications, while 'tcp-v2' channels (or just 'tcp' respectively) now use '11235'.

Misc

  • Updated RapidJSON to latest master revision (00f43c1).

Bugfixes

  • Fixed ordering of invalid properties (707a493).
  • Fixed property comparison with left-hand values (4c8fbaf).
  • Fixed removal of timers and FD observers from their handlers (81d6fe2).
  • Fixed regression that broke Clang builds (b85b1dd; fbf7159).
  • Fixed an issue related to library bundling that caused succeeding builds to fail when cleaning the build directory (e.g. via the 'clean' target; d26b200).

Migration Notes

Struct initialization

Initialization of DOTS struct types now has to be performed via C++20's designated initialization. This way of initialization was already available experimentally for some time and completely replaces the previous approach based on initializer types (d5c572e).

Examples:

dots::publish(RoundtripData{
    RoundtripData::id_i{ i },
    RoundtripData::someString_i{ "foobar" },
    RoundtripData::someFloat_i{ 3.1415f }
});

|
v

dots::publish(RoundtripData{
    .id = 0,
    .someString = "foobar",
    .someFloat = 3.1415f
});

Automation:

WARNING: The procedure below does not cover all cases and does not relieve the developer from manually reviewing the changes!

Migration to designated initialization can partially be automated by applying the following search and replace steps in order:

  1. Replace container key inits: \(\s*(\w+)::(\w+)_i(\{|\()\s*([^\}\),$]+)\s*\}\s*\) -> ({ .$2 = $4})
  2. Replace simple single-line inits: ^(\s*)(\w+)::(\w+)_i(\{|\()[ ]*(.+?)([ ]*\}|\))(,?)$ -> $1.$3 = $5$7
  3. Replace sub-struct property inits: ^(\s*)(\w+)::(\w+)_i(\{|\()\s*$ -> $1.$3 = $4
  4. Replace complex inits
    1. Trailing properties pass (repeat until no longer matched; repeat with parentheses instead of braces if necessary): ,(\s*)(\w+)::(\w+)_i(\{)[ ]*(.+?)([ ]+\}) -> ,$1.$3 = $5
    2. Sub-struct property pass (repeat until no longer matched, repeat with parentheses instead of braces if necessary): =(\s*)(\w+)::(\w+)_i\{ -> = $2{ .$3 =
    3. Leading properties pass (repeat until no longer matched, repeat with parentheses instead of braces if necessary): (\w+)::(\w+)_i(\{)[ ]*(.+?)([ ]+\}) -> .$2 = $4
  5. Search and manually replace default inits: ^\s*\w+::\w+_i\{\} (Beware that just = {} will create an invalid (i.e. empty) property. Default initialization (e.g. an empty vector) requires the explicit type (e.g. = dots::vector_t<dots::float_t>{})
  6. Build and inspect possible errors.
  7. Clean up stragglers, vector properties and fix initialization order by hand as necessary.

v1.7.0

11 Aug 17:24
a81708c

Choose a tag to compare

v1.7.0: Improved Freedom

THIS VERSION INCLUDES BREAKING CHANGES. SEE MIGRATION NOTES BELOW FOR MORE DETAILS.

LGPLv3 License

DOTS can now be licensed under the LGPLv3 in addition to the GPLv3. This allows you to use the library in closed-source projects if it is linked dynamically.

Properties

  • Properties now have a much simpler interface that is similar to std::optional. This includes the addition of dots::invalid, which can be used for assignment and comparison similar to std::nullopt (0bf69a8, 4ed94fe).
  • Static property values can now be properly inspected when debugging (84ed06a).
  • Properties can now be properly compared with left-hand values in all scenarios, even if they are invalid (fc96b79).
  • Property functions no longer participate in the overload resolution when the arguments are incompatible. This was done to provide more immediate error feedback, particularly for IDEs, where the compatibility can now be checked more easily (87bd823).

Descriptors

  • The descriptor architecture has been simplified, resulting in faster build times and smaller average binary sizes (deae920).
  • Various small functions have been made header-only to improve performance (841e185).

Events

  • The clone information of a container instance is no longer copied when an event is created. Note that this also allows users to responsibly keep references to clone information in the container similar to instances (ea8b4dc).

Chrono

  • Added experimental support to override the (local) timezone used by dots::timepoint_t::toString. Note that this can be also used to set a particular timezone once and avoid significant overhead of continuously retrieving the current timezone from the system on every call (6e8128d).

Bugfixes

  • The dots::timepoint_t::FromString function now parses ISO timestamps with a UTC designator; aka "Zulu time" (c25d08a).
  • Text-based serializers (e.g. JsonSerializer) now invalidate a property on 'invalid' input (e.g. 'null' in the case of JSON) (bc76d0d).
  • The DOTS daemon no longer prematurely cleans up stale client/guest statuses (93ec3a0).
  • Properties can now correctly be constructed or assigned from other (invalid) properties in all scenarios (0c2d0dd).
  • The less operation of static struct types now uses the static version instead of the dynamic one (4b03740).

Migration Notes

Descriptor compare operations

The descriptor compare operations (less, greater, greaterEqual etc.) now require an explicit template argument if the value arguments are of different types (deae920).

Examples:

  • stringDescriptor.less(someString, "someStringLiteral") -> stringDescriptor.less<dots::string>(someString, "someStringLiteral")
  • stringDescriptor.greaterEqual(someString, "someStringLiteral") -> stringDescriptor.greaterEqual<dots::string>(someString, "someStringLiteral")

Struct and enum descriptor templates

The StructDescriptor and EnumDescriptor classes are no longer templates and corresponding arguments have to be removed (eb1ba87).

Examples:

  • StructDescriptor<> -> StructDescriptor
  • EnumDescriptor<> -> EnumDescriptor

Implicit property value conversions

Properties can no longer be implicitly converted to their value (6fdc72b).

Examples:

  • someIntFunction(someIntProperty) -> someIntFunction(*someIntProperty)
  • someIntFunction(someIntProperty) -> someIntFunction(someIntProperty.value())
  • std::cout << someIntProperty -> std::cout << *someIntProperty)
  • LOG_INFO_S(someIntProperty) -> LOG_INFO_S(*someIntProperty)

Property interface simplification

The property interface has been simplified and no longer distinguishes between construction and assignment. Instead, all corresponding calls to construct, assign and constructOrAssign must be replaced by calls to emplace or the assignment operator. Additionally, constructOrValue has been renamed to valueOrEmplace for consistency (0bf69a8).

Examples:

  • someIntProperty.construct(42) -> someIntProperty.emplace(42)
  • someIntProperty.assign(42) -> someIntProperty.emplace(42)
  • someIntProperty.constructOrAssign(42) -> someIntProperty.emplace(42)
  • someIntProperty.construct(42) -> someIntProperty = 42
  • dots::in32_t i = someIntProperty.constructOrValue(42) -> dots::in32_t i = someIntProperty.valueOrEmplace(42)

Property emplace operator

The property emplace operator has been removed and must be replaced by an explicit call to emplace or the assignment operator (4e8d267, 0bf69a8).

Examples:

  • someIntProperty(42) -> someIntProperty.emplace(42)
  • someIntProperty(42) -> someIntProperty = 42

Property destruction

The destroy function of properties has been renamed to reset. Alternatively, properties can now also be invalidated by using the std::nullopt-like dots::invalid value (4ed94fe).

Examples:

  • someIntProperty.destroy() -> someIntProperty.reset()
  • someIntProperty.destroy() -> someIntProperty = dots::invalid

v1.6.2: Merge pull request #70 from pnxs/overhaul-timers-and-fd-handler

28 Mar 15:49
f1598d3

Choose a tag to compare

v1.6.1: Merge pull request #69 from pnxs/resolve-various-build-issues

17 Mar 12:45
67af339

Choose a tag to compare

v1.6: Merge pull request #68 from pnxs/introduce-stream-channel-versioning

14 Mar 09:01
82d4eb7

Choose a tag to compare

  • Introduce versioning of stream based channels
  • Overhaul application
  • Improve serializers
  • Allow to configure if boost-libs should be used shared or static

v1.5.2: Merge pull request #61 from pnxs/introduce-universal-handlers

22 Jan 14:49
53f9fce

Choose a tag to compare