Streamable 1.4.0

dotnet add package Streamable --version 1.4.0
NuGet\Install-Package Streamable -Version 1.4.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Streamable" Version="1.4.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Streamable --version 1.4.0
#r "nuget: Streamable, 1.4.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Streamable as a Cake Addin
#addin nuget:?package=Streamable&version=1.4.0

// Install Streamable as a Cake Tool
#tool nuget:?package=Streamable&version=1.4.0

Streamable

Fastest, Smallest and Simplest (De)Serializer for C++20 or newer.

Table of Contents

Installation

To use this library, simply download and include the header file Streamable.hpp into your project or use NuGet to install it.

Features

  • fast - fast^2, memory-- and easy++ compared to MsgPack
  • easy-to-use - inherit a class and use a macro 😄
  • single-header - just copy paste the file into your project
  • has no dependencies - uses the C++20 standard library and OS native API for best performance
  • cross-platform -
Platform Support Details
Windows Yes
macOS Partial No UTF16 encoding for memory--
Linux Partial No UTF16 encoding for memory--
  • supports every data type - beside itself (so called "streamables"), raw/smart pointers (ex:. std::unique_ptr, std::shared_ptr etc...), most STL classes (std::tuple, std::optional, std::variant etc...), any nested range (ex.: std::wstring, std::map, std::vector<std::list> etc...), PODs (ex.: POD structs and classes, enums, etc...), primitive types (ex.: bool, unsigned int, double etc...)

Usage

  1. Inherit from the IStreamable class or any class that implements it.
  2. Use the macro STREAMABLE_DEFINE and pass your class and the objects you want to parse
  3. OPTIONAL For (de)serialization of inherited classes use STREAMABLE_DEFINE_BASE and pass the classes
  4. OPTIONAL If "streamables" pointers are (de)serialized you MUST implement FindDerivedStreamable (if you forget this, don't worry, a static_assert will scream 😮 )

Benchmark

This benchmark contains anything from trivial types to maps of strings to STL containers to vectors of derived classes as base class pointers etc...

Library Time (ms) Memory Usage (KB)
Streamable 0.379 85
nlohmann::json 2.9 187
MsgPack 0.755 87

Downsides and Limitations

While Streamable offers many benefits, it's essential to consider its limitations as well:

  • Custom Format - it has a custom but simple format for storing the data
  • Programming Language - supports only C++ >= 20

Examples

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.4.0 87 4/11/2024
1.3.0 134 3/15/2024
1.2.1 159 3/10/2024
1.2.0 160 3/6/2024
1.1.2 280 10/31/2023
1.1.1 193 10/29/2023
1.1.0 224 10/29/2023
1.0.0 170 10/21/2023

fixed a serialization bug
added support for parsing multiple inherited classes
fixed macro redefinition