You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iggy.apache.org by kd...@apache.org on 2025/05/10 18:48:19 UTC
(iggy) 01/01: Initial commit with existing iggy-rs/iggy-cpp-client code
This is an automated email from the ASF dual-hosted git repository.
kdowney pushed a commit to branch migrate-cpp-client
in repository https://gitbox.apache.org/repos/asf/iggy.git
commit 81512267a26dca37a8b61f85a470dd38c0e7c44d
Author: 0xG0nz0 <86...@users.noreply.github.com>
AuthorDate: Sat May 10 14:48:10 2025 -0400
Initial commit with existing iggy-rs/iggy-cpp-client code
---
foreign/cpp/.clang-format | 7 +
foreign/cpp/.devcontainer/devcontainer.json | 32 +
foreign/cpp/.devcontainer/post-install.sh | 11 +
foreign/cpp/.github/CODE_OF_CONDUCT.md | 124 +
foreign/cpp/.github/ISSUE_TEMPLATE/bug_report.md | 33 +
.../cpp/.github/ISSUE_TEMPLATE/feature_request.md | 20 +
foreign/cpp/.github/PULL_REQUEST_TEMPLATE.md | 26 +
foreign/cpp/.github/SECURITY.md | 9 +
foreign/cpp/.github/linters/.hadolint.yaml | 4 +
foreign/cpp/.github/linters/.markdown-lint.yml | 2 +
foreign/cpp/.github/workflows/ci.yml | 110 +
foreign/cpp/.github/workflows/devcontainer-ci.yml | 49 +
foreign/cpp/.gitignore | 41 +
foreign/cpp/.lcovrc | 3 +
foreign/cpp/.pre-commit-config.yaml | 91 +
foreign/cpp/.yamllint | 3 +
foreign/cpp/CMakeLists.txt | 107 +
foreign/cpp/CMakePresets.json | 54 +
foreign/cpp/CONTRIBUTORS.md | 49 +
foreign/cpp/CPPLINT.cfg | 3 +
foreign/cpp/Doxyfile | 2657 ++++++++++++++++++++
foreign/cpp/LICENSE | 21 +
foreign/cpp/README.md | 5 +
foreign/cpp/cmake/modules/CodeCoverage.cmake | 842 +++++++
foreign/cpp/docs/CMakeLists.txt | 16 +
foreign/cpp/docs/images/init_act.png | Bin 0 -> 161574 bytes
foreign/cpp/docs/images/pre-commit_run.png | Bin 0 -> 148646 bytes
.../iggy-cpp-build/.devcontainer/devcontainer.json | 39 +
foreign/cpp/images/iggy-cpp-build/README.md | 6 +
foreign/cpp/sdk/binary.h | 61 +
foreign/cpp/sdk/client.cc | 24 +
foreign/cpp/sdk/client.h | 92 +
foreign/cpp/sdk/command.h | 465 ++++
foreign/cpp/sdk/json.cc | 1 +
foreign/cpp/sdk/json.h | 26 +
foreign/cpp/sdk/model.cc | 1 +
foreign/cpp/sdk/model.h | 663 +++++
foreign/cpp/sdk/net/address.cc | 35 +
foreign/cpp/sdk/net/address.h | 51 +
foreign/cpp/sdk/net/conn.cc | 5 +
foreign/cpp/sdk/net/conn.h | 51 +
foreign/cpp/sdk/net/http/conn.cc | 1 +
foreign/cpp/sdk/net/http/conn.h | 1 +
foreign/cpp/sdk/net/iggy.cc | 25 +
foreign/cpp/sdk/net/iggy.h | 45 +
foreign/cpp/sdk/net/protocol.cc | 24 +
foreign/cpp/sdk/net/protocol.h | 110 +
foreign/cpp/sdk/net/quic/address.h | 1 +
foreign/cpp/sdk/net/quic/conn.h | 1 +
foreign/cpp/sdk/net/quic/stream.h | 1 +
foreign/cpp/sdk/net/ssl/crypto.cc | 72 +
foreign/cpp/sdk/net/ssl/crypto.h | 312 +++
foreign/cpp/sdk/net/ssl/ssl.cc | 196 ++
foreign/cpp/sdk/net/ssl/ssl.h | 150 ++
foreign/cpp/sdk/net/ssl/ssl_engine.h | 5 +
foreign/cpp/sdk/net/tcp/conn.cc | 1 +
foreign/cpp/sdk/net/tcp/conn.h | 1 +
foreign/cpp/sdk/net/transport.h | 31 +
foreign/cpp/sdk/serialization.cc | 20 +
foreign/cpp/sdk/serialization.h | 29 +
foreign/cpp/sdk/types.h | 25 +
foreign/cpp/tests/CMakeLists.txt | 85 +
foreign/cpp/tests/e2e/e2e_testutils.cc | 33 +
foreign/cpp/tests/e2e/e2e_testutils.h | 22 +
foreign/cpp/tests/e2e/ping_cmd_test.cc | 14 +
foreign/cpp/tests/e2e/server.toml | 375 +++
foreign/cpp/tests/unit/client_test.cc | 9 +
foreign/cpp/tests/unit/crypto_test.cc | 34 +
.../cpp/tests/unit/iggy_protocol_provider_test.cc | 34 +
foreign/cpp/tests/unit/model_test.cc | 7 +
foreign/cpp/tests/unit/serialization_test.cc | 16 +
foreign/cpp/tests/unit/ssl_test.cc | 132 +
foreign/cpp/tests/unit/unit_testutils.cc | 47 +
foreign/cpp/tests/unit/unit_testutils.h | 28 +
foreign/cpp/vcpkg-configuration.json | 14 +
foreign/cpp/vcpkg.json | 14 +
76 files changed, 7754 insertions(+)
diff --git a/foreign/cpp/.clang-format b/foreign/cpp/.clang-format
new file mode 100644
index 00000000..312da64e
--- /dev/null
+++ b/foreign/cpp/.clang-format
@@ -0,0 +1,7 @@
+---
+BasedOnStyle: Chromium
+BreakConstructorInitializers: BeforeComma
+ConstructorInitializerAllOnOneLineOrOnePerLine: false
+ColumnLimit: 140
+IndentWidth: 4
+AccessModifierOffset: -4
diff --git a/foreign/cpp/.devcontainer/devcontainer.json b/foreign/cpp/.devcontainer/devcontainer.json
new file mode 100644
index 00000000..70203c44
--- /dev/null
+++ b/foreign/cpp/.devcontainer/devcontainer.json
@@ -0,0 +1,32 @@
+{
+ "name": "Iggy C++ Client",
+ "image": "docker.io/iggyrs/iggy-cpp-build:latest",
+ "customizations": {
+ "vscode": {
+ "extensions": [
+ "demiaochen.clang-format-indent-4",
+ "donjayamanne.githistory",
+ "eamodio.gitlens",
+ "formulahendry.code-runner",
+ "foxundermoon.shell-format",
+ "github.copilot",
+ "github.remotehub",
+ "github.vscode-github-actions",
+ "github.vscode-pull-request-github",
+ "ionutvmi.path-autocomplete",
+ "jbenden.c-cpp-flylint",
+ "mads-hartmann.bash-ide-vscode",
+ "matepek.vscode-catch2-test-adapter",
+ "ms-azuretools.vscode-docker",
+ "ms-vscode.cpptools-extension-pack",
+ "rangav.vscode-thunder-client",
+ "stuart.unique-window-colors",
+ "styled-components.vscode-styled-components",
+ "tamasfe.even-better-toml",
+ "vscode-icons-team.vscode-icons",
+ "waderyan.gitblame"
+ ]
+ }
+ },
+ "postCreateCommand": "${containerWorkspaceFolder}/.devcontainer/post-install.sh"
+}
diff --git a/foreign/cpp/.devcontainer/post-install.sh b/foreign/cpp/.devcontainer/post-install.sh
new file mode 100755
index 00000000..fc633b54
--- /dev/null
+++ b/foreign/cpp/.devcontainer/post-install.sh
@@ -0,0 +1,11 @@
+#!/usr/bin/env bash
+script_dir="$(dirname -- "$(realpath -- "$0")")"
+workspace_dir="$(dirname "${script_dir}")"
+
+# fix Git
+if ! git config --global --get safe.directory >/dev/null; then
+ git config --global --add safe.directory "${workspace_dir}"
+fi
+
+# set up pre-commit
+pre-commit install --install-hooks
diff --git a/foreign/cpp/.github/CODE_OF_CONDUCT.md b/foreign/cpp/.github/CODE_OF_CONDUCT.md
new file mode 100644
index 00000000..df1cbdfc
--- /dev/null
+++ b/foreign/cpp/.github/CODE_OF_CONDUCT.md
@@ -0,0 +1,124 @@
+# Contributor Covenant Code of Conduct
+
+## Our Pledge
+
+We as members, contributors, and leaders pledge to make participation in our
+community a harassment-free experience for everyone, regardless of age, body
+size, visible or invisible disability, ethnicity, sex characteristics, gender
+identity and expression, level of experience, education, socio-economic status,
+nationality, personal appearance, race, religion, or sexual identity
+and orientation.
+
+We pledge to act and interact in ways that contribute to an open, welcoming,
+diverse, inclusive, and healthy community.
+
+## Our Standards
+
+Examples of behavior that contributes to a positive environment for our
+community include:
+
+* Demonstrating empathy and kindness toward other people
+* Being respectful of differing opinions, viewpoints, and experiences
+* Giving and gracefully accepting constructive feedback
+* Accepting responsibility and apologizing to those affected by our mistakes,
+ and learning from the experience
+* Focusing on what is best not just for us as individuals, but for the
+ overall community
+
+Examples of unacceptable behavior include:
+
+* The use of sexualized language or imagery, and sexual attention or
+ advances of any kind
+* Trolling, insulting or derogatory comments, and personal or political attacks
+* Public or private harassment
+* Publishing others' private information, such as a physical or email
+ address, without their explicit permission
+* Other conduct which could reasonably be considered inappropriate in a
+ professional setting
+
+## Enforcement Responsibilities
+
+Community leaders are responsible for clarifying and enforcing our standards of
+acceptable behavior and will take appropriate and fair corrective action in
+response to any behavior that they deem inappropriate, threatening, offensive,
+or harmful.
+
+Community leaders have the right and responsibility to remove, edit, or reject
+comments, commits, code, wiki edits, issues, and other contributions that are
+not aligned to this Code of Conduct, and will communicate reasons for moderation
+decisions when appropriate.
+
+## Scope
+
+This Code of Conduct applies within all community spaces, and also applies when
+an individual is officially representing the community in public spaces.
+Examples of representing our community include using an official email address,
+posting via an official social media account, or acting as an appointed
+representative at an online or offline event.
+
+## Enforcement
+
+Instances of abusive, harassing, or otherwise unacceptable behavior may be
+reported to the community leaders responsible for enforcement at
+[hello@iggy.rs](mailto:hello@iggy.rs).
+All complaints will be reviewed and investigated promptly and fairly.
+
+All community leaders are obligated to respect the privacy and security of the
+reporter of any incident.
+
+## Enforcement Guidelines
+
+Community leaders will follow these Community Impact Guidelines in determining
+the consequences for any action they deem in violation of this Code of Conduct:
+
+### 1. Correction
+
+**Community Impact**: Use of inappropriate language or other behavior deemed
+unprofessional or unwelcome in the community.
+
+**Consequence**: A private, written warning from community leaders, providing
+clarity around the nature of the violation and an explanation of why the
+behavior was inappropriate. A public apology may be requested.
+
+### 2. Warning
+
+**Community Impact**: A violation through a single incident or series
+of actions.
+
+**Consequence**: A warning with consequences for continued behavior. No
+interaction with the people involved, including unsolicited interaction with
+those enforcing the Code of Conduct, for a specified period of time. This
+includes avoiding interactions in community spaces as well as external channels
+like social media. Violating these terms may lead to a temporary or
+permanent ban.
+
+### 3. Temporary Ban
+
+**Community Impact**: A serious violation of community standards, including
+sustained inappropriate behavior.
+
+**Consequence**: A temporary ban from any sort of interaction or public
+communication with the community for a specified period of time. No public or
+private interaction with the people involved, including unsolicited interaction
+with those enforcing the Code of Conduct, is allowed during this period.
+Violating these terms may lead to a permanent ban.
+
+### 4. Permanent Ban
+
+**Community Impact**: Demonstrating a pattern of violation of community
+standards, including sustained inappropriate behavior, harassment of an
+individual, or aggression toward or disparagement of classes of individuals.
+
+**Consequence**: A permanent ban from any sort of public interaction within
+the community.
+
+## Attribution
+
+This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0, available at [https://www.contributor-covenant.org/version/2/0/code_of_conduct.html](https://www.contributor-covenant.org/version/2/0/code_of_conduct.html).
+
+Community Impact Guidelines were inspired by [Mozilla's code of conduct
+enforcement ladder](https://github.com/mozilla/diversity).
+
+[homepage]: [https://www.contributor-covenant.org](https://www.contributor-covenant.org)
+
+For answers to common questions about this code of conduct, see the FAQ at [https://www.contributor-covenant.org/faq](https://www.contributor-covenant.org/faq). Translations are available at [https://www.contributor-covenant.org/translations](https://www.contributor-covenant.org/translations).
diff --git a/foreign/cpp/.github/ISSUE_TEMPLATE/bug_report.md b/foreign/cpp/.github/ISSUE_TEMPLATE/bug_report.md
new file mode 100644
index 00000000..dba24204
--- /dev/null
+++ b/foreign/cpp/.github/ISSUE_TEMPLATE/bug_report.md
@@ -0,0 +1,33 @@
+---
+name: Bug report
+about: Create a report to help us improve
+title: ''
+labels: ''
+assignees: 0xg0nz0
+
+---
+
+**Describe the bug**
+A clear and concise description of what the bug is.
+
+**To Reproduce**
+Steps to reproduce the behavior:
+
+1. Go to '...'
+1. Click on '....'
+1. Scroll down to '....'
+1. See error
+
+**Expected behavior**
+A clear and concise description of what you expected to happen.
+
+**Screenshots**
+If applicable, add screenshots to help explain your problem.
+
+**Desktop (please complete the following information):**
+
+- OS: [e.g. MacOS]
+- Version [e.g. 22]
+
+**Additional context**
+Add any other context about the problem here.
diff --git a/foreign/cpp/.github/ISSUE_TEMPLATE/feature_request.md b/foreign/cpp/.github/ISSUE_TEMPLATE/feature_request.md
new file mode 100644
index 00000000..e63995b7
--- /dev/null
+++ b/foreign/cpp/.github/ISSUE_TEMPLATE/feature_request.md
@@ -0,0 +1,20 @@
+---
+name: Feature request
+about: Suggest an idea for this project
+title: ''
+labels: ''
+assignees: 0xg0nz0
+
+---
+
+**Is your feature request related to a problem? Please describe.**
+A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
+
+**Describe the solution you'd like**
+A clear and concise description of what you want to happen.
+
+**Describe alternatives you've considered**
+A clear and concise description of any alternative solutions or features you've considered.
+
+**Additional context**
+Add any other context or screenshots about the feature request here.
diff --git a/foreign/cpp/.github/PULL_REQUEST_TEMPLATE.md b/foreign/cpp/.github/PULL_REQUEST_TEMPLATE.md
new file mode 100644
index 00000000..339f7ef0
--- /dev/null
+++ b/foreign/cpp/.github/PULL_REQUEST_TEMPLATE.md
@@ -0,0 +1,26 @@
+# **PR Submission Guidelines**
+
+**Please remove this entire section before submitting your PR.**
+**This section is only for your reference.**
+
+🙌 **Thank you for contributing to `iggy`!**
+
+To help us incorporate your changes efficiently, please adhere to the following guidelines:
+
+## C++ Coding Remarks
+
+- **Code Linting**: Run `clang-format` and `clang-tidy` to ensure your code adheres to the project's style and perform other static checks.
+- **Unit Testing**: Write or update unit tests to cover your changes.
+- **Integration Testing**: Write or update integration tests to cover your changes.
+- **Project Structure**: Follow the `iggy-cpp-client` project's structure and coding style.
+- **Build Integrity**: Ensure your code compiles and runs error-free.
+
+Note currently we are supporting only C++17.
+
+## General Rules
+
+For commit message standards and other requirements that apply across the Iggy project, please refer to [the core project PULL_REQUEST_TEMPLATE.md](https://github.com/iggy-rs/iggy/blob/master/PULL_REQUEST_TEMPLATE.md).
+
+**Remember:** Your contribution is essential to the success of `iggy`. Please ensure that your PR conforms to these guidelines for a swift and smooth integration process.
+
+Thank you!
diff --git a/foreign/cpp/.github/SECURITY.md b/foreign/cpp/.github/SECURITY.md
new file mode 100644
index 00000000..c1a0dbee
--- /dev/null
+++ b/foreign/cpp/.github/SECURITY.md
@@ -0,0 +1,9 @@
+# Security Policy
+
+## Supported Versions
+
+At this time *no versions* of the iggy-cpp-client are supported for production use; this is work in progress.
+
+## Reporting a Vulnerability
+
+Please report (suspected) security vulnerabilities to **[security@iggy.rs](mailto:security@iggy.rs)**. You will receive a response from us within 48 hours. If the issue is confirmed, we will release a patch as soon as possible depending on complexity but historically within a few days.
diff --git a/foreign/cpp/.github/linters/.hadolint.yaml b/foreign/cpp/.github/linters/.hadolint.yaml
new file mode 100644
index 00000000..b4f3b86e
--- /dev/null
+++ b/foreign/cpp/.github/linters/.hadolint.yaml
@@ -0,0 +1,4 @@
+---
+ignored:
+ - DL3008 # Ignore pinned versions check for APT
+ - DL3018 # Ignore pinning versions check for pip
diff --git a/foreign/cpp/.github/linters/.markdown-lint.yml b/foreign/cpp/.github/linters/.markdown-lint.yml
new file mode 100644
index 00000000..e1a28249
--- /dev/null
+++ b/foreign/cpp/.github/linters/.markdown-lint.yml
@@ -0,0 +1,2 @@
+---
+line-length: false
diff --git a/foreign/cpp/.github/workflows/ci.yml b/foreign/cpp/.github/workflows/ci.yml
new file mode 100644
index 00000000..6d3670b1
--- /dev/null
+++ b/foreign/cpp/.github/workflows/ci.yml
@@ -0,0 +1,110 @@
+---
+name: ci
+
+env:
+ CTEST_NO_TESTS_ACTION: error
+ HOMEBREW_NO_INSTALL_CLEANUP: 1
+
+on:
+ push:
+ paths:
+ - '**.c'
+ - '**.cc'
+ - '**.cpp'
+ - '**.h'
+ - '**/CMakeLists.txt'
+ - '**.cmake'
+ - '**.json'
+ - '**.yaml'
+ - '**.yml'
+ - .github/linters/*
+ - .github/workflows/ci.yml
+ - Dockerfile
+
+permissions: read-all
+
+jobs:
+ build:
+ name: Build SDK
+ runs-on: ubuntu-latest
+
+ permissions: write-all
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4.1.1
+ - name: Install extra packages
+ run: |
+ sudo apt-get update && \
+ sudo apt-get install -y \
+ autoconf \
+ autoconf-archive \
+ build-essential \
+ doxygen \
+ gcovr \
+ lcov \
+ xdg-utils
+ - name: Setup vcpkg
+ uses: lukka/run-vcpkg@v11
+ with:
+ runVcpkgInstall: false
+ - name: Setup cmake
+ uses: lukka/get-cmake@latest
+ - name: Build
+ uses: lukka/run-cmake@v10
+ with:
+ configurePreset: ci
+ buildPreset: ninja
+ - name: Run Tests
+ run: build/tests/Debug/iggy_cpp_test
+ - name: Run Coverage
+ run: |
+ cd build
+ ninja coveralls
+ - name: Upload report to Coveralls
+ uses: coverallsapp/github-action@v2
+ with:
+ file: build/coveralls.json
+ measure: true
+ github-token: ${{ secrets.GITHUB_TOKEN }}
+
+ lint:
+ name: Lint
+ runs-on: ubuntu-latest
+
+ permissions:
+ statuses: write
+
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v4
+ with:
+ # super-linter needs the full git history to get the
+ # list of files that changed across commits
+ fetch-depth: 0
+
+ - name: Super-linter
+ uses: super-linter/super-linter@v6.3.0
+ env:
+ DOCKERFILE_HADOLINT: false
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+
+ - name: Lizard Runner
+ uses: Uno-Takashi/Lizard-Runner@v3
+ with:
+ path: ./sdk
+ CCN: 15
+
+ - name: cppcheck
+ uses: deep5050/cppcheck-action@v3.0
+ with:
+ github_token: ${{ secrets.GITHUB_TOKEN}}
+ enable: style,warning,performance
+ inline_suppression: true
+ force_language: c++
+ std: c++20
+
+ - name: flawfinder
+ uses: david-a-wheeler/flawfinder@2.0.19
+ with:
+ arguments: --quiet -S -D --error-level=1 sdk tests
diff --git a/foreign/cpp/.github/workflows/devcontainer-ci.yml b/foreign/cpp/.github/workflows/devcontainer-ci.yml
new file mode 100644
index 00000000..b8e28411
--- /dev/null
+++ b/foreign/cpp/.github/workflows/devcontainer-ci.yml
@@ -0,0 +1,49 @@
+---
+name: devcontainer-ci
+
+on:
+ push:
+ paths:
+ - .github/workflows/devcontainer-ci.yml
+ - images/iggy-cpp-build/.devcontainer/*
+
+env:
+ DOCKERHUB_REGISTRY_NAME: iggyrs/iggy-cpp-build
+
+permissions: read-all
+
+jobs:
+ pre-build-container:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v3
+ - name: Set up QEMU
+ uses: docker/setup-qemu-action@v3
+ - name: Setup Docker buildx for multi-architecture builds
+ uses: docker/setup-buildx-action@v3
+ with:
+ use: true
+ - name: Install updated Skopeo
+ # This can be omitted once runner images have a version of Skopeo > 1.4.1
+ # See https://github.com/containers/skopeo/issues/1874
+ run: |
+ REPO_URL="https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/unstable/xUbuntu_22.04"
+ sudo sh -c "echo 'deb ${REPO_URL}/ /' > /etc/apt/sources.list.d/skopeo.list"
+ curl -fsSL ${REPO_URL}/Release.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/skopeo.gpg > /dev/null
+
+ sudo apt update
+ sudo apt install skopeo
+ - name: Login to Docker Hub
+ uses: docker/login-action@v2
+ with:
+ username: ${{ secrets.DOCKER_USERNAME }}
+ password: ${{ secrets.DOCKER_PASSWORD }}
+ - name: Pre-build image
+ uses: devcontainers/ci@v0.3
+ with:
+ subFolder: images/iggy-cpp-build
+ imageName: ${{ env.DOCKERHUB_REGISTRY_NAME }}
+ cacheFrom: ${{ env.DOCKERHUB_REGISTRY_NAME }}
+ platform: linux/amd64,linux/arm64
+ push: always
diff --git a/foreign/cpp/.gitignore b/foreign/cpp/.gitignore
new file mode 100644
index 00000000..77d97b84
--- /dev/null
+++ b/foreign/cpp/.gitignore
@@ -0,0 +1,41 @@
+# Prerequisites
+*.d
+
+# Compiled Object files
+*.slo
+*.lo
+*.o
+*.obj
+
+# Precompiled Headers
+*.gch
+*.pch
+
+# Compiled Dynamic libraries
+*.so
+*.dylib
+*.dll
+
+# Fortran module files
+*.mod
+*.smod
+
+# Compiled Static libraries
+*.lai
+*.la
+*.a
+*.lib
+
+# Executables
+*.exe
+*.out
+*.app
+
+# CMake
+build/
+
+# vcpkg
+vcpkg_installed/
+
+# E2E test
+.iggy/
diff --git a/foreign/cpp/.lcovrc b/foreign/cpp/.lcovrc
new file mode 100644
index 00000000..a7711126
--- /dev/null
+++ b/foreign/cpp/.lcovrc
@@ -0,0 +1,3 @@
+genhtml_branch_coverage = 1
+lcov_branch_coverage = 1
+lcov_excl_br_line = LCOV_EXCL_BR_LINE|CHECK|REQUIRE
diff --git a/foreign/cpp/.pre-commit-config.yaml b/foreign/cpp/.pre-commit-config.yaml
new file mode 100644
index 00000000..7050aa23
--- /dev/null
+++ b/foreign/cpp/.pre-commit-config.yaml
@@ -0,0 +1,91 @@
+---
+repos:
+ - repo: https://github.com/adrienverge/yamllint.git
+ rev: v1.21.0
+ hooks:
+ - id: yamllint
+ args: [--format, parsable, --strict]
+ - repo: https://github.com/cmake-lint/cmake-lint
+ rev: 1.4.2
+ hooks:
+ - id: cmakelint
+ args: [--filter, -linelength]
+ - repo: https://github.com/cpplint/cpplint
+ rev: 1.6.1
+ hooks:
+ - id: cpplint
+ - repo: https://github.com/gitleaks/gitleaks
+ rev: v8.16.1
+ hooks:
+ - id: gitleaks
+ - repo: https://github.com/hadolint/hadolint
+ rev: v2.12.0
+ hooks:
+ - id: hadolint
+ args: [--config, .github/linters/.hadolint.yaml]
+ - repo: https://github.com/igorshubovych/markdownlint-cli
+ rev: v0.39.0
+ hooks:
+ - id: markdownlint
+ args: [--config, .github/linters/.markdown-lint.yml]
+ - repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt
+ rev: 0.2.3
+ hooks:
+ - id: yamlfmt
+ - repo: https://github.com/pre-commit/pre-commit-hooks
+ rev: v2.3.0
+ hooks:
+ - id: check-added-large-files
+ - id: check-json
+ - id: check-merge-conflict
+ - id: check-yaml
+ - id: end-of-file-fixer
+ - id: trailing-whitespace
+ - repo: https://github.com/pre-commit/mirrors-clang-format
+ rev: v18.1.0
+ hooks:
+ - id: clang-format
+ - repo: https://github.com/scop/pre-commit-shfmt
+ rev: v3.8.0-1
+ hooks:
+ - id: shfmt
+ - repo: local
+ hooks:
+ - id: cppcheck
+ name: cppcheck
+ entry: cppcheck --enable=style,performance,warning --inline-suppr --std=c++20 -x c++
+ language: system
+ files: \.(cc|h)$
+ pass_filenames: true
+ always_run: false
+ - id: flawfinder
+ name: flawfinder
+ entry: flawfinder --quiet -S -D --error-level=1
+ language: system
+ files: \.(cc|h)$
+ pass_filenames: true
+ always_run: false
+ - id: lizard
+ name: Check code cyclomatic complexity
+ entry: lizard -C 15 -i 0 -w -l c,cc,cpp,h,hpp
+ language: system
+ pass_filenames: true
+ always_run: false
+ - id: build
+ name: Build
+ entry: cmake --build build
+ language: system
+ pass_filenames: false
+ always_run: true
+ - id: run-unit-tests
+ name: Run Unit Tests
+ entry: ./build/tests/Debug/iggy_cpp_test
+ language: system
+ pass_filenames: false
+ always_run: true
+ - id: e2e-tests
+ name: Run E2E Tests
+ entry: ./build/tests/Debug/iggy_e2e_test
+ language: system
+ pass_filenames: false
+ always_run: true
diff --git a/foreign/cpp/.yamllint b/foreign/cpp/.yamllint
new file mode 100644
index 00000000..d8b57b11
--- /dev/null
+++ b/foreign/cpp/.yamllint
@@ -0,0 +1,3 @@
+---
+rules:
+ truthy: disable
diff --git a/foreign/cpp/CMakeLists.txt b/foreign/cpp/CMakeLists.txt
new file mode 100644
index 00000000..0899d606
--- /dev/null
+++ b/foreign/cpp/CMakeLists.txt
@@ -0,0 +1,107 @@
+cmake_minimum_required(VERSION 3.14)
+project(iggy-cpp-client)
+
+option(BUILD_TESTS "Build and run unit tests" OFF)
+option(BUILD_DOCS "Build documentation" OFF)
+option(ENABLE_CODE_COVERAGE "Enable coverage reporting" OFF)
+
+# avoid warning about DOWNLOAD_EXTRACT_TIMESTAMP in CMake 3.24
+if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0")
+ cmake_policy(SET CMP0135 NEW)
+endif()
+
+# global settings
+set(CMAKE_CXX_STANDARD 20)
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
+set(CMAKE_CXX_EXTENSIONS OFF)
+
+# set up library dependencies
+find_package(ada CONFIG REQUIRED)
+find_package(libuv CONFIG REQUIRED)
+find_package(nlohmann_json CONFIG REQUIRED)
+find_package(spdlog CONFIG REQUIRED)
+find_package(unofficial-sodium CONFIG REQUIRED)
+
+# these do not correctly support CMake
+find_path(ADA_INCLUDE_DIR ada.h REQUIRED)
+find_path(JSON_INCLUDE_DIR nlohmann/json.hpp REQUIRED)
+find_path(SODIUM_INCLUDE_DIR sodium.h REQUIRED)
+find_path(UTF8H_INCLUDE_DIRS "utf8h/utf8.h" REQUIRED)
+
+# customize the builds of key networking components; WolfSSL is not
+# well supported in vcpkg and we want to have more control here
+include(ExternalProject)
+execute_process(COMMAND nproc OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE NPROC)
+externalproject_add(wolfssl
+ GIT_REPOSITORY https://github.com/wolfSSL/wolfssl
+ GIT_TAG v5.7.0-stable
+ PREFIX ${CMAKE_BINARY_DIR}/wolfssl
+ BUILD_IN_SOURCE 1
+ CONFIGURE_COMMAND autoreconf -i COMMAND <SOURCE_DIR>/configure --prefix=<INSTALL_DIR> --enable-tls13 --enable-tls12 --enable-tlsx --enable-quic --enable-harden --enable-keylog-export --enable-static --enable-sys-ca-certs --enable-libwebsockets --disable-ech --disable-psk --disable-dtls --disable-anonymous --disable-nullcipher --disable-oldtls --disable-sslv3 --disable-webserver --disable-crypttests
+ BUILD_COMMAND make -j ${NPROC}
+ BUILD_BYPRODUCTS ${CMAKE_BINARY_DIR}/wolfssl/lib/libwolfssl.a
+ INSTALL_COMMAND make install
+ UPDATE_COMMAND ""
+)
+externalproject_get_property(wolfssl INSTALL_DIR)
+set(WOLFSSL_INSTALL_DIR ${INSTALL_DIR})
+
+# customize lws to link to our local wolfSSL library
+externalproject_add(lws
+ GIT_REPOSITORY https://github.com/warmcat/libwebsockets.git
+ GIT_TAG v4.3.3
+ PREFIX ${CMAKE_BINARY_DIR}/lws
+ CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> -DLWS_WITH_SHARED=OFF -DLWS_WITH_WOLFSSL=1 -DLWS_WOLFSSL_INCLUDE_DIRS=${WOLFSSL_INSTALL_DIR}/include -DLWS_WOLFSSL_LIBRARIES=${WOLFSSL_INSTALL_DIR}/lib/libwolfssl.a ..
+ BUILD_BYPRODUCTS ${CMAKE_BINARY_DIR}/lws/lib/libwebsockets.a
+ DEPENDS wolfssl
+)
+externalproject_get_property(lws INSTALL_DIR)
+set(LWS_INSTALL_DIR ${INSTALL_DIR})
+
+set(WOLFSSL_INCLUDE_DIR ${CMAKE_BINARY_DIR}/wolfssl/include)
+set(WOLFSSL_LIB_DIR ${CMAKE_BINARY_DIR}/wolfssl/lib)
+set(LWS_INCLUDE_DIR ${CMAKE_BINARY_DIR}/lws/include)
+set(LWS_LIB_DIR ${CMAKE_BINARY_DIR}/lws/lib)
+
+set(IGGY_INCLUDE_DIRS
+ ${ADA_INCLUDE_DIR}
+ ${JSON_INCLUDE_DIR}
+ ${LWS_INCLUDE_DIR}
+ ${SODIUM_INCLUDE_DIR}
+ ${UTF8H_INCLUDE_DIRS}
+ ${WOLFSSL_INCLUDE_DIR}
+)
+
+file(GLOB_RECURSE IGGY_SOURCES "sdk/*.cc")
+add_library(
+ iggy
+ ${IGGY_SOURCES}
+)
+target_include_directories(iggy PRIVATE ${IGGY_INCLUDE_DIRS})
+add_dependencies(iggy lws)
+target_link_libraries(
+ iggy PRIVATE
+
+ ada::ada
+ fmt::fmt
+ libuv::uv_a
+ nlohmann_json::nlohmann_json
+ unofficial-sodium::sodium
+ ${WOLFSSL_LIB_DIR}/libwolfssl.a
+ ${LWS_LIB_DIR}/libwebsockets.a
+)
+
+# even though this is related to unit tests, to get a full report we need to ensure that
+# all library files are compiled with --coverage so gcno is generated properly
+if(ENABLE_CODE_COVERAGE)
+ include(cmake/modules/CodeCoverage.cmake)
+ append_coverage_compiler_flags()
+endif()
+
+if(BUILD_TESTS)
+ add_subdirectory(tests)
+endif()
+
+if(BUILD_DOCS)
+ add_subdirectory(docs)
+endif()
diff --git a/foreign/cpp/CMakePresets.json b/foreign/cpp/CMakePresets.json
new file mode 100644
index 00000000..a221087d
--- /dev/null
+++ b/foreign/cpp/CMakePresets.json
@@ -0,0 +1,54 @@
+{
+ "version": 3,
+ "configurePresets": [
+ {
+ "name": "default",
+ "binaryDir": "${sourceDir}/build",
+ "generator": "Ninja Multi-Config",
+ "cacheVariables": {
+ "CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
+ "CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
+ }
+ },
+ {
+ "name": "unit-tests",
+ "description": "Preset for building unit tests",
+ "hidden": false,
+ "cacheVariables": {
+ "BUILD_TESTS": "ON",
+ "ENABLE_CODE_COVERAGE": "ON"
+ },
+ "inherits": [
+ "default"
+ ]
+ },
+ {
+ "name": "docs",
+ "description": "Preset for building API docs",
+ "hidden": false,
+ "cacheVariables": {
+ "BUILD_DOCS": "ON"
+ },
+ "inherits": [
+ "default"
+ ]
+ },
+ {
+ "name": "ci",
+ "description": "Preset for build and test in CI",
+ "hidden": false,
+ "inherits": [
+ "unit-tests",
+ "docs"
+ ]
+ }
+ ],
+ "buildPresets": [
+ {
+ "name": "ninja",
+ "configurePreset": "ci",
+ "displayName": "Build with Ninja",
+ "description": "Build with Ninja"
+ }
+ ]
+}
diff --git a/foreign/cpp/CONTRIBUTORS.md b/foreign/cpp/CONTRIBUTORS.md
new file mode 100644
index 00000000..d3388d93
--- /dev/null
+++ b/foreign/cpp/CONTRIBUTORS.md
@@ -0,0 +1,49 @@
+# Contributing to iggy-cpp-client
+
+## Introduction
+
+This is a collection of tips for developers of `iggy-cpp-client`. The initial code is being built with the latest Visual Studio Code and its C++ dev container, under `.devcontainer`. If you are using CLion, XCode or other toolchains it may not have been tested, so please report issues and we will fix them. We are also currently using [vcpkg](https://vcpkg.io) in [manifest mode](https://learn.microsoft.com/en-us/vcpkg/users/manifests) for dependency management. The appropriate packages ar [...]
+
+## Philosophy: code quality
+
+In VS Code the dev container automatically installs [pre-commit](https://pre-commit.com), sets up the `.git` hooks directory and installs all necessary tools for pre-commit checks. The relevant linters from [super-linter](https://github.com/super-linter/super-linter) -- which runs in CI automatically -- as well as the build, unit tests ad E2E tests are all run for you on any changed files before any local Git commit, _before_ it gets pushed. This is in line with the general project philo [...]
+
+## Tested configurations
+
+CI runs on `ubuntu-latest`, and the dev containers have been tested on both x64 and arm64 (macOS 14.x, using latest VS Code and Docker Desktop). CLion, XCode and other C++ IDE's will be supported on a best-efforts basis.
+
+## HOWTO: Run pre-commit checks manually
+
+When adding new pre-commit checks or when testing out other development environment changes, you may wish to pro-actively run all pre-commit checks on all files. You can do it this way:
+
+```shell
+pre-commit run --all-files
+```
+
+
+
+## HOWTO: Upgrade vcpkg dependencies
+
+We freeze the dependency versions with a fixed baseline in `vcpkg-configuration.json`. To upgrade to the latest versions and view them, run:
+
+```shell
+vcpkg x-update-baseline
+vcpkg install
+vcpkg list
+```
+
+then commit the upgrade.
+
+## HOWTO: Test GitHub Actions locally
+
+Our continuous integration uses GitHub Actions, and sometimes it's more convenient to first test it. The VS Code container includes the [act](https://github.com/nektos/act) extension, and you can use it to do a smoke test of the CI actions before you push to GitHub. Run `act` and, if running for the first time, choose "Medium" for the container:
+
+
+
+Note `act` is an _emulator_ that runs in Docker. It may not perfectly reproduce the GitHub Actions environment, and is not a substitute for a full CI run on GitHub post-commit.
+
+## Resources
+
+- VS Code C++ support: [https://code.visualstudio.com/docs/languages/cpp](https://code.visualstudio.com/docs/languages/cpp)
+- `vcpkg`: [https://vcpkg.io](https://vcpkg.io)
+- `act` GitHub Action runner: [https://github.com/nektos/act](https://github.com/nektos/act)
diff --git a/foreign/cpp/CPPLINT.cfg b/foreign/cpp/CPPLINT.cfg
new file mode 100644
index 00000000..1a3875ba
--- /dev/null
+++ b/foreign/cpp/CPPLINT.cfg
@@ -0,0 +1,3 @@
+set noparent
+filter=-whitespace,-build/include_what_you_use,-build/include_subdir,-legal/copyright,-readability/todo,-build/c++11,-build/include_order
+linelength=80
diff --git a/foreign/cpp/Doxyfile b/foreign/cpp/Doxyfile
new file mode 100644
index 00000000..487680ab
--- /dev/null
+++ b/foreign/cpp/Doxyfile
@@ -0,0 +1,2657 @@
+# Doxyfile 1.9.1
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project.
+#
+# All text after a double hash (##) is considered a comment and is placed in
+# front of the TAG it is preceding.
+#
+# All text after a single hash (#) is considered a comment and will be ignored.
+# The format is:
+# TAG = value [value, ...]
+# For lists, items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (\" \").
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the configuration
+# file that follow. The default is UTF-8 which is also the encoding used for all
+# text before the first occurrence of this tag. Doxygen uses libiconv (or the
+# iconv built into libc) for the transcoding. See
+# https://www.gnu.org/software/libiconv/ for the list of possible encodings.
+# The default value is: UTF-8.
+
+DOXYFILE_ENCODING = UTF-8
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by
+# double-quotes, unless you are using Doxywizard) that should identify the
+# project for which the documentation is generated. This name is used in the
+# title of most generated pages and in a few other places.
+
+PROJECT_NAME = "Iggy C++ Client"
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
+# could be handy for archiving the generated documentation or if some version
+# control system is used.
+
+PROJECT_NUMBER =
+
+# Using the PROJECT_BRIEF tag one can provide an optional one line description
+# for a project that appears at the top of each page and should give viewer a
+# quick idea about the purpose of the project. Keep the description short.
+
+PROJECT_BRIEF =
+
+# With the PROJECT_LOGO tag one can specify a logo or an icon that is included
+# in the documentation. The maximum height of the logo should not exceed 55
+# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy
+# the logo to the output directory.
+
+PROJECT_LOGO =
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
+# into which the generated documentation will be written. If a relative path is
+# entered, it will be relative to the location where doxygen was started. If
+# left blank the current directory will be used.
+
+OUTPUT_DIRECTORY = build/docs
+
+# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub-
+# directories (in 2 levels) under the output directory of each output format and
+# will distribute the generated files over these directories. Enabling this
+# option can be useful when feeding doxygen a huge amount of source files, where
+# putting all generated files in the same directory would otherwise causes
+# performance problems for the file system.
+# The default value is: NO.
+
+CREATE_SUBDIRS = NO
+
+# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII
+# characters to appear in the names of generated files. If set to NO, non-ASCII
+# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode
+# U+3044.
+# The default value is: NO.
+
+ALLOW_UNICODE_NAMES = NO
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese,
+# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States),
+# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian,
+# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages),
+# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian,
+# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian,
+# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish,
+# Ukrainian and Vietnamese.
+# The default value is: English.
+
+OUTPUT_LANGUAGE = English
+
+# The OUTPUT_TEXT_DIRECTION tag is used to specify the direction in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all generated output in the proper direction.
+# Possible values are: None, LTR, RTL and Context.
+# The default value is: None.
+
+OUTPUT_TEXT_DIRECTION = None
+
+# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member
+# descriptions after the members that are listed in the file and class
+# documentation (similar to Javadoc). Set to NO to disable this.
+# The default value is: YES.
+
+BRIEF_MEMBER_DESC = YES
+
+# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief
+# description of a member or function before the detailed description
+#
+# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+# The default value is: YES.
+
+REPEAT_BRIEF = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator that is
+# used to form the text in various listings. Each string in this list, if found
+# as the leading text of the brief description, will be stripped from the text
+# and the result, after processing the whole list, is used as the annotated
+# text. Otherwise, the brief description is used as-is. If left blank, the
+# following values are used ($name is automatically replaced with the name of
+# the entity):The $name class, The $name widget, The $name file, is, provides,
+# specifies, contains, represents, a, an and the.
+
+ABBREVIATE_BRIEF = "The $name class" \
+ "The $name widget" \
+ "The $name file" \
+ is \
+ provides \
+ specifies \
+ contains \
+ represents \
+ a \
+ an \
+ the
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# doxygen will generate a detailed section even if there is only a brief
+# description.
+# The default value is: NO.
+
+ALWAYS_DETAILED_SEC = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+# The default value is: NO.
+
+INLINE_INHERITED_MEMB = NO
+
+# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path
+# before files name in the file list and in the header files. If set to NO the
+# shortest path that makes the file name unique will be used
+# The default value is: YES.
+
+FULL_PATH_NAMES = YES
+
+# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path.
+# Stripping is only done if one of the specified strings matches the left-hand
+# part of the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the path to
+# strip.
+#
+# Note that you can specify absolute paths here, but also relative paths, which
+# will be relative from the directory where doxygen is started.
+# This tag requires that the tag FULL_PATH_NAMES is set to YES.
+
+STRIP_FROM_PATH =
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the
+# path mentioned in the documentation of a class, which tells the reader which
+# header file to include in order to use a class. If left blank only the name of
+# the header file containing the class definition is used. Otherwise one should
+# specify the list of include paths that are normally passed to the compiler
+# using the -I flag.
+
+STRIP_FROM_INC_PATH =
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but
+# less readable) file names. This can be useful is your file systems doesn't
+# support long names like on DOS, Mac, or CD-ROM.
+# The default value is: NO.
+
+SHORT_NAMES = NO
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the
+# first line (until the first dot) of a Javadoc-style comment as the brief
+# description. If set to NO, the Javadoc-style will behave just like regular Qt-
+# style comments (thus requiring an explicit @brief command for a brief
+# description.)
+# The default value is: NO.
+
+JAVADOC_AUTOBRIEF = NO
+
+# If the JAVADOC_BANNER tag is set to YES then doxygen will interpret a line
+# such as
+# /***************
+# as being the beginning of a Javadoc-style comment "banner". If set to NO, the
+# Javadoc-style will behave just like regular comments and it will not be
+# interpreted by doxygen.
+# The default value is: NO.
+
+JAVADOC_BANNER = NO
+
+# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first
+# line (until the first dot) of a Qt-style comment as the brief description. If
+# set to NO, the Qt-style will behave just like regular Qt-style comments (thus
+# requiring an explicit \brief command for a brief description.)
+# The default value is: NO.
+
+QT_AUTOBRIEF = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a
+# multi-line C++ special comment block (i.e. a block of //! or /// comments) as
+# a brief description. This used to be the default behavior. The new default is
+# to treat a multi-line C++ comment block as a detailed description. Set this
+# tag to YES if you prefer the old behavior instead.
+#
+# Note that setting this tag to YES also means that rational rose comments are
+# not recognized any more.
+# The default value is: NO.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# By default Python docstrings are displayed as preformatted text and doxygen's
+# special commands cannot be used. By setting PYTHON_DOCSTRING to NO the
+# doxygen's special commands can be used and the contents of the docstring
+# documentation blocks is shown as doxygen documentation.
+# The default value is: YES.
+
+PYTHON_DOCSTRING = YES
+
+# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the
+# documentation from any documented member that it re-implements.
+# The default value is: YES.
+
+INHERIT_DOCS = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new
+# page for each member. If set to NO, the documentation of a member will be part
+# of the file/class/namespace that contains it.
+# The default value is: NO.
+
+SEPARATE_MEMBER_PAGES = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen
+# uses this value to replace tabs by spaces in code fragments.
+# Minimum value: 1, maximum value: 16, default value: 4.
+
+TAB_SIZE = 4
+
+# This tag can be used to specify a number of aliases that act as commands in
+# the documentation. An alias has the form:
+# name=value
+# For example adding
+# "sideeffect=@par Side Effects:\n"
+# will allow you to put the command \sideeffect (or @sideeffect) in the
+# documentation, which will result in a user-defined paragraph with heading
+# "Side Effects:". You can put \n's in the value part of an alias to insert
+# newlines (in the resulting output). You can put ^^ in the value part of an
+# alias to insert a newline as if a physical newline was in the original file.
+# When you need a literal { or } or , in the value part of an alias you have to
+# escape them by means of a backslash (\), this can lead to conflicts with the
+# commands \{ and \} for these it is advised to use the version @{ and @} or use
+# a double escape (\\{ and \\})
+
+ALIASES =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
+# only. Doxygen will then generate output that is more tailored for C. For
+# instance, some of the names that are used will be different. The list of all
+# members will be omitted, etc.
+# The default value is: NO.
+
+OPTIMIZE_OUTPUT_FOR_C = NO
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or
+# Python sources only. Doxygen will then generate output that is more tailored
+# for that language. For instance, namespaces will be presented as packages,
+# qualified scopes will look different, etc.
+# The default value is: NO.
+
+OPTIMIZE_OUTPUT_JAVA = NO
+
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
+# sources. Doxygen will then generate output that is tailored for Fortran.
+# The default value is: NO.
+
+OPTIMIZE_FOR_FORTRAN = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
+# sources. Doxygen will then generate output that is tailored for VHDL.
+# The default value is: NO.
+
+OPTIMIZE_OUTPUT_VHDL = NO
+
+# Set the OPTIMIZE_OUTPUT_SLICE tag to YES if your project consists of Slice
+# sources only. Doxygen will then generate output that is more tailored for that
+# language. For instance, namespaces will be presented as modules, types will be
+# separated into more groups, etc.
+# The default value is: NO.
+
+OPTIMIZE_OUTPUT_SLICE = NO
+
+# Doxygen selects the parser to use depending on the extension of the files it
+# parses. With this tag you can assign which parser to use for a given
+# extension. Doxygen has a built-in mapping, but you can override or extend it
+# using this tag. The format is ext=language, where ext is a file extension, and
+# language is one of the parsers supported by doxygen: IDL, Java, JavaScript,
+# Csharp (C#), C, C++, D, PHP, md (Markdown), Objective-C, Python, Slice, VHDL,
+# Fortran (fixed format Fortran: FortranFixed, free formatted Fortran:
+# FortranFree, unknown formatted Fortran: Fortran. In the later case the parser
+# tries to guess whether the code is fixed or free formatted code, this is the
+# default for Fortran type files). For instance to make doxygen treat .inc files
+# as Fortran files (default is PHP), and .f files as C (default is Fortran),
+# use: inc=Fortran f=C.
+#
+# Note: For files without extension you can use no_extension as a placeholder.
+#
+# Note that for custom extensions you also need to set FILE_PATTERNS otherwise
+# the files are not read by doxygen. When specifying no_extension you should add
+# * to the FILE_PATTERNS.
+#
+# Note see also the list of default file extension mappings.
+
+EXTENSION_MAPPING =
+
+# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments
+# according to the Markdown format, which allows for more readable
+# documentation. See https://daringfireball.net/projects/markdown/ for details.
+# The output of markdown processing is further processed by doxygen, so you can
+# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in
+# case of backward compatibilities issues.
+# The default value is: YES.
+
+MARKDOWN_SUPPORT = YES
+
+# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up
+# to that level are automatically included in the table of contents, even if
+# they do not have an id attribute.
+# Note: This feature currently applies only to Markdown headings.
+# Minimum value: 0, maximum value: 99, default value: 5.
+# This tag requires that the tag MARKDOWN_SUPPORT is set to YES.
+
+TOC_INCLUDE_HEADINGS = 5
+
+# When enabled doxygen tries to link words that correspond to documented
+# classes, or namespaces to their corresponding documentation. Such a link can
+# be prevented in individual cases by putting a % sign in front of the word or
+# globally by setting AUTOLINK_SUPPORT to NO.
+# The default value is: YES.
+
+AUTOLINK_SUPPORT = YES
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
+# to include (a tag file for) the STL sources as input, then you should set this
+# tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string);
+# versus func(std::string) {}). This also make the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+# The default value is: NO.
+
+BUILTIN_STL_SUPPORT = NO
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+# The default value is: NO.
+
+CPP_CLI_SUPPORT = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip (see:
+# https://www.riverbankcomputing.com/software/sip/intro) sources only. Doxygen
+# will parse them like normal C++ but will assume all classes use public instead
+# of private inheritance when no explicit protection keyword is present.
+# The default value is: NO.
+
+SIP_SUPPORT = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate
+# getter and setter methods for a property. Setting this option to YES will make
+# doxygen to replace the get and set methods by a property in the documentation.
+# This will only work if the methods are indeed getting or setting a simple
+# type. If this is not the case, or you want to show the methods anyway, you
+# should set this option to NO.
+# The default value is: YES.
+
+IDL_PROPERTY_SUPPORT = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+# The default value is: NO.
+
+DISTRIBUTE_GROUP_DOC = NO
+
+# If one adds a struct or class to a group and this option is enabled, then also
+# any nested class or struct is added to the same group. By default this option
+# is disabled and one has to add nested compounds explicitly via \ingroup.
+# The default value is: NO.
+
+GROUP_NESTED_COMPOUNDS = NO
+
+# Set the SUBGROUPING tag to YES to allow class member groups of the same type
+# (for instance a group of public functions) to be put as a subgroup of that
+# type (e.g. under the Public Functions section). Set it to NO to prevent
+# subgrouping. Alternatively, this can be done per class using the
+# \nosubgrouping command.
+# The default value is: YES.
+
+SUBGROUPING = YES
+
+# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions
+# are shown inside the group in which they are included (e.g. using \ingroup)
+# instead of on a separate page (for HTML and Man pages) or section (for LaTeX
+# and RTF).
+#
+# Note that this feature does not work in combination with
+# SEPARATE_MEMBER_PAGES.
+# The default value is: NO.
+
+INLINE_GROUPED_CLASSES = NO
+
+# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions
+# with only public data fields or simple typedef fields will be shown inline in
+# the documentation of the scope in which they are defined (i.e. file,
+# namespace, or group documentation), provided this scope is documented. If set
+# to NO, structs, classes, and unions are shown on a separate page (for HTML and
+# Man pages) or section (for LaTeX and RTF).
+# The default value is: NO.
+
+INLINE_SIMPLE_STRUCTS = NO
+
+# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or
+# enum is documented as struct, union, or enum with the name of the typedef. So
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
+# with name TypeT. When disabled the typedef will appear as a member of a file,
+# namespace, or class. And the struct will be named TypeS. This can typically be
+# useful for C code in case the coding convention dictates that all compound
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+# The default value is: NO.
+
+TYPEDEF_HIDES_STRUCT = NO
+
+# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This
+# cache is used to resolve symbols given their name and scope. Since this can be
+# an expensive process and often the same symbol appears multiple times in the
+# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small
+# doxygen will become slower. If the cache is too large, memory is wasted. The
+# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range
+# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536
+# symbols. At the end of a run doxygen will report the cache usage and suggest
+# the optimal cache size from a speed point of view.
+# Minimum value: 0, maximum value: 9, default value: 0.
+
+LOOKUP_CACHE_SIZE = 0
+
+# The NUM_PROC_THREADS specifies the number threads doxygen is allowed to use
+# during processing. When set to 0 doxygen will based this on the number of
+# cores available in the system. You can set it explicitly to a value larger
+# than 0 to get more control over the balance between CPU load and processing
+# speed. At this moment only the input processing can be done using multiple
+# threads. Since this is still an experimental feature the default is set to 1,
+# which efficively disables parallel processing. Please report any issues you
+# encounter. Generating dot graphs in parallel is controlled by the
+# DOT_NUM_THREADS setting.
+# Minimum value: 0, maximum value: 32, default value: 1.
+
+NUM_PROC_THREADS = 1
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in
+# documentation are documented, even if no documentation was available. Private
+# class members and static file members will be hidden unless the
+# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES.
+# Note: This will also disable the warnings about undocumented members that are
+# normally produced when WARNINGS is set to YES.
+# The default value is: NO.
+
+EXTRACT_ALL = NO
+
+# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will
+# be included in the documentation.
+# The default value is: NO.
+
+EXTRACT_PRIVATE = NO
+
+# If the EXTRACT_PRIV_VIRTUAL tag is set to YES, documented private virtual
+# methods of a class will be included in the documentation.
+# The default value is: NO.
+
+EXTRACT_PRIV_VIRTUAL = NO
+
+# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal
+# scope will be included in the documentation.
+# The default value is: NO.
+
+EXTRACT_PACKAGE = NO
+
+# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be
+# included in the documentation.
+# The default value is: NO.
+
+EXTRACT_STATIC = NO
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined
+# locally in source files will be included in the documentation. If set to NO,
+# only classes defined in header files are included. Does not have any effect
+# for Java sources.
+# The default value is: YES.
+
+EXTRACT_LOCAL_CLASSES = YES
+
+# This flag is only useful for Objective-C code. If set to YES, local methods,
+# which are defined in the implementation section but not in the interface are
+# included in the documentation. If set to NO, only methods in the interface are
+# included.
+# The default value is: NO.
+
+EXTRACT_LOCAL_METHODS = NO
+
+# If this flag is set to YES, the members of anonymous namespaces will be
+# extracted and appear in the documentation as a namespace called
+# 'anonymous_namespace{file}', where file will be replaced with the base name of
+# the file that contains the anonymous namespace. By default anonymous namespace
+# are hidden.
+# The default value is: NO.
+
+EXTRACT_ANON_NSPACES = NO
+
+# If this flag is set to YES, the name of an unnamed parameter in a declaration
+# will be determined by the corresponding definition. By default unnamed
+# parameters remain unnamed in the output.
+# The default value is: YES.
+
+RESOLVE_UNNAMED_PARAMS = YES
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all
+# undocumented members inside documented classes or files. If set to NO these
+# members will be included in the various overviews, but no documentation
+# section is generated. This option has no effect if EXTRACT_ALL is enabled.
+# The default value is: NO.
+
+HIDE_UNDOC_MEMBERS = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy. If set
+# to NO, these classes will be included in the various overviews. This option
+# has no effect if EXTRACT_ALL is enabled.
+# The default value is: NO.
+
+HIDE_UNDOC_CLASSES = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend
+# declarations. If set to NO, these declarations will be included in the
+# documentation.
+# The default value is: NO.
+
+HIDE_FRIEND_COMPOUNDS = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any
+# documentation blocks found inside the body of a function. If set to NO, these
+# blocks will be appended to the function's detailed documentation block.
+# The default value is: NO.
+
+HIDE_IN_BODY_DOCS = NO
+
+# The INTERNAL_DOCS tag determines if documentation that is typed after a
+# \internal command is included. If the tag is set to NO then the documentation
+# will be excluded. Set it to YES to include the internal documentation.
+# The default value is: NO.
+
+INTERNAL_DOCS = NO
+
+# With the correct setting of option CASE_SENSE_NAMES doxygen will better be
+# able to match the capabilities of the underlying filesystem. In case the
+# filesystem is case sensitive (i.e. it supports files in the same directory
+# whose names only differ in casing), the option must be set to YES to properly
+# deal with such files in case they appear in the input. For filesystems that
+# are not case sensitive the option should be be set to NO to properly deal with
+# output files written for symbols that only differ in casing, such as for two
+# classes, one named CLASS and the other named Class, and to also support
+# references to files without having to specify the exact matching casing. On
+# Windows (including Cygwin) and MacOS, users should typically set this option
+# to NO, whereas on Linux or other Unix flavors it should typically be set to
+# YES.
+# The default value is: system dependent.
+
+CASE_SENSE_NAMES = YES
+
+# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with
+# their full class and namespace scopes in the documentation. If set to YES, the
+# scope will be hidden.
+# The default value is: NO.
+
+HIDE_SCOPE_NAMES = NO
+
+# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will
+# append additional text to a page's title, such as Class Reference. If set to
+# YES the compound reference will be hidden.
+# The default value is: NO.
+
+HIDE_COMPOUND_REFERENCE= NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of
+# the files that are included by a file in the documentation of that file.
+# The default value is: YES.
+
+SHOW_INCLUDE_FILES = YES
+
+# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each
+# grouped member an include statement to the documentation, telling the reader
+# which file to include in order to use the member.
+# The default value is: NO.
+
+SHOW_GROUPED_MEMB_INC = NO
+
+# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include
+# files with double quotes in the documentation rather than with sharp brackets.
+# The default value is: NO.
+
+FORCE_LOCAL_INCLUDES = NO
+
+# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the
+# documentation for inline members.
+# The default value is: YES.
+
+INLINE_INFO = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the
+# (detailed) documentation of file and class members alphabetically by member
+# name. If set to NO, the members will appear in declaration order.
+# The default value is: YES.
+
+SORT_MEMBER_DOCS = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief
+# descriptions of file, namespace and class members alphabetically by member
+# name. If set to NO, the members will appear in declaration order. Note that
+# this will also influence the order of the classes in the class list.
+# The default value is: NO.
+
+SORT_BRIEF_DOCS = NO
+
+# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the
+# (brief and detailed) documentation of class members so that constructors and
+# destructors are listed first. If set to NO the constructors will appear in the
+# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS.
+# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief
+# member documentation.
+# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting
+# detailed member documentation.
+# The default value is: NO.
+
+SORT_MEMBERS_CTORS_1ST = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy
+# of group names into alphabetical order. If set to NO the group names will
+# appear in their defined order.
+# The default value is: NO.
+
+SORT_GROUP_NAMES = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by
+# fully-qualified names, including namespaces. If set to NO, the class list will
+# be sorted only by class name, not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the alphabetical
+# list.
+# The default value is: NO.
+
+SORT_BY_SCOPE_NAME = NO
+
+# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper
+# type resolution of all parameters of a function it will reject a match between
+# the prototype and the implementation of a member function even if there is
+# only one candidate or it is obvious which candidate to choose by doing a
+# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still
+# accept a match between prototype and implementation in such cases.
+# The default value is: NO.
+
+STRICT_PROTO_MATCHING = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo
+# list. This list is created by putting \todo commands in the documentation.
+# The default value is: YES.
+
+GENERATE_TODOLIST = YES
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test
+# list. This list is created by putting \test commands in the documentation.
+# The default value is: YES.
+
+GENERATE_TESTLIST = YES
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug
+# list. This list is created by putting \bug commands in the documentation.
+# The default value is: YES.
+
+GENERATE_BUGLIST = YES
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO)
+# the deprecated list. This list is created by putting \deprecated commands in
+# the documentation.
+# The default value is: YES.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional documentation
+# sections, marked by \if <section_label> ... \endif and \cond <section_label>
+# ... \endcond blocks.
+
+ENABLED_SECTIONS =
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the
+# initial value of a variable or macro / define can have for it to appear in the
+# documentation. If the initializer consists of more lines than specified here
+# it will be hidden. Use a value of 0 to hide initializers completely. The
+# appearance of the value of individual variables and macros / defines can be
+# controlled using \showinitializer or \hideinitializer command in the
+# documentation regardless of this setting.
+# Minimum value: 0, maximum value: 10000, default value: 30.
+
+MAX_INITIALIZER_LINES = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at
+# the bottom of the documentation of classes and structs. If set to YES, the
+# list will mention the files that were used to generate the documentation.
+# The default value is: YES.
+
+SHOW_USED_FILES = YES
+
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This
+# will remove the Files entry from the Quick Index and from the Folder Tree View
+# (if specified).
+# The default value is: YES.
+
+SHOW_FILES = YES
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces
+# page. This will remove the Namespaces entry from the Quick Index and from the
+# Folder Tree View (if specified).
+# The default value is: YES.
+
+SHOW_NAMESPACES = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from
+# the version control system). Doxygen will invoke the program by executing (via
+# popen()) the command command input-file, where command is the value of the
+# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided
+# by doxygen. Whatever the program writes to standard output is used as the file
+# version. For an example see the documentation.
+
+FILE_VERSION_FILTER =
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
+# by doxygen. The layout file controls the global structure of the generated
+# output files in an output format independent way. To create the layout file
+# that represents doxygen's defaults, run doxygen with the -l option. You can
+# optionally specify a file name after the option, if omitted DoxygenLayout.xml
+# will be used as the name of the layout file.
+#
+# Note that if you run doxygen from a directory containing a file called
+# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE
+# tag is left empty.
+
+LAYOUT_FILE =
+
+# The CITE_BIB_FILES tag can be used to specify one or more bib files containing
+# the reference definitions. This must be a list of .bib files. The .bib
+# extension is automatically appended if omitted. This requires the bibtex tool
+# to be installed. See also https://en.wikipedia.org/wiki/BibTeX for more info.
+# For LaTeX the style of the bibliography can be controlled using
+# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the
+# search path. See also \cite for info how to create references.
+
+CITE_BIB_FILES =
+
+#---------------------------------------------------------------------------
+# Configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated to
+# standard output by doxygen. If QUIET is set to YES this implies that the
+# messages are off.
+# The default value is: NO.
+
+QUIET = NO
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES
+# this implies that the warnings are on.
+#
+# Tip: Turn warnings on while writing the documentation.
+# The default value is: YES.
+
+WARNINGS = YES
+
+# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate
+# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag
+# will automatically be disabled.
+# The default value is: YES.
+
+WARN_IF_UNDOCUMENTED = YES
+
+# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some parameters
+# in a documented function, or documenting parameters that don't exist or using
+# markup commands wrongly.
+# The default value is: YES.
+
+WARN_IF_DOC_ERROR = YES
+
+# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that
+# are documented, but have no documentation for their parameters or return
+# value. If set to NO, doxygen will only warn about wrong or incomplete
+# parameter documentation, but not about the absence of documentation. If
+# EXTRACT_ALL is set to YES then this flag will automatically be disabled.
+# The default value is: NO.
+
+WARN_NO_PARAMDOC = NO
+
+# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when
+# a warning is encountered. If the WARN_AS_ERROR tag is set to FAIL_ON_WARNINGS
+# then doxygen will continue running as if WARN_AS_ERROR tag is set to NO, but
+# at the end of the doxygen process doxygen will return with a non-zero status.
+# Possible values are: NO, YES and FAIL_ON_WARNINGS.
+# The default value is: NO.
+
+WARN_AS_ERROR = NO
+
+# The WARN_FORMAT tag determines the format of the warning messages that doxygen
+# can produce. The string should contain the $file, $line, and $text tags, which
+# will be replaced by the file and line number from which the warning originated
+# and the warning text. Optionally the format may contain $version, which will
+# be replaced by the version of the file (if it could be obtained via
+# FILE_VERSION_FILTER)
+# The default value is: $file:$line: $text.
+
+WARN_FORMAT = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning and error
+# messages should be written. If left blank the output is written to standard
+# error (stderr).
+
+WARN_LOGFILE =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag is used to specify the files and/or directories that contain
+# documented source files. You may enter file names like myfile.cpp or
+# directories like /usr/src/myproject. Separate the files or directories with
+# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
+# Note: If this tag is empty the current directory is searched.
+
+INPUT = sdk
+
+# This tag can be used to specify the character encoding of the source files
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
+# libiconv (or the iconv built into libc) for the transcoding. See the libiconv
+# documentation (see:
+# https://www.gnu.org/software/libiconv/) for the list of possible encodings.
+# The default value is: UTF-8.
+
+INPUT_ENCODING = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and
+# *.h) to filter out the source-files in the directories.
+#
+# Note that for custom extensions or not directly supported extensions you also
+# need to set EXTENSION_MAPPING for the extension otherwise the files are not
+# read by doxygen.
+#
+# Note the list of default checked file patterns might differ from the list of
+# default file extension mappings.
+#
+# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp,
+# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h,
+# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc,
+# *.m, *.markdown, *.md, *.mm, *.dox (to be provided as doxygen C comment),
+# *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, *.f18, *.f, *.for, *.vhd, *.vhdl,
+# *.ucf, *.qsf and *.ice.
+
+FILE_PATTERNS = *.c \
+ *.cc \
+ *.cxx \
+ *.cpp \
+ *.c++ \
+ *.java \
+ *.ii \
+ *.ixx \
+ *.ipp \
+ *.i++ \
+ *.inl \
+ *.idl \
+ *.ddl \
+ *.odl \
+ *.h \
+ *.hh \
+ *.hxx \
+ *.hpp \
+ *.h++ \
+ *.cs \
+ *.d \
+ *.php \
+ *.php4 \
+ *.php5 \
+ *.phtml \
+ *.inc \
+ *.m \
+ *.markdown \
+ *.md \
+ *.mm \
+ *.dox \
+ *.py \
+ *.pyw \
+ *.f90 \
+ *.f95 \
+ *.f03 \
+ *.f08 \
+ *.f18 \
+ *.f \
+ *.for \
+ *.vhd \
+ *.vhdl \
+ *.ucf \
+ *.qsf \
+ *.ice
+
+# The RECURSIVE tag can be used to specify whether or not subdirectories should
+# be searched for input files as well.
+# The default value is: NO.
+
+RECURSIVE = NO
+
+# The EXCLUDE tag can be used to specify files and/or directories that should be
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+#
+# Note that relative paths are relative to the directory from which doxygen is
+# run.
+
+EXCLUDE =
+
+# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
+# directories that are symbolic links (a Unix file system feature) are excluded
+# from the input.
+# The default value is: NO.
+
+EXCLUDE_SYMLINKS = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories.
+#
+# Note that the wildcards are matched against the file with absolute path, so to
+# exclude all test directories for example use the pattern */test/*
+
+EXCLUDE_PATTERNS =
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
+# (namespaces, classes, functions, etc.) that should be excluded from the
+# output. The symbol name can be a fully qualified name, a word, or if the
+# wildcard * is used, a substring. Examples: ANamespace, AClass,
+# AClass::ANamespace, ANamespace::*Test
+#
+# Note that the wildcards are matched against the file with absolute path, so to
+# exclude all test directories use the pattern */test/*
+
+EXCLUDE_SYMBOLS =
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or directories
+# that contain example code fragments that are included (see the \include
+# command).
+
+EXAMPLE_PATH =
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and
+# *.h) to filter out the source-files in the directories. If left blank all
+# files are included.
+
+EXAMPLE_PATTERNS = *
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude commands
+# irrespective of the value of the RECURSIVE tag.
+# The default value is: NO.
+
+EXAMPLE_RECURSIVE = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or directories
+# that contain images that are to be included in the documentation (see the
+# \image command).
+
+IMAGE_PATH =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command:
+#
+# <filter> <input-file>
+#
+# where <filter> is the value of the INPUT_FILTER tag, and <input-file> is the
+# name of an input file. Doxygen will then use the output that the filter
+# program writes to standard output. If FILTER_PATTERNS is specified, this tag
+# will be ignored.
+#
+# Note that the filter must not add or remove lines; it is applied before the
+# code is scanned, but not when the output code is generated. If lines are added
+# or removed, the anchors will not be placed correctly.
+#
+# Note that for custom extensions or not directly supported extensions you also
+# need to set EXTENSION_MAPPING for the extension otherwise the files are not
+# properly processed by doxygen.
+
+INPUT_FILTER =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis. Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match. The filters are a list of the form: pattern=filter
+# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how
+# filters are used. If the FILTER_PATTERNS tag is empty or if none of the
+# patterns match the file name, INPUT_FILTER is applied.
+#
+# Note that for custom extensions or not directly supported extensions you also
+# need to set EXTENSION_MAPPING for the extension otherwise the files are not
+# properly processed by doxygen.
+
+FILTER_PATTERNS =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will also be used to filter the input files that are used for
+# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES).
+# The default value is: NO.
+
+FILTER_SOURCE_FILES = NO
+
+# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file
+# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and
+# it is also possible to disable source filtering for a specific pattern using
+# *.ext= (so without naming a filter).
+# This tag requires that the tag FILTER_SOURCE_FILES is set to YES.
+
+FILTER_SOURCE_PATTERNS =
+
+# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that
+# is part of the input, its contents will be placed on the main page
+# (index.html). This can be useful if you have a project on for instance GitHub
+# and want to reuse the introduction page also for the doxygen output.
+
+USE_MDFILE_AS_MAINPAGE =
+
+#---------------------------------------------------------------------------
+# Configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will be
+# generated. Documented entities will be cross-referenced with these sources.
+#
+# Note: To get rid of all source code in the generated output, make sure that
+# also VERBATIM_HEADERS is set to NO.
+# The default value is: NO.
+
+SOURCE_BROWSER = NO
+
+# Setting the INLINE_SOURCES tag to YES will include the body of functions,
+# classes and enums directly into the documentation.
+# The default value is: NO.
+
+INLINE_SOURCES = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any
+# special comment blocks from generated source code fragments. Normal C, C++ and
+# Fortran comments will always remain visible.
+# The default value is: YES.
+
+STRIP_CODE_COMMENTS = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES then for each documented
+# entity all documented functions referencing it will be listed.
+# The default value is: NO.
+
+REFERENCED_BY_RELATION = NO
+
+# If the REFERENCES_RELATION tag is set to YES then for each documented function
+# all documented entities called/used by that function will be listed.
+# The default value is: NO.
+
+REFERENCES_RELATION = NO
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set
+# to YES then the hyperlinks from functions in REFERENCES_RELATION and
+# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will
+# link to the documentation.
+# The default value is: YES.
+
+REFERENCES_LINK_SOURCE = YES
+
+# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the
+# source code will show a tooltip with additional information such as prototype,
+# brief description and links to the definition and documentation. Since this
+# will make the HTML file larger and loading of large files a bit slower, you
+# can opt to disable this feature.
+# The default value is: YES.
+# This tag requires that the tag SOURCE_BROWSER is set to YES.
+
+SOURCE_TOOLTIPS = YES
+
+# If the USE_HTAGS tag is set to YES then the references to source code will
+# point to the HTML generated by the htags(1) tool instead of doxygen built-in
+# source browser. The htags tool is part of GNU's global source tagging system
+# (see https://www.gnu.org/software/global/global.html). You will need version
+# 4.8.6 or higher.
+#
+# To use it do the following:
+# - Install the latest version of global
+# - Enable SOURCE_BROWSER and USE_HTAGS in the configuration file
+# - Make sure the INPUT points to the root of the source tree
+# - Run doxygen as normal
+#
+# Doxygen will invoke htags (and that will in turn invoke gtags), so these
+# tools must be available from the command line (i.e. in the search path).
+#
+# The result: instead of the source browser generated by doxygen, the links to
+# source code will now point to the output of htags.
+# The default value is: NO.
+# This tag requires that the tag SOURCE_BROWSER is set to YES.
+
+USE_HTAGS = NO
+
+# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a
+# verbatim copy of the header file for each class for which an include is
+# specified. Set to NO to disable this.
+# See also: Section \class.
+# The default value is: YES.
+
+VERBATIM_HEADERS = YES
+
+# If the CLANG_ASSISTED_PARSING tag is set to YES then doxygen will use the
+# clang parser (see:
+# http://clang.llvm.org/) for more accurate parsing at the cost of reduced
+# performance. This can be particularly helpful with template rich C++ code for
+# which doxygen's built-in parser lacks the necessary type information.
+# Note: The availability of this option depends on whether or not doxygen was
+# generated with the -Duse_libclang=ON option for CMake.
+# The default value is: NO.
+
+CLANG_ASSISTED_PARSING = NO
+
+# If clang assisted parsing is enabled and the CLANG_ADD_INC_PATHS tag is set to
+# YES then doxygen will add the directory of each input to the include path.
+# The default value is: YES.
+
+CLANG_ADD_INC_PATHS = YES
+
+# If clang assisted parsing is enabled you can provide the compiler with command
+# line options that you would normally use when invoking the compiler. Note that
+# the include paths will already be set by doxygen for the files and directories
+# specified with INPUT and INCLUDE_PATH.
+# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES.
+
+CLANG_OPTIONS =
+
+# If clang assisted parsing is enabled you can provide the clang parser with the
+# path to the directory containing a file called compile_commands.json. This
+# file is the compilation database (see:
+# http://clang.llvm.org/docs/HowToSetupToolingForLLVM.html) containing the
+# options used when the source files were built. This is equivalent to
+# specifying the -p option to a clang tool, such as clang-check. These options
+# will then be passed to the parser. Any options specified with CLANG_OPTIONS
+# will be added as well.
+# Note: The availability of this option depends on whether or not doxygen was
+# generated with the -Duse_libclang=ON option for CMake.
+
+CLANG_DATABASE_PATH =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all
+# compounds will be generated. Enable this if the project contains a lot of
+# classes, structs, unions or interfaces.
+# The default value is: YES.
+
+ALPHABETICAL_INDEX = YES
+
+# In case all classes in a project start with a common prefix, all classes will
+# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag
+# can be used to specify a prefix (or a list of prefixes) that should be ignored
+# while generating the index headers.
+# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
+
+IGNORE_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output
+# The default value is: YES.
+
+GENERATE_HTML = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: html.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_OUTPUT = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each
+# generated HTML page (for example: .htm, .php, .asp).
+# The default value is: .html.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_FILE_EXTENSION = .html
+
+# The HTML_HEADER tag can be used to specify a user-defined HTML header file for
+# each generated HTML page. If the tag is left blank doxygen will generate a
+# standard header.
+#
+# To get valid HTML the header file that includes any scripts and style sheets
+# that doxygen needs, which is dependent on the configuration options used (e.g.
+# the setting GENERATE_TREEVIEW). It is highly recommended to start with a
+# default header using
+# doxygen -w html new_header.html new_footer.html new_stylesheet.css
+# YourConfigFile
+# and then modify the file new_header.html. See also section "Doxygen usage"
+# for information on how to generate the default header that doxygen normally
+# uses.
+# Note: The header is subject to change so you typically have to regenerate the
+# default header when upgrading to a newer version of doxygen. For a description
+# of the possible markers and block names see the documentation.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_HEADER =
+
+# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each
+# generated HTML page. If the tag is left blank doxygen will generate a standard
+# footer. See HTML_HEADER for more information on how to generate a default
+# footer and what special commands can be used inside the footer. See also
+# section "Doxygen usage" for information on how to generate the default footer
+# that doxygen normally uses.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_FOOTER =
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style
+# sheet that is used by each HTML page. It can be used to fine-tune the look of
+# the HTML output. If left blank doxygen will generate a default style sheet.
+# See also section "Doxygen usage" for information on how to generate the style
+# sheet that doxygen normally uses.
+# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as
+# it is more robust and this tag (HTML_STYLESHEET) will in the future become
+# obsolete.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_STYLESHEET =
+
+# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined
+# cascading style sheets that are included after the standard style sheets
+# created by doxygen. Using this option one can overrule certain style aspects.
+# This is preferred over using HTML_STYLESHEET since it does not replace the
+# standard style sheet and is therefore more robust against future updates.
+# Doxygen will copy the style sheet files to the output directory.
+# Note: The order of the extra style sheet files is of importance (e.g. the last
+# style sheet in the list overrules the setting of the previous ones in the
+# list). For an example see the documentation.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_EXTRA_STYLESHEET =
+
+# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
+# other source files which should be copied to the HTML output directory. Note
+# that these files will be copied to the base HTML output directory. Use the
+# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these
+# files. In the HTML_STYLESHEET file, use the file name only. Also note that the
+# files will be copied as-is; there are no commands or markers available.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_EXTRA_FILES =
+
+# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen
+# will adjust the colors in the style sheet and background images according to
+# this color. Hue is specified as an angle on a colorwheel, see
+# https://en.wikipedia.org/wiki/Hue for more information. For instance the value
+# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300
+# purple, and 360 is red again.
+# Minimum value: 0, maximum value: 359, default value: 220.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_COLORSTYLE_HUE = 220
+
+# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors
+# in the HTML output. For a value of 0 the output will use grayscales only. A
+# value of 255 will produce the most vivid colors.
+# Minimum value: 0, maximum value: 255, default value: 100.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_COLORSTYLE_SAT = 100
+
+# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the
+# luminance component of the colors in the HTML output. Values below 100
+# gradually make the output lighter, whereas values above 100 make the output
+# darker. The value divided by 100 is the actual gamma applied, so 80 represents
+# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not
+# change the gamma.
+# Minimum value: 40, maximum value: 240, default value: 80.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_COLORSTYLE_GAMMA = 80
+
+# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
+# page will contain the date and time when the page was generated. Setting this
+# to YES can help to show when doxygen was last run and thus if the
+# documentation is up to date.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_TIMESTAMP = NO
+
+# If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML
+# documentation will contain a main index with vertical navigation menus that
+# are dynamically created via JavaScript. If disabled, the navigation index will
+# consists of multiple levels of tabs that are statically embedded in every HTML
+# page. Disable this option to support browsers that do not have JavaScript,
+# like the Qt help browser.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_DYNAMIC_MENUS = YES
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
+# documentation will contain sections that can be hidden and shown after the
+# page has loaded.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_DYNAMIC_SECTIONS = NO
+
+# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries
+# shown in the various tree structured indices initially; the user can expand
+# and collapse entries dynamically later on. Doxygen will expand the tree to
+# such a level that at most the specified number of entries are visible (unless
+# a fully collapsed tree already exceeds this amount). So setting the number of
+# entries 1 will produce a full collapsed tree by default. 0 is a special value
+# representing an infinite number of entries and will result in a full expanded
+# tree by default.
+# Minimum value: 0, maximum value: 9999, default value: 100.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_INDEX_NUM_ENTRIES = 100
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files will be
+# generated that can be used as input for Apple's Xcode 3 integrated development
+# environment (see:
+# https://developer.apple.com/xcode/), introduced with OSX 10.5 (Leopard). To
+# create a documentation set, doxygen will generate a Makefile in the HTML
+# output directory. Running make will produce the docset in that directory and
+# running make install will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at
+# startup. See https://developer.apple.com/library/archive/featuredarticles/Doxy
+# genXcode/_index.html for more information.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+GENERATE_DOCSET = NO
+
+# This tag determines the name of the docset feed. A documentation feed provides
+# an umbrella under which multiple documentation sets from a single provider
+# (such as a company or product suite) can be grouped.
+# The default value is: Doxygen generated docs.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
+
+DOCSET_FEEDNAME = "Doxygen generated docs"
+
+# This tag specifies a string that should uniquely identify the documentation
+# set bundle. This should be a reverse domain-name style string, e.g.
+# com.mycompany.MyDocSet. Doxygen will append .docset to the name.
+# The default value is: org.doxygen.Project.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
+
+DOCSET_BUNDLE_ID = org.doxygen.Project
+
+# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify
+# the documentation publisher. This should be a reverse domain-name style
+# string, e.g. com.mycompany.MyDocSet.documentation.
+# The default value is: org.doxygen.Publisher.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
+
+DOCSET_PUBLISHER_ID = org.doxygen.Publisher
+
+# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher.
+# The default value is: Publisher.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
+
+DOCSET_PUBLISHER_NAME = Publisher
+
+# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three
+# additional HTML index files: index.hhp, index.hhc, and index.hhk. The
+# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop
+# (see:
+# https://www.microsoft.com/en-us/download/details.aspx?id=21138) on Windows.
+#
+# The HTML Help Workshop contains a compiler that can convert all HTML output
+# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML
+# files are now used as the Windows 98 help format, and will replace the old
+# Windows help format (.hlp) on all Windows platforms in the future. Compressed
+# HTML files also contain an index, a table of contents, and you can search for
+# words in the documentation. The HTML workshop also contains a viewer for
+# compressed HTML files.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+GENERATE_HTMLHELP = NO
+
+# The CHM_FILE tag can be used to specify the file name of the resulting .chm
+# file. You can add a path in front of the file if the result should not be
+# written to the html output directory.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
+CHM_FILE =
+
+# The HHC_LOCATION tag can be used to specify the location (absolute path
+# including file name) of the HTML help compiler (hhc.exe). If non-empty,
+# doxygen will try to run the HTML help compiler on the generated index.hhp.
+# The file has to be specified with full path.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
+HHC_LOCATION =
+
+# The GENERATE_CHI flag controls if a separate .chi index file is generated
+# (YES) or that it should be included in the main .chm file (NO).
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
+GENERATE_CHI = NO
+
+# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc)
+# and project file content.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
+CHM_INDEX_ENCODING =
+
+# The BINARY_TOC flag controls whether a binary table of contents is generated
+# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it
+# enables the Previous and Next buttons.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
+BINARY_TOC = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members to
+# the table of contents of the HTML help documentation and to the tree view.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
+TOC_EXPAND = NO
+
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
+# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that
+# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help
+# (.qch) of the generated HTML documentation.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+GENERATE_QHP = NO
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify
+# the file name of the resulting .qch file. The path specified is relative to
+# the HTML output folder.
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QCH_FILE =
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help
+# Project output. For more information please see Qt Help Project / Namespace
+# (see:
+# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#namespace).
+# The default value is: org.doxygen.Project.
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHP_NAMESPACE = org.doxygen.Project
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt
+# Help Project output. For more information please see Qt Help Project / Virtual
+# Folders (see:
+# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#virtual-folders).
+# The default value is: doc.
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHP_VIRTUAL_FOLDER = doc
+
+# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom
+# filter to add. For more information please see Qt Help Project / Custom
+# Filters (see:
+# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters).
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHP_CUST_FILTER_NAME =
+
+# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the
+# custom filter to add. For more information please see Qt Help Project / Custom
+# Filters (see:
+# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters).
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHP_CUST_FILTER_ATTRS =
+
+# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
+# project's filter section matches. Qt Help Project / Filter Attributes (see:
+# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#filter-attributes).
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHP_SECT_FILTER_ATTRS =
+
+# The QHG_LOCATION tag can be used to specify the location (absolute path
+# including file name) of Qt's qhelpgenerator. If non-empty doxygen will try to
+# run qhelpgenerator on the generated .qhp file.
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHG_LOCATION =
+
+# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be
+# generated, together with the HTML files, they form an Eclipse help plugin. To
+# install this plugin and make it available under the help contents menu in
+# Eclipse, the contents of the directory containing the HTML and XML files needs
+# to be copied into the plugins directory of eclipse. The name of the directory
+# within the plugins directory should be the same as the ECLIPSE_DOC_ID value.
+# After copying Eclipse needs to be restarted before the help appears.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+GENERATE_ECLIPSEHELP = NO
+
+# A unique identifier for the Eclipse help plugin. When installing the plugin
+# the directory name containing the HTML and XML files should also have this
+# name. Each documentation set should have its own identifier.
+# The default value is: org.doxygen.Project.
+# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES.
+
+ECLIPSE_DOC_ID = org.doxygen.Project
+
+# If you want full control over the layout of the generated HTML pages it might
+# be necessary to disable the index and replace it with your own. The
+# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top
+# of each HTML page. A value of NO enables the index and the value YES disables
+# it. Since the tabs in the index contain the same information as the navigation
+# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+DISABLE_INDEX = NO
+
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
+# structure should be generated to display hierarchical information. If the tag
+# value is set to YES, a side panel will be generated containing a tree-like
+# index structure (just like the one that is generated for HTML Help). For this
+# to work a browser that supports JavaScript, DHTML, CSS and frames is required
+# (i.e. any modern browser). Windows users are probably better off using the
+# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can
+# further fine-tune the look of the index. As an example, the default style
+# sheet generated by doxygen has an example that shows how to put an image at
+# the root of the tree instead of the PROJECT_NAME. Since the tree basically has
+# the same information as the tab index, you could consider setting
+# DISABLE_INDEX to YES when enabling this option.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+GENERATE_TREEVIEW = NO
+
+# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that
+# doxygen will group on one line in the generated HTML documentation.
+#
+# Note that a value of 0 will completely suppress the enum values from appearing
+# in the overview section.
+# Minimum value: 0, maximum value: 20, default value: 4.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+ENUM_VALUES_PER_LINE = 4
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used
+# to set the initial width (in pixels) of the frame in which the tree is shown.
+# Minimum value: 0, maximum value: 1500, default value: 250.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+TREEVIEW_WIDTH = 250
+
+# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to
+# external symbols imported via tag files in a separate window.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+EXT_LINKS_IN_WINDOW = NO
+
+# If the HTML_FORMULA_FORMAT option is set to svg, doxygen will use the pdf2svg
+# tool (see https://github.com/dawbarton/pdf2svg) or inkscape (see
+# https://inkscape.org) to generate formulas as SVG images instead of PNGs for
+# the HTML output. These images will generally look nicer at scaled resolutions.
+# Possible values are: png (the default) and svg (looks nicer but requires the
+# pdf2svg or inkscape tool).
+# The default value is: png.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_FORMULA_FORMAT = png
+
+# Use this tag to change the font size of LaTeX formulas included as images in
+# the HTML documentation. When you change the font size after a successful
+# doxygen run you need to manually remove any form_*.png images from the HTML
+# output directory to force them to be regenerated.
+# Minimum value: 8, maximum value: 50, default value: 10.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+FORMULA_FONTSIZE = 10
+
+# Use the FORMULA_TRANSPARENT tag to determine whether or not the images
+# generated for formulas are transparent PNGs. Transparent PNGs are not
+# supported properly for IE 6.0, but are supported on all modern browsers.
+#
+# Note that when changing this option you need to delete any form_*.png files in
+# the HTML output directory before the changes have effect.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+FORMULA_TRANSPARENT = YES
+
+# The FORMULA_MACROFILE can contain LaTeX \newcommand and \renewcommand commands
+# to create new LaTeX commands to be used in formulas as building blocks. See
+# the section "Including formulas" for details.
+
+FORMULA_MACROFILE =
+
+# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see
+# https://www.mathjax.org) which uses client side JavaScript for the rendering
+# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX
+# installed or if you want to formulas look prettier in the HTML output. When
+# enabled you may also need to install MathJax separately and configure the path
+# to it using the MATHJAX_RELPATH option.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+USE_MATHJAX = NO
+
+# When MathJax is enabled you can set the default output format to be used for
+# the MathJax output. See the MathJax site (see:
+# http://docs.mathjax.org/en/v2.7-latest/output.html) for more details.
+# Possible values are: HTML-CSS (which is slower, but has the best
+# compatibility), NativeMML (i.e. MathML) and SVG.
+# The default value is: HTML-CSS.
+# This tag requires that the tag USE_MATHJAX is set to YES.
+
+MATHJAX_FORMAT = HTML-CSS
+
+# When MathJax is enabled you need to specify the location relative to the HTML
+# output directory using the MATHJAX_RELPATH option. The destination directory
+# should contain the MathJax.js script. For instance, if the mathjax directory
+# is located at the same level as the HTML output directory, then
+# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax
+# Content Delivery Network so you can quickly see the result without installing
+# MathJax. However, it is strongly recommended to install a local copy of
+# MathJax from https://www.mathjax.org before deployment.
+# The default value is: https://cdn.jsdelivr.net/npm/mathjax@2.
+# This tag requires that the tag USE_MATHJAX is set to YES.
+
+MATHJAX_RELPATH = https://cdn.jsdelivr.net/npm/mathjax@2
+
+# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax
+# extension names that should be enabled during MathJax rendering. For example
+# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols
+# This tag requires that the tag USE_MATHJAX is set to YES.
+
+MATHJAX_EXTENSIONS =
+
+# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces
+# of code that will be used on startup of the MathJax code. See the MathJax site
+# (see:
+# http://docs.mathjax.org/en/v2.7-latest/output.html) for more details. For an
+# example see the documentation.
+# This tag requires that the tag USE_MATHJAX is set to YES.
+
+MATHJAX_CODEFILE =
+
+# When the SEARCHENGINE tag is enabled doxygen will generate a search box for
+# the HTML output. The underlying search engine uses javascript and DHTML and
+# should work on any modern browser. Note that when using HTML help
+# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET)
+# there is already a search function so this one should typically be disabled.
+# For large projects the javascript based search engine can be slow, then
+# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to
+# search using the keyboard; to jump to the search box use <access key> + S
+# (what the <access key> is depends on the OS and browser, but it is typically
+# <CTRL>, <ALT>/<option>, or both). Inside the search box use the <cursor down
+# key> to jump into the search results window, the results can be navigated
+# using the <cursor keys>. Press <Enter> to select an item or <escape> to cancel
+# the search. The filter options can be selected when the cursor is inside the
+# search box by pressing <Shift>+<cursor down>. Also here use the <cursor keys>
+# to select a filter and <Enter> or <escape> to activate or cancel the filter
+# option.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+SEARCHENGINE = YES
+
+# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
+# implemented using a web server instead of a web client using JavaScript. There
+# are two flavors of web server based searching depending on the EXTERNAL_SEARCH
+# setting. When disabled, doxygen will generate a PHP script for searching and
+# an index file used by the script. When EXTERNAL_SEARCH is enabled the indexing
+# and searching needs to be provided by external tools. See the section
+# "External Indexing and Searching" for details.
+# The default value is: NO.
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+SERVER_BASED_SEARCH = NO
+
+# When EXTERNAL_SEARCH tag is enabled doxygen will no longer generate the PHP
+# script for searching. Instead the search results are written to an XML file
+# which needs to be processed by an external indexer. Doxygen will invoke an
+# external search engine pointed to by the SEARCHENGINE_URL option to obtain the
+# search results.
+#
+# Doxygen ships with an example indexer (doxyindexer) and search engine
+# (doxysearch.cgi) which are based on the open source search engine library
+# Xapian (see:
+# https://xapian.org/).
+#
+# See the section "External Indexing and Searching" for details.
+# The default value is: NO.
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+EXTERNAL_SEARCH = NO
+
+# The SEARCHENGINE_URL should point to a search engine hosted by a web server
+# which will return the search results when EXTERNAL_SEARCH is enabled.
+#
+# Doxygen ships with an example indexer (doxyindexer) and search engine
+# (doxysearch.cgi) which are based on the open source search engine library
+# Xapian (see:
+# https://xapian.org/). See the section "External Indexing and Searching" for
+# details.
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+SEARCHENGINE_URL =
+
+# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed
+# search data is written to a file for indexing by an external tool. With the
+# SEARCHDATA_FILE tag the name of this file can be specified.
+# The default file is: searchdata.xml.
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+SEARCHDATA_FILE = searchdata.xml
+
+# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the
+# EXTERNAL_SEARCH_ID tag can be used as an identifier for the project. This is
+# useful in combination with EXTRA_SEARCH_MAPPINGS to search through multiple
+# projects and redirect the results back to the right project.
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+EXTERNAL_SEARCH_ID =
+
+# The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen
+# projects other than the one defined by this configuration file, but that are
+# all added to the same external search index. Each project needs to have a
+# unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id of
+# to a relative location where the documentation can be found. The format is:
+# EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ...
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+EXTRA_SEARCH_MAPPINGS =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES, doxygen will generate LaTeX output.
+# The default value is: YES.
+
+GENERATE_LATEX = YES
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: latex.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_OUTPUT = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked.
+#
+# Note that when not enabling USE_PDFLATEX the default is latex when enabling
+# USE_PDFLATEX the default is pdflatex and when in the later case latex is
+# chosen this is overwritten by pdflatex. For specific output languages the
+# default can have been set differently, this depends on the implementation of
+# the output language.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_CMD_NAME =
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to generate
+# index for LaTeX.
+# Note: This tag is used in the Makefile / make.bat.
+# See also: LATEX_MAKEINDEX_CMD for the part in the generated output file
+# (.tex).
+# The default file is: makeindex.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+MAKEINDEX_CMD_NAME = makeindex
+
+# The LATEX_MAKEINDEX_CMD tag can be used to specify the command name to
+# generate index for LaTeX. In case there is no backslash (\) as first character
+# it will be automatically added in the LaTeX code.
+# Note: This tag is used in the generated output file (.tex).
+# See also: MAKEINDEX_CMD_NAME for the part in the Makefile / make.bat.
+# The default value is: makeindex.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_MAKEINDEX_CMD = makeindex
+
+# If the COMPACT_LATEX tag is set to YES, doxygen generates more compact LaTeX
+# documents. This may be useful for small projects and may help to save some
+# trees in general.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+COMPACT_LATEX = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used by the
+# printer.
+# Possible values are: a4 (210 x 297 mm), letter (8.5 x 11 inches), legal (8.5 x
+# 14 inches) and executive (7.25 x 10.5 inches).
+# The default value is: a4.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+PAPER_TYPE = a4
+
+# The EXTRA_PACKAGES tag can be used to specify one or more LaTeX package names
+# that should be included in the LaTeX output. The package can be specified just
+# by its name or with the correct syntax as to be used with the LaTeX
+# \usepackage command. To get the times font for instance you can specify :
+# EXTRA_PACKAGES=times or EXTRA_PACKAGES={times}
+# To use the option intlimits with the amsmath package you can specify:
+# EXTRA_PACKAGES=[intlimits]{amsmath}
+# If left blank no extra packages will be included.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+EXTRA_PACKAGES =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for the
+# generated LaTeX document. The header should contain everything until the first
+# chapter. If it is left blank doxygen will generate a standard header. See
+# section "Doxygen usage" for information on how to let doxygen write the
+# default header to a separate file.
+#
+# Note: Only use a user-defined header if you know what you are doing! The
+# following commands have a special meaning inside the header: $title,
+# $datetime, $date, $doxygenversion, $projectname, $projectnumber,
+# $projectbrief, $projectlogo. Doxygen will replace $title with the empty
+# string, for the replacement values of the other commands the user is referred
+# to HTML_HEADER.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_HEADER =
+
+# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the
+# generated LaTeX document. The footer should contain everything after the last
+# chapter. If it is left blank doxygen will generate a standard footer. See
+# LATEX_HEADER for more information on how to generate a default footer and what
+# special commands can be used inside the footer.
+#
+# Note: Only use a user-defined footer if you know what you are doing!
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_FOOTER =
+
+# The LATEX_EXTRA_STYLESHEET tag can be used to specify additional user-defined
+# LaTeX style sheets that are included after the standard style sheets created
+# by doxygen. Using this option one can overrule certain style aspects. Doxygen
+# will copy the style sheet files to the output directory.
+# Note: The order of the extra style sheet files is of importance (e.g. the last
+# style sheet in the list overrules the setting of the previous ones in the
+# list).
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_EXTRA_STYLESHEET =
+
+# The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or
+# other source files which should be copied to the LATEX_OUTPUT output
+# directory. Note that the files will be copied as-is; there are no commands or
+# markers available.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_EXTRA_FILES =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is
+# prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will
+# contain links (just like the HTML output) instead of page references. This
+# makes the output suitable for online browsing using a PDF viewer.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+PDF_HYPERLINKS = YES
+
+# If the USE_PDFLATEX tag is set to YES, doxygen will use the engine as
+# specified with LATEX_CMD_NAME to generate the PDF file directly from the LaTeX
+# files. Set this option to YES, to get a higher quality PDF documentation.
+#
+# See also section LATEX_CMD_NAME for selecting the engine.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+USE_PDFLATEX = YES
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \batchmode
+# command to the generated LaTeX files. This will instruct LaTeX to keep running
+# if errors occur, instead of asking the user for help. This option is also used
+# when generating formulas in HTML.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_BATCHMODE = NO
+
+# If the LATEX_HIDE_INDICES tag is set to YES then doxygen will not include the
+# index chapters (such as File Index, Compound Index, etc.) in the output.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_HIDE_INDICES = NO
+
+# If the LATEX_SOURCE_CODE tag is set to YES then doxygen will include source
+# code with syntax highlighting in the LaTeX output.
+#
+# Note that which sources are shown also depends on other settings such as
+# SOURCE_BROWSER.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_SOURCE_CODE = NO
+
+# The LATEX_BIB_STYLE tag can be used to specify the style to use for the
+# bibliography, e.g. plainnat, or ieeetr. See
+# https://en.wikipedia.org/wiki/BibTeX and \cite for more info.
+# The default value is: plain.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_BIB_STYLE = plain
+
+# If the LATEX_TIMESTAMP tag is set to YES then the footer of each generated
+# page will contain the date and time when the page was generated. Setting this
+# to NO can help when comparing the output of multiple runs.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_TIMESTAMP = NO
+
+# The LATEX_EMOJI_DIRECTORY tag is used to specify the (relative or absolute)
+# path from which the emoji images will be read. If a relative path is entered,
+# it will be relative to the LATEX_OUTPUT directory. If left blank the
+# LATEX_OUTPUT directory will be used.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_EMOJI_DIRECTORY =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES, doxygen will generate RTF output. The
+# RTF output is optimized for Word 97 and may not look too pretty with other RTF
+# readers/editors.
+# The default value is: NO.
+
+GENERATE_RTF = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: rtf.
+# This tag requires that the tag GENERATE_RTF is set to YES.
+
+RTF_OUTPUT = rtf
+
+# If the COMPACT_RTF tag is set to YES, doxygen generates more compact RTF
+# documents. This may be useful for small projects and may help to save some
+# trees in general.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_RTF is set to YES.
+
+COMPACT_RTF = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated will
+# contain hyperlink fields. The RTF file will contain links (just like the HTML
+# output) instead of page references. This makes the output suitable for online
+# browsing using Word or some other Word compatible readers that support those
+# fields.
+#
+# Note: WordPad (write) and others do not support links.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_RTF is set to YES.
+
+RTF_HYPERLINKS = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's
+# configuration file, i.e. a series of assignments. You only have to provide
+# replacements, missing definitions are set to their default value.
+#
+# See also section "Doxygen usage" for information on how to generate the
+# default style sheet that doxygen normally uses.
+# This tag requires that the tag GENERATE_RTF is set to YES.
+
+RTF_STYLESHEET_FILE =
+
+# Set optional variables used in the generation of an RTF document. Syntax is
+# similar to doxygen's configuration file. A template extensions file can be
+# generated using doxygen -e rtf extensionFile.
+# This tag requires that the tag GENERATE_RTF is set to YES.
+
+RTF_EXTENSIONS_FILE =
+
+# If the RTF_SOURCE_CODE tag is set to YES then doxygen will include source code
+# with syntax highlighting in the RTF output.
+#
+# Note that which sources are shown also depends on other settings such as
+# SOURCE_BROWSER.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_RTF is set to YES.
+
+RTF_SOURCE_CODE = NO
+
+#---------------------------------------------------------------------------
+# Configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES, doxygen will generate man pages for
+# classes and files.
+# The default value is: NO.
+
+GENERATE_MAN = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it. A directory man3 will be created inside the directory specified by
+# MAN_OUTPUT.
+# The default directory is: man.
+# This tag requires that the tag GENERATE_MAN is set to YES.
+
+MAN_OUTPUT = man
+
+# The MAN_EXTENSION tag determines the extension that is added to the generated
+# man pages. In case the manual section does not start with a number, the number
+# 3 is prepended. The dot (.) at the beginning of the MAN_EXTENSION tag is
+# optional.
+# The default value is: .3.
+# This tag requires that the tag GENERATE_MAN is set to YES.
+
+MAN_EXTENSION = .3
+
+# The MAN_SUBDIR tag determines the name of the directory created within
+# MAN_OUTPUT in which the man pages are placed. If defaults to man followed by
+# MAN_EXTENSION with the initial . removed.
+# This tag requires that the tag GENERATE_MAN is set to YES.
+
+MAN_SUBDIR =
+
+# If the MAN_LINKS tag is set to YES and doxygen generates man output, then it
+# will generate one additional man file for each entity documented in the real
+# man page(s). These additional files only source the real man page, but without
+# them the man command would be unable to find the correct page.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_MAN is set to YES.
+
+MAN_LINKS = NO
+
+#---------------------------------------------------------------------------
+# Configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES, doxygen will generate an XML file that
+# captures the structure of the code including all documentation.
+# The default value is: NO.
+
+GENERATE_XML = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: xml.
+# This tag requires that the tag GENERATE_XML is set to YES.
+
+XML_OUTPUT = xml
+
+# If the XML_PROGRAMLISTING tag is set to YES, doxygen will dump the program
+# listings (including syntax highlighting and cross-referencing information) to
+# the XML output. Note that enabling this will significantly increase the size
+# of the XML output.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_XML is set to YES.
+
+XML_PROGRAMLISTING = YES
+
+# If the XML_NS_MEMB_FILE_SCOPE tag is set to YES, doxygen will include
+# namespace members in file scope as well, matching the HTML output.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_XML is set to YES.
+
+XML_NS_MEMB_FILE_SCOPE = NO
+
+#---------------------------------------------------------------------------
+# Configuration options related to the DOCBOOK output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_DOCBOOK tag is set to YES, doxygen will generate Docbook files
+# that can be used to generate PDF.
+# The default value is: NO.
+
+GENERATE_DOCBOOK = NO
+
+# The DOCBOOK_OUTPUT tag is used to specify where the Docbook pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be put in
+# front of it.
+# The default directory is: docbook.
+# This tag requires that the tag GENERATE_DOCBOOK is set to YES.
+
+DOCBOOK_OUTPUT = docbook
+
+# If the DOCBOOK_PROGRAMLISTING tag is set to YES, doxygen will include the
+# program listings (including syntax highlighting and cross-referencing
+# information) to the DOCBOOK output. Note that enabling this will significantly
+# increase the size of the DOCBOOK output.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_DOCBOOK is set to YES.
+
+DOCBOOK_PROGRAMLISTING = NO
+
+#---------------------------------------------------------------------------
+# Configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES, doxygen will generate an
+# AutoGen Definitions (see http://autogen.sourceforge.net/) file that captures
+# the structure of the code including all documentation. Note that this feature
+# is still experimental and incomplete at the moment.
+# The default value is: NO.
+
+GENERATE_AUTOGEN_DEF = NO
+
+#---------------------------------------------------------------------------
+# Configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES, doxygen will generate a Perl module
+# file that captures the structure of the code including all documentation.
+#
+# Note that this feature is still experimental and incomplete at the moment.
+# The default value is: NO.
+
+GENERATE_PERLMOD = NO
+
+# If the PERLMOD_LATEX tag is set to YES, doxygen will generate the necessary
+# Makefile rules, Perl scripts and LaTeX code to be able to generate PDF and DVI
+# output from the Perl module output.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_PERLMOD is set to YES.
+
+PERLMOD_LATEX = NO
+
+# If the PERLMOD_PRETTY tag is set to YES, the Perl module output will be nicely
+# formatted so it can be parsed by a human reader. This is useful if you want to
+# understand what is going on. On the other hand, if this tag is set to NO, the
+# size of the Perl module output will be much smaller and Perl will parse it
+# just the same.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_PERLMOD is set to YES.
+
+PERLMOD_PRETTY = YES
+
+# The names of the make variables in the generated doxyrules.make file are
+# prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. This is useful
+# so different doxyrules.make files included by the same Makefile don't
+# overwrite each other's variables.
+# This tag requires that the tag GENERATE_PERLMOD is set to YES.
+
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES, doxygen will evaluate all
+# C-preprocessor directives found in the sources and include files.
+# The default value is: YES.
+
+ENABLE_PREPROCESSING = YES
+
+# If the MACRO_EXPANSION tag is set to YES, doxygen will expand all macro names
+# in the source code. If set to NO, only conditional compilation will be
+# performed. Macro expansion can be done in a controlled way by setting
+# EXPAND_ONLY_PREDEF to YES.
+# The default value is: NO.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+MACRO_EXPANSION = NO
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then
+# the macro expansion is limited to the macros specified with the PREDEFINED and
+# EXPAND_AS_DEFINED tags.
+# The default value is: NO.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+EXPAND_ONLY_PREDEF = NO
+
+# If the SEARCH_INCLUDES tag is set to YES, the include files in the
+# INCLUDE_PATH will be searched if a #include is found.
+# The default value is: YES.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+SEARCH_INCLUDES = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by the
+# preprocessor.
+# This tag requires that the tag SEARCH_INCLUDES is set to YES.
+
+INCLUDE_PATH =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will be
+# used.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+INCLUDE_FILE_PATTERNS =
+
+# The PREDEFINED tag can be used to specify one or more macro names that are
+# defined before the preprocessor is started (similar to the -D option of e.g.
+# gcc). The argument of the tag is a list of macros of the form: name or
+# name=definition (no spaces). If the definition and the "=" are omitted, "=1"
+# is assumed. To prevent a macro definition from being undefined via #undef or
+# recursively expanded use the := operator instead of the = operator.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+PREDEFINED =
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
+# tag can be used to specify a list of macro names that should be expanded. The
+# macro definition that is found in the sources will be used. Use the PREDEFINED
+# tag if you want to use a different macro definition that overrules the
+# definition found in the source code.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+EXPAND_AS_DEFINED =
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will
+# remove all references to function-like macros that are alone on a line, have
+# an all uppercase name, and do not end with a semicolon. Such function macros
+# are typically used for boiler-plate code, and will confuse the parser if not
+# removed.
+# The default value is: YES.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+SKIP_FUNCTION_MACROS = YES
+
+#---------------------------------------------------------------------------
+# Configuration options related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES tag can be used to specify one or more tag files. For each tag
+# file the location of the external documentation should be added. The format of
+# a tag file without this location is as follows:
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where loc1 and loc2 can be relative or absolute paths or URLs. See the
+# section "Linking to external documentation" for more information about the use
+# of tag files.
+# Note: Each tag file must have a unique name (where the name does NOT include
+# the path). If a tag file is not located in the directory in which doxygen is
+# run, you must also specify the path to the tagfile here.
+
+TAGFILES =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create a
+# tag file that is based on the input files it reads. See section "Linking to
+# external documentation" for more information about the usage of tag files.
+
+GENERATE_TAGFILE =
+
+# If the ALLEXTERNALS tag is set to YES, all external class will be listed in
+# the class index. If set to NO, only the inherited external classes will be
+# listed.
+# The default value is: NO.
+
+ALLEXTERNALS = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES, all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will be
+# listed.
+# The default value is: YES.
+
+EXTERNAL_GROUPS = YES
+
+# If the EXTERNAL_PAGES tag is set to YES, all external pages will be listed in
+# the related pages index. If set to NO, only the current project's pages will
+# be listed.
+# The default value is: YES.
+
+EXTERNAL_PAGES = YES
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES, doxygen will generate a class diagram
+# (in HTML and LaTeX) for classes with base or super classes. Setting the tag to
+# NO turns the diagrams off. Note that this option also works with HAVE_DOT
+# disabled, but it is recommended to install and use dot, since it yields more
+# powerful graphs.
+# The default value is: YES.
+
+CLASS_DIAGRAMS = YES
+
+# You can include diagrams made with dia in doxygen documentation. Doxygen will
+# then run dia to produce the diagram and insert it in the documentation. The
+# DIA_PATH tag allows you to specify the directory where the dia binary resides.
+# If left empty dia is assumed to be found in the default search path.
+
+DIA_PATH =
+
+# If set to YES the inheritance and collaboration graphs will hide inheritance
+# and usage relations if the target is undocumented or is not a class.
+# The default value is: YES.
+
+HIDE_UNDOC_RELATIONS = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz (see:
+# http://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent
+# Bell Labs. The other options in this section have no effect if this option is
+# set to NO
+# The default value is: YES.
+
+HAVE_DOT = YES
+
+# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is allowed
+# to run in parallel. When set to 0 doxygen will base this on the number of
+# processors available in the system. You can set it explicitly to a value
+# larger than 0 to get control over the balance between CPU load and processing
+# speed.
+# Minimum value: 0, maximum value: 32, default value: 0.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_NUM_THREADS = 0
+
+# When you want a differently looking font in the dot files that doxygen
+# generates you can specify the font name using DOT_FONTNAME. You need to make
+# sure dot is able to find the font, which can be done by putting it in a
+# standard location or by setting the DOTFONTPATH environment variable or by
+# setting DOT_FONTPATH to the directory containing the font.
+# The default value is: Helvetica.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_FONTNAME = Helvetica
+
+# The DOT_FONTSIZE tag can be used to set the size (in points) of the font of
+# dot graphs.
+# Minimum value: 4, maximum value: 24, default value: 10.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_FONTSIZE = 10
+
+# By default doxygen will tell dot to use the default font as specified with
+# DOT_FONTNAME. If you specify a different font using DOT_FONTNAME you can set
+# the path where dot can find it using this tag.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_FONTPATH =
+
+# If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for
+# each documented class showing the direct and indirect inheritance relations.
+# Setting this tag to YES will force the CLASS_DIAGRAMS tag to NO.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+CLASS_GRAPH = YES
+
+# If the COLLABORATION_GRAPH tag is set to YES then doxygen will generate a
+# graph for each documented class showing the direct and indirect implementation
+# dependencies (inheritance, containment, and class references variables) of the
+# class with other documented classes.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+COLLABORATION_GRAPH = YES
+
+# If the GROUP_GRAPHS tag is set to YES then doxygen will generate a graph for
+# groups, showing the direct groups dependencies.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+GROUP_GRAPHS = YES
+
+# If the UML_LOOK tag is set to YES, doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+UML_LOOK = NO
+
+# If the UML_LOOK tag is enabled, the fields and methods are shown inside the
+# class node. If there are many fields or methods and many nodes the graph may
+# become too big to be useful. The UML_LIMIT_NUM_FIELDS threshold limits the
+# number of items for each type to make the size more manageable. Set this to 0
+# for no limit. Note that the threshold may be exceeded by 50% before the limit
+# is enforced. So when you set the threshold to 10, up to 15 fields may appear,
+# but if the number exceeds 15, the total amount of fields shown is limited to
+# 10.
+# Minimum value: 0, maximum value: 100, default value: 10.
+# This tag requires that the tag UML_LOOK is set to YES.
+
+UML_LIMIT_NUM_FIELDS = 10
+
+# If the DOT_UML_DETAILS tag is set to NO, doxygen will show attributes and
+# methods without types and arguments in the UML graphs. If the DOT_UML_DETAILS
+# tag is set to YES, doxygen will add type and arguments for attributes and
+# methods in the UML graphs. If the DOT_UML_DETAILS tag is set to NONE, doxygen
+# will not generate fields with class member information in the UML graphs. The
+# class diagrams will look similar to the default class diagrams but using UML
+# notation for the relationships.
+# Possible values are: NO, YES and NONE.
+# The default value is: NO.
+# This tag requires that the tag UML_LOOK is set to YES.
+
+DOT_UML_DETAILS = NO
+
+# The DOT_WRAP_THRESHOLD tag can be used to set the maximum number of characters
+# to display on a single line. If the actual line length exceeds this threshold
+# significantly it will wrapped across multiple lines. Some heuristics are apply
+# to avoid ugly line breaks.
+# Minimum value: 0, maximum value: 1000, default value: 17.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_WRAP_THRESHOLD = 17
+
+# If the TEMPLATE_RELATIONS tag is set to YES then the inheritance and
+# collaboration graphs will show the relations between templates and their
+# instances.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+TEMPLATE_RELATIONS = NO
+
+# If the INCLUDE_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are set to
+# YES then doxygen will generate a graph for each documented file showing the
+# direct and indirect include dependencies of the file with other documented
+# files.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+INCLUDE_GRAPH = YES
+
+# If the INCLUDED_BY_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are
+# set to YES then doxygen will generate a graph for each documented file showing
+# the direct and indirect include dependencies of the file with other documented
+# files.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+INCLUDED_BY_GRAPH = YES
+
+# If the CALL_GRAPH tag is set to YES then doxygen will generate a call
+# dependency graph for every global function or class method.
+#
+# Note that enabling this option will significantly increase the time of a run.
+# So in most cases it will be better to enable call graphs for selected
+# functions only using the \callgraph command. Disabling a call graph can be
+# accomplished by means of the command \hidecallgraph.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+CALL_GRAPH = NO
+
+# If the CALLER_GRAPH tag is set to YES then doxygen will generate a caller
+# dependency graph for every global function or class method.
+#
+# Note that enabling this option will significantly increase the time of a run.
+# So in most cases it will be better to enable caller graphs for selected
+# functions only using the \callergraph command. Disabling a caller graph can be
+# accomplished by means of the command \hidecallergraph.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+CALLER_GRAPH = NO
+
+# If the GRAPHICAL_HIERARCHY tag is set to YES then doxygen will graphical
+# hierarchy of all classes instead of a textual one.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+GRAPHICAL_HIERARCHY = YES
+
+# If the DIRECTORY_GRAPH tag is set to YES then doxygen will show the
+# dependencies a directory has on other directories in a graphical way. The
+# dependency relations are determined by the #include relations between the
+# files in the directories.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DIRECTORY_GRAPH = YES
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. For an explanation of the image formats see the section
+# output formats in the documentation of the dot tool (Graphviz (see:
+# http://www.graphviz.org/)).
+# Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order
+# to make the SVG files visible in IE 9+ (other browsers do not have this
+# requirement).
+# Possible values are: png, png:cairo, png:cairo:cairo, png:cairo:gd, png:gd,
+# png:gd:gd, jpg, jpg:cairo, jpg:cairo:gd, jpg:gd, jpg:gd:gd, gif, gif:cairo,
+# gif:cairo:gd, gif:gd, gif:gd:gd, svg, png:gd, png:gd:gd, png:cairo,
+# png:cairo:gd, png:cairo:cairo, png:cairo:gdiplus, png:gdiplus and
+# png:gdiplus:gdiplus.
+# The default value is: png.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_IMAGE_FORMAT = png
+
+# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
+# enable generation of interactive SVG images that allow zooming and panning.
+#
+# Note that this requires a modern browser other than Internet Explorer. Tested
+# and working are Firefox, Chrome, Safari, and Opera.
+# Note: For IE 9+ you need to set HTML_FILE_EXTENSION to xhtml in order to make
+# the SVG files visible. Older versions of IE do not have SVG support.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+INTERACTIVE_SVG = NO
+
+# The DOT_PATH tag can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found in the path.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_PATH =
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the \dotfile
+# command).
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOTFILE_DIRS =
+
+# The MSCFILE_DIRS tag can be used to specify one or more directories that
+# contain msc files that are included in the documentation (see the \mscfile
+# command).
+
+MSCFILE_DIRS =
+
+# The DIAFILE_DIRS tag can be used to specify one or more directories that
+# contain dia files that are included in the documentation (see the \diafile
+# command).
+
+DIAFILE_DIRS =
+
+# When using plantuml, the PLANTUML_JAR_PATH tag should be used to specify the
+# path where java can find the plantuml.jar file. If left blank, it is assumed
+# PlantUML is not used or called during a preprocessing step. Doxygen will
+# generate a warning when it encounters a \startuml command in this case and
+# will not generate output for the diagram.
+
+PLANTUML_JAR_PATH =
+
+# When using plantuml, the PLANTUML_CFG_FILE tag can be used to specify a
+# configuration file for plantuml.
+
+PLANTUML_CFG_FILE =
+
+# When using plantuml, the specified paths are searched for files specified by
+# the !include statement in a plantuml block.
+
+PLANTUML_INCLUDE_PATH =
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes
+# that will be shown in the graph. If the number of nodes in a graph becomes
+# larger than this value, doxygen will truncate the graph, which is visualized
+# by representing a node as a red box. Note that doxygen if the number of direct
+# children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note that
+# the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+# Minimum value: 0, maximum value: 10000, default value: 50.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_GRAPH_MAX_NODES = 50
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the graphs
+# generated by dot. A depth value of 3 means that only nodes reachable from the
+# root by following a path via at most 3 edges will be shown. Nodes that lay
+# further from the root node will be omitted. Note that setting this option to 1
+# or 2 may greatly reduce the computation time needed for large code bases. Also
+# note that the size of a graph can be further restricted by
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+# Minimum value: 0, maximum value: 1000, default value: 0.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+MAX_DOT_GRAPH_DEPTH = 0
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, because dot on Windows does not seem
+# to support this out of the box.
+#
+# Warning: Depending on the platform used, enabling this option may lead to
+# badly anti-aliased labels on the edges of a graph (i.e. they become hard to
+# read).
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_TRANSPARENT = NO
+
+# Set the DOT_MULTI_TARGETS tag to YES to allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10) support
+# this, this feature is disabled by default.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_MULTI_TARGETS = NO
+
+# If the GENERATE_LEGEND tag is set to YES doxygen will generate a legend page
+# explaining the meaning of the various boxes and arrows in the dot generated
+# graphs.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+GENERATE_LEGEND = YES
+
+# If the DOT_CLEANUP tag is set to YES, doxygen will remove the intermediate
+# files that are used to generate the various graphs.
+#
+# Note: This setting is not only used for dot files but also for msc and
+# plantuml temporary files.
+# The default value is: YES.
+
+DOT_CLEANUP = YES
diff --git a/foreign/cpp/LICENSE b/foreign/cpp/LICENSE
new file mode 100644
index 00000000..fd9b9243
--- /dev/null
+++ b/foreign/cpp/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2023 Iggy
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/foreign/cpp/README.md b/foreign/cpp/README.md
new file mode 100644
index 00000000..5b470125
--- /dev/null
+++ b/foreign/cpp/README.md
@@ -0,0 +1,5 @@
+# Iggy C++ Client
+
+[](https://github.com/marketplace/actions/super-linter) [](https://coveralls.io/github/iggy-rs/iggy-cpp-client?branch=main)
+
+This project aims to create a full C++ client for [Iggy.rs](https://iggy.rs).
diff --git a/foreign/cpp/cmake/modules/CodeCoverage.cmake b/foreign/cpp/cmake/modules/CodeCoverage.cmake
new file mode 100644
index 00000000..11025b89
--- /dev/null
+++ b/foreign/cpp/cmake/modules/CodeCoverage.cmake
@@ -0,0 +1,842 @@
+# Copyright (c) 2012 - 2017, Lars Bilke
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without modification,
+# are permitted provided that the following conditions are met:
+#
+# 1. Redistributions of source code must retain the above copyright notice, this
+# list of conditions and the following disclaimer.
+#
+# 2. Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following disclaimer in the documentation
+# and/or other materials provided with the distribution.
+#
+# 3. Neither the name of the copyright holder nor the names of its contributors
+# may be used to endorse or promote products derived from this software without
+# specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
+# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# CHANGES:
+#
+# 2012-01-31, Lars Bilke
+# - Enable Code Coverage
+#
+# 2013-09-17, Joakim Söderberg
+# - Added support for Clang.
+# - Some additional usage instructions.
+#
+# 2016-02-03, Lars Bilke
+# - Refactored functions to use named parameters
+#
+# 2017-06-02, Lars Bilke
+# - Merged with modified version from github.com/ufz/ogs
+#
+# 2019-05-06, Anatolii Kurotych
+# - Remove unnecessary --coverage flag
+#
+# 2019-12-13, FeRD (Frank Dana)
+# - Deprecate COVERAGE_LCOVR_EXCLUDES and COVERAGE_GCOVR_EXCLUDES lists in favor
+# of tool-agnostic COVERAGE_EXCLUDES variable, or EXCLUDE setup arguments.
+# - CMake 3.4+: All excludes can be specified relative to BASE_DIRECTORY
+# - All setup functions: accept BASE_DIRECTORY, EXCLUDE list
+# - Set lcov basedir with -b argument
+# - Add automatic --demangle-cpp in lcovr, if 'c++filt' is available (can be
+# overridden with NO_DEMANGLE option in setup_target_for_coverage_lcovr().)
+# - Delete output dir, .info file on 'make clean'
+# - Remove Python detection, since version mismatches will break gcovr
+# - Minor cleanup (lowercase function names, update examples...)
+#
+# 2019-12-19, FeRD (Frank Dana)
+# - Rename Lcov outputs, make filtered file canonical, fix cleanup for targets
+#
+# 2020-01-19, Bob Apthorpe
+# - Added gfortran support
+#
+# 2020-02-17, FeRD (Frank Dana)
+# - Make all add_custom_target()s VERBATIM to auto-escape wildcard characters
+# in EXCLUDEs, and remove manual escaping from gcovr targets
+#
+# 2021-01-19, Robin Mueller
+# - Add CODE_COVERAGE_VERBOSE option which will allow to print out commands which are run
+# - Added the option for users to set the GCOVR_ADDITIONAL_ARGS variable to supply additional
+# flags to the gcovr command
+#
+# 2020-05-04, Mihchael Davis
+# - Add -fprofile-abs-path to make gcno files contain absolute paths
+# - Fix BASE_DIRECTORY not working when defined
+# - Change BYPRODUCT from folder to index.html to stop ninja from complaining about double defines
+#
+# 2021-05-10, Martin Stump
+# - Check if the generator is multi-config before warning about non-Debug builds
+#
+# 2022-02-22, Marko Wehle
+# - Change gcovr output from -o <filename> for --xml <filename> and --html <filename> output respectively.
+# This will allow for Multiple Output Formats at the same time by making use of GCOVR_ADDITIONAL_ARGS, e.g. GCOVR_ADDITIONAL_ARGS "--txt".
+#
+# 2022-09-28, Sebastian Mueller
+# - fix append_coverage_compiler_flags_to_target to correctly add flags
+# - replace "-fprofile-arcs -ftest-coverage" with "--coverage" (equivalent)
+#
+# USAGE:
+#
+# 1. Copy this file into your cmake modules path.
+#
+# 2. Add the following line to your CMakeLists.txt (best inside an if-condition
+# using a CMake option() to enable it just optionally):
+# include(CodeCoverage)
+#
+# 3. Append necessary compiler flags for all supported source files:
+# append_coverage_compiler_flags()
+# Or for specific target:
+# append_coverage_compiler_flags_to_target(YOUR_TARGET_NAME)
+#
+# 3.a (OPTIONAL) Set appropriate optimization flags, e.g. -O0, -O1 or -Og
+#
+# 4. If you need to exclude additional directories from the report, specify them
+# using full paths in the COVERAGE_EXCLUDES variable before calling
+# setup_target_for_coverage_*().
+# Example:
+# set(COVERAGE_EXCLUDES
+# '${PROJECT_SOURCE_DIR}/src/dir1/*'
+# '/path/to/my/src/dir2/*')
+# Or, use the EXCLUDE argument to setup_target_for_coverage_*().
+# Example:
+# setup_target_for_coverage_lcov(
+# NAME coverage
+# EXECUTABLE testrunner
+# EXCLUDE "${PROJECT_SOURCE_DIR}/src/dir1/*" "/path/to/my/src/dir2/*")
+#
+# 4.a NOTE: With CMake 3.4+, COVERAGE_EXCLUDES or EXCLUDE can also be set
+# relative to the BASE_DIRECTORY (default: PROJECT_SOURCE_DIR)
+# Example:
+# set(COVERAGE_EXCLUDES "dir1/*")
+# setup_target_for_coverage_gcovr_html(
+# NAME coverage
+# EXECUTABLE testrunner
+# BASE_DIRECTORY "${PROJECT_SOURCE_DIR}/src"
+# EXCLUDE "dir2/*")
+#
+# 5. Use the functions described below to create a custom make target which
+# runs your test executable and produces a code coverage report.
+#
+# 6. Build a Debug build:
+# cmake -DCMAKE_BUILD_TYPE=Debug ..
+# make
+# make my_coverage_target
+#
+
+include(CMakeParseArguments)
+
+option(CODE_COVERAGE_VERBOSE "Verbose information" FALSE)
+
+# Check prereqs
+find_program( GCOV_PATH gcov )
+find_program( LCOV_PATH NAMES lcov lcov.bat lcov.exe lcov.perl )
+find_program( FASTCOV_PATH NAMES fastcov fastcov.py )
+find_program( GENHTML_PATH NAMES genhtml genhtml.perl genhtml.bat )
+find_program( GCOVR_PATH gcovr PATHS ${CMAKE_SOURCE_DIR}/scripts/test )
+find_program( CPPFILT_PATH NAMES c++filt )
+
+if(NOT GCOV_PATH)
+ message(FATAL_ERROR "gcov not found! Aborting...")
+endif() # NOT GCOV_PATH
+
+# Check supported compiler (Clang, GNU and Flang)
+get_property(LANGUAGES GLOBAL PROPERTY ENABLED_LANGUAGES)
+foreach(LANG ${LANGUAGES})
+ if("${CMAKE_${LANG}_COMPILER_ID}" MATCHES "(Apple)?[Cc]lang")
+ if("${CMAKE_${LANG}_COMPILER_VERSION}" VERSION_LESS 3)
+ message(FATAL_ERROR "Clang version must be 3.0.0 or greater! Aborting...")
+ endif()
+ elseif(NOT "${CMAKE_${LANG}_COMPILER_ID}" MATCHES "GNU"
+ AND NOT "${CMAKE_${LANG}_COMPILER_ID}" MATCHES "(LLVM)?[Ff]lang")
+ message(FATAL_ERROR "Compiler is not GNU or Flang! Aborting...")
+ endif()
+endforeach()
+
+set(COVERAGE_COMPILER_FLAGS "-g --coverage"
+ CACHE INTERNAL "")
+
+if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)")
+ include(CheckCXXCompilerFlag)
+ check_cxx_compiler_flag(-fprofile-abs-path HAVE_cxx_fprofile_abs_path)
+ if(HAVE_cxx_fprofile_abs_path)
+ set(COVERAGE_CXX_COMPILER_FLAGS "${COVERAGE_COMPILER_FLAGS} -fprofile-abs-path")
+ endif()
+endif()
+if(CMAKE_C_COMPILER_ID MATCHES "(GNU|Clang)")
+ include(CheckCCompilerFlag)
+ check_c_compiler_flag(-fprofile-abs-path HAVE_c_fprofile_abs_path)
+ if(HAVE_c_fprofile_abs_path)
+ set(COVERAGE_C_COMPILER_FLAGS "${COVERAGE_COMPILER_FLAGS} -fprofile-abs-path")
+ endif()
+endif()
+
+set(CMAKE_Fortran_FLAGS_COVERAGE
+ ${COVERAGE_COMPILER_FLAGS}
+ CACHE STRING "Flags used by the Fortran compiler during coverage builds."
+ FORCE)
+set(CMAKE_CXX_FLAGS_COVERAGE
+ ${COVERAGE_COMPILER_FLAGS}
+ CACHE STRING "Flags used by the C++ compiler during coverage builds."
+ FORCE)
+set(CMAKE_C_FLAGS_COVERAGE
+ ${COVERAGE_COMPILER_FLAGS}
+ CACHE STRING "Flags used by the C compiler during coverage builds."
+ FORCE)
+set(CMAKE_EXE_LINKER_FLAGS_COVERAGE
+ ""
+ CACHE STRING "Flags used for linking binaries during coverage builds."
+ FORCE)
+set(CMAKE_SHARED_LINKER_FLAGS_COVERAGE
+ ""
+ CACHE STRING "Flags used by the shared libraries linker during coverage builds."
+ FORCE)
+mark_as_advanced(
+ CMAKE_Fortran_FLAGS_COVERAGE
+ CMAKE_CXX_FLAGS_COVERAGE
+ CMAKE_C_FLAGS_COVERAGE
+ CMAKE_EXE_LINKER_FLAGS_COVERAGE
+ CMAKE_SHARED_LINKER_FLAGS_COVERAGE)
+
+get_property(GENERATOR_IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
+if(NOT (CMAKE_BUILD_TYPE STREQUAL "Debug" OR GENERATOR_IS_MULTI_CONFIG))
+ message(WARNING "Code coverage results with an optimised (non-Debug) build may be misleading")
+endif() # NOT (CMAKE_BUILD_TYPE STREQUAL "Debug" OR GENERATOR_IS_MULTI_CONFIG)
+
+if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
+ link_libraries(gcov)
+endif()
+
+# Defines a target for running and collection code coverage information
+# Builds dependencies, runs the given executable and outputs reports.
+# NOTE! The executable should always have a ZERO as exit code otherwise
+# the coverage generation will not complete.
+#
+# setup_target_for_coverage_lcov(
+# NAME testrunner_coverage # New target name
+# EXECUTABLE testrunner -j ${PROCESSOR_COUNT} # Executable in PROJECT_BINARY_DIR
+# DEPENDENCIES testrunner # Dependencies to build first
+# BASE_DIRECTORY "../" # Base directory for report
+# # (defaults to PROJECT_SOURCE_DIR)
+# EXCLUDE "src/dir1/*" "src/dir2/*" # Patterns to exclude (can be relative
+# # to BASE_DIRECTORY, with CMake 3.4+)
+# NO_DEMANGLE # Don't demangle C++ symbols
+# # even if c++filt is found
+# )
+function(setup_target_for_coverage_lcov)
+
+ set(options NO_DEMANGLE SONARQUBE)
+ set(oneValueArgs BASE_DIRECTORY NAME)
+ set(multiValueArgs EXCLUDE EXECUTABLE EXECUTABLE_ARGS DEPENDENCIES LCOV_ARGS GENHTML_ARGS)
+ cmake_parse_arguments(Coverage "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
+
+ if(NOT LCOV_PATH)
+ message(FATAL_ERROR "lcov not found! Aborting...")
+ endif() # NOT LCOV_PATH
+
+ if(NOT GENHTML_PATH)
+ message(FATAL_ERROR "genhtml not found! Aborting...")
+ endif() # NOT GENHTML_PATH
+
+ # Set base directory (as absolute path), or default to PROJECT_SOURCE_DIR
+ if(DEFINED Coverage_BASE_DIRECTORY)
+ get_filename_component(BASEDIR ${Coverage_BASE_DIRECTORY} ABSOLUTE)
+ else()
+ set(BASEDIR ${PROJECT_SOURCE_DIR})
+ endif()
+
+ # Collect excludes (CMake 3.4+: Also compute absolute paths)
+ set(LCOV_EXCLUDES "")
+ foreach(EXCLUDE ${Coverage_EXCLUDE} ${COVERAGE_EXCLUDES} ${COVERAGE_LCOV_EXCLUDES})
+ if(CMAKE_VERSION VERSION_GREATER 3.4)
+ get_filename_component(EXCLUDE ${EXCLUDE} ABSOLUTE BASE_DIR ${BASEDIR})
+ endif()
+ list(APPEND LCOV_EXCLUDES "${EXCLUDE}")
+ endforeach()
+ list(REMOVE_DUPLICATES LCOV_EXCLUDES)
+
+ # Conditional arguments
+ if(CPPFILT_PATH AND NOT ${Coverage_NO_DEMANGLE})
+ set(GENHTML_EXTRA_ARGS "--demangle-cpp")
+ endif()
+
+ # Setting up commands which will be run to generate coverage data.
+ # Cleanup lcov
+ set(LCOV_CLEAN_CMD
+ ${LCOV_PATH} ${Coverage_LCOV_ARGS} --gcov-tool ${GCOV_PATH} -directory .
+ -b ${BASEDIR} --zerocounters
+ )
+ # Create baseline to make sure untouched files show up in the report
+ set(LCOV_BASELINE_CMD
+ ${LCOV_PATH} ${Coverage_LCOV_ARGS} --gcov-tool ${GCOV_PATH} -c -i -d . -b
+ ${BASEDIR} -o ${Coverage_NAME}.base
+ )
+ # Run tests
+ set(LCOV_EXEC_TESTS_CMD
+ ${Coverage_EXECUTABLE} ${Coverage_EXECUTABLE_ARGS}
+ )
+ # Capturing lcov counters and generating report
+ set(LCOV_CAPTURE_CMD
+ ${LCOV_PATH} ${Coverage_LCOV_ARGS} --gcov-tool ${GCOV_PATH} --directory . -b
+ ${BASEDIR} --capture --output-file ${Coverage_NAME}.capture
+ )
+ # add baseline counters
+ set(LCOV_BASELINE_COUNT_CMD
+ ${LCOV_PATH} ${Coverage_LCOV_ARGS} --gcov-tool ${GCOV_PATH} -a ${Coverage_NAME}.base
+ -a ${Coverage_NAME}.capture --output-file ${Coverage_NAME}.total
+ )
+ # filter collected data to final coverage report
+ set(LCOV_FILTER_CMD
+ ${LCOV_PATH} ${Coverage_LCOV_ARGS} --gcov-tool ${GCOV_PATH} --remove
+ ${Coverage_NAME}.total ${LCOV_EXCLUDES} --output-file ${Coverage_NAME}.info
+ )
+ # Generate HTML output
+ set(LCOV_GEN_HTML_CMD
+ ${GENHTML_PATH} ${GENHTML_EXTRA_ARGS} ${Coverage_GENHTML_ARGS} -o
+ ${Coverage_NAME} ${Coverage_NAME}.info
+ )
+ if(${Coverage_SONARQUBE})
+ # Generate SonarQube output
+ set(GCOVR_XML_CMD
+ ${GCOVR_PATH} --sonarqube ${Coverage_NAME}_sonarqube.xml -r ${BASEDIR} ${GCOVR_ADDITIONAL_ARGS}
+ ${GCOVR_EXCLUDE_ARGS} --object-directory=${PROJECT_BINARY_DIR}
+ )
+ set(GCOVR_XML_CMD_COMMAND
+ COMMAND ${GCOVR_XML_CMD}
+ )
+ set(GCOVR_XML_CMD_BYPRODUCTS ${Coverage_NAME}_sonarqube.xml)
+ set(GCOVR_XML_CMD_COMMENT COMMENT "SonarQube code coverage info report saved in ${Coverage_NAME}_sonarqube.xml.")
+ endif()
+
+
+ if(CODE_COVERAGE_VERBOSE)
+ message(STATUS "Executed command report")
+ message(STATUS "Command to clean up lcov: ")
+ string(REPLACE ";" " " LCOV_CLEAN_CMD_SPACED "${LCOV_CLEAN_CMD}")
+ message(STATUS "${LCOV_CLEAN_CMD_SPACED}")
+
+ message(STATUS "Command to create baseline: ")
+ string(REPLACE ";" " " LCOV_BASELINE_CMD_SPACED "${LCOV_BASELINE_CMD}")
+ message(STATUS "${LCOV_BASELINE_CMD_SPACED}")
+
+ message(STATUS "Command to run the tests: ")
+ string(REPLACE ";" " " LCOV_EXEC_TESTS_CMD_SPACED "${LCOV_EXEC_TESTS_CMD}")
+ message(STATUS "${LCOV_EXEC_TESTS_CMD_SPACED}")
+
+ message(STATUS "Command to capture counters and generate report: ")
+ string(REPLACE ";" " " LCOV_CAPTURE_CMD_SPACED "${LCOV_CAPTURE_CMD}")
+ message(STATUS "${LCOV_CAPTURE_CMD_SPACED}")
+
+ message(STATUS "Command to add baseline counters: ")
+ string(REPLACE ";" " " LCOV_BASELINE_COUNT_CMD_SPACED "${LCOV_BASELINE_COUNT_CMD}")
+ message(STATUS "${LCOV_BASELINE_COUNT_CMD_SPACED}")
+
+ message(STATUS "Command to filter collected data: ")
+ string(REPLACE ";" " " LCOV_FILTER_CMD_SPACED "${LCOV_FILTER_CMD}")
+ message(STATUS "${LCOV_FILTER_CMD_SPACED}")
+
+ message(STATUS "Command to generate lcov HTML output: ")
+ string(REPLACE ";" " " LCOV_GEN_HTML_CMD_SPACED "${LCOV_GEN_HTML_CMD}")
+ message(STATUS "${LCOV_GEN_HTML_CMD_SPACED}")
+
+ if(${Coverage_SONARQUBE})
+ message(STATUS "Command to generate SonarQube XML output: ")
+ string(REPLACE ";" " " GCOVR_XML_CMD_SPACED "${GCOVR_XML_CMD}")
+ message(STATUS "${GCOVR_XML_CMD_SPACED}")
+ endif()
+ endif()
+
+ # Setup target
+ add_custom_target(${Coverage_NAME}
+ COMMAND ${LCOV_CLEAN_CMD}
+ COMMAND ${LCOV_BASELINE_CMD}
+ COMMAND ${LCOV_EXEC_TESTS_CMD}
+ COMMAND ${LCOV_CAPTURE_CMD}
+ COMMAND ${LCOV_BASELINE_COUNT_CMD}
+ COMMAND ${LCOV_FILTER_CMD}
+ COMMAND ${LCOV_GEN_HTML_CMD}
+ ${GCOVR_XML_CMD_COMMAND}
+
+ # Set output files as GENERATED (will be removed on 'make clean')
+ BYPRODUCTS
+ ${Coverage_NAME}.base
+ ${Coverage_NAME}.capture
+ ${Coverage_NAME}.total
+ ${Coverage_NAME}.info
+ ${GCOVR_XML_CMD_BYPRODUCTS}
+ ${Coverage_NAME}/index.html
+ WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
+ DEPENDS ${Coverage_DEPENDENCIES}
+ VERBATIM # Protect arguments to commands
+ COMMENT "Resetting code coverage counters to zero.\nProcessing code coverage counters and generating report."
+ )
+
+ # Show where to find the lcov info report
+ add_custom_command(TARGET ${Coverage_NAME} POST_BUILD
+ COMMAND ;
+ COMMENT "Lcov code coverage info report saved in ${Coverage_NAME}.info."
+ ${GCOVR_XML_CMD_COMMENT}
+ )
+
+ # Show info where to find the report
+ add_custom_command(TARGET ${Coverage_NAME} POST_BUILD
+ COMMAND ;
+ COMMENT "Open ./${Coverage_NAME}/index.html in your browser to view the coverage report."
+ )
+
+endfunction() # setup_target_for_coverage_lcov
+
+# Defines a target for running and collection code coverage information
+# Builds dependencies, runs the given executable and outputs reports.
+# NOTE! The executable should always have a ZERO as exit code otherwise
+# the coverage generation will not complete.
+#
+# setup_target_for_coverage_gcovr_xml(
+# NAME ctest_coverage # New target name
+# EXECUTABLE ctest -j ${PROCESSOR_COUNT} # Executable in PROJECT_BINARY_DIR
+# DEPENDENCIES executable_target # Dependencies to build first
+# BASE_DIRECTORY "../" # Base directory for report
+# # (defaults to PROJECT_SOURCE_DIR)
+# EXCLUDE "src/dir1/*" "src/dir2/*" # Patterns to exclude (can be relative
+# # to BASE_DIRECTORY, with CMake 3.4+)
+# )
+# The user can set the variable GCOVR_ADDITIONAL_ARGS to supply additional flags to the
+# GCVOR command.
+function(setup_target_for_coverage_gcovr_xml)
+
+ set(options NONE)
+ set(oneValueArgs BASE_DIRECTORY NAME)
+ set(multiValueArgs EXCLUDE EXECUTABLE EXECUTABLE_ARGS DEPENDENCIES)
+ cmake_parse_arguments(Coverage "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
+
+ if(NOT GCOVR_PATH)
+ message(FATAL_ERROR "gcovr not found! Aborting...")
+ endif() # NOT GCOVR_PATH
+
+ # Set base directory (as absolute path), or default to PROJECT_SOURCE_DIR
+ if(DEFINED Coverage_BASE_DIRECTORY)
+ get_filename_component(BASEDIR ${Coverage_BASE_DIRECTORY} ABSOLUTE)
+ else()
+ set(BASEDIR ${PROJECT_SOURCE_DIR})
+ endif()
+
+ # Collect excludes (CMake 3.4+: Also compute absolute paths)
+ set(GCOVR_EXCLUDES "")
+ foreach(EXCLUDE ${Coverage_EXCLUDE} ${COVERAGE_EXCLUDES} ${COVERAGE_GCOVR_EXCLUDES})
+ if(CMAKE_VERSION VERSION_GREATER 3.4)
+ get_filename_component(EXCLUDE ${EXCLUDE} ABSOLUTE BASE_DIR ${BASEDIR})
+ endif()
+ list(APPEND GCOVR_EXCLUDES "${EXCLUDE}")
+ endforeach()
+ list(REMOVE_DUPLICATES GCOVR_EXCLUDES)
+
+ # Combine excludes to several -e arguments
+ set(GCOVR_EXCLUDE_ARGS "")
+ foreach(EXCLUDE ${GCOVR_EXCLUDES})
+ list(APPEND GCOVR_EXCLUDE_ARGS "-e")
+ list(APPEND GCOVR_EXCLUDE_ARGS "${EXCLUDE}")
+ endforeach()
+
+ # Set up commands which will be run to generate coverage data
+ # Run tests
+ set(GCOVR_XML_EXEC_TESTS_CMD
+ ${Coverage_EXECUTABLE} ${Coverage_EXECUTABLE_ARGS}
+ )
+ # Running gcovr
+ set(GCOVR_XML_CMD
+ ${GCOVR_PATH} --xml ${Coverage_NAME}.xml -r ${BASEDIR} ${GCOVR_ADDITIONAL_ARGS}
+ ${GCOVR_EXCLUDE_ARGS} --object-directory=${PROJECT_BINARY_DIR}
+ )
+
+ if(CODE_COVERAGE_VERBOSE)
+ message(STATUS "Executed command report")
+
+ message(STATUS "Command to run tests: ")
+ string(REPLACE ";" " " GCOVR_XML_EXEC_TESTS_CMD_SPACED "${GCOVR_XML_EXEC_TESTS_CMD}")
+ message(STATUS "${GCOVR_XML_EXEC_TESTS_CMD_SPACED}")
+
+ message(STATUS "Command to generate gcovr XML coverage data: ")
+ string(REPLACE ";" " " GCOVR_XML_CMD_SPACED "${GCOVR_XML_CMD}")
+ message(STATUS "${GCOVR_XML_CMD_SPACED}")
+ endif()
+
+ add_custom_target(${Coverage_NAME}
+ COMMAND ${GCOVR_XML_EXEC_TESTS_CMD}
+ COMMAND ${GCOVR_XML_CMD}
+
+ BYPRODUCTS ${Coverage_NAME}.xml
+ WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
+ DEPENDS ${Coverage_DEPENDENCIES}
+ VERBATIM # Protect arguments to commands
+ COMMENT "Running gcovr to produce Cobertura code coverage report."
+ )
+
+ # Show info where to find the report
+ add_custom_command(TARGET ${Coverage_NAME} POST_BUILD
+ COMMAND ;
+ COMMENT "Cobertura code coverage report saved in ${Coverage_NAME}.xml."
+ )
+endfunction() # setup_target_for_coverage_gcovr_xml
+
+# Defines a target for running and collection code coverage information
+# Builds dependencies, runs the given executable and outputs reports.
+# NOTE! The executable should always have a ZERO as exit code otherwise
+# the coverage generation will not complete.
+#
+# setup_target_for_coverage_gcovr_xml(
+# NAME ctest_coverage # New target name
+# EXECUTABLE ctest -j ${PROCESSOR_COUNT} # Executable in PROJECT_BINARY_DIR
+# DEPENDENCIES executable_target # Dependencies to build first
+# BASE_DIRECTORY "../" # Base directory for report
+# # (defaults to PROJECT_SOURCE_DIR)
+# EXCLUDE "src/dir1/*" "src/dir2/*" # Patterns to exclude (can be relative
+# # to BASE_DIRECTORY, with CMake 3.4+)
+# )
+# The user can set the variable GCOVR_ADDITIONAL_ARGS to supply additional flags to the
+# GCVOR command.
+function(setup_target_for_coverage_gcovr_coveralls)
+
+ set(options NONE)
+ set(oneValueArgs BASE_DIRECTORY NAME)
+ set(multiValueArgs EXCLUDE EXECUTABLE EXECUTABLE_ARGS DEPENDENCIES)
+ cmake_parse_arguments(Coverage "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
+
+ if(NOT GCOVR_PATH)
+ message(FATAL_ERROR "gcovr not found! Aborting...")
+ endif() # NOT GCOVR_PATH
+
+ # Set base directory (as absolute path), or default to PROJECT_SOURCE_DIR
+ if(DEFINED Coverage_BASE_DIRECTORY)
+ get_filename_component(BASEDIR ${Coverage_BASE_DIRECTORY} ABSOLUTE)
+ else()
+ set(BASEDIR ${PROJECT_SOURCE_DIR})
+ endif()
+
+ # Collect excludes (CMake 3.4+: Also compute absolute paths)
+ set(GCOVR_EXCLUDES "")
+ foreach(EXCLUDE ${Coverage_EXCLUDE} ${COVERAGE_EXCLUDES} ${COVERAGE_GCOVR_EXCLUDES})
+ if(CMAKE_VERSION VERSION_GREATER 3.4)
+ get_filename_component(EXCLUDE ${EXCLUDE} ABSOLUTE BASE_DIR ${BASEDIR})
+ endif()
+ list(APPEND GCOVR_EXCLUDES "${EXCLUDE}")
+ endforeach()
+ list(REMOVE_DUPLICATES GCOVR_EXCLUDES)
+
+ # Combine excludes to several -e arguments
+ set(GCOVR_EXCLUDE_ARGS "")
+ foreach(EXCLUDE ${GCOVR_EXCLUDES})
+ list(APPEND GCOVR_EXCLUDE_ARGS "-e")
+ list(APPEND GCOVR_EXCLUDE_ARGS "${EXCLUDE}")
+ endforeach()
+
+ # Set up commands which will be run to generate coverage data
+ # Run tests
+ set(GCOVR_COVERALLS_EXEC_TESTS_CMD
+ ${Coverage_EXECUTABLE} ${Coverage_EXECUTABLE_ARGS}
+ )
+ # Running gcovr
+ set(GCOVR_COVERALLS_CMD
+ ${GCOVR_PATH} --coveralls-pretty -o ${Coverage_NAME}.json -r ${BASEDIR} ${GCOVR_ADDITIONAL_ARGS}
+ ${GCOVR_EXCLUDE_ARGS} --object-directory=${PROJECT_BINARY_DIR}
+ )
+
+ if(CODE_COVERAGE_VERBOSE)
+ message(STATUS "Executed command report")
+
+ message(STATUS "Command to run tests: ")
+ string(REPLACE ";" " " GCOVR_COVERALLS_EXEC_TESTS_CMD_SPACED "${GCOVR_COVERALLS_EXEC_TESTS_CMD}")
+ message(STATUS "${GCOVR_COVERALLS_EXEC_TESTS_CMD_SPACED}")
+
+ message(STATUS "Command to generate gcovr Coveralls coverage data: ")
+ string(REPLACE ";" " " GCOVR_COVERALLS_CMD_SPACED "${GCOVR_COVERALLS_CMD}")
+ message(STATUS "${GCOVR_COVERALLS_CMD_SPACED}")
+ endif()
+
+ add_custom_target(${Coverage_NAME}
+ COMMAND ${GCOVR_COVERALLS_EXEC_TESTS_CMD}
+ COMMAND ${GCOVR_COVERALLS_CMD}
+
+ BYPRODUCTS ${Coverage_NAME}.json
+ WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
+ DEPENDS ${Coverage_DEPENDENCIES}
+ VERBATIM # Protect arguments to commands
+ COMMENT "Running gcovr to produce Coveralls code coverage report."
+ )
+
+ # Show info where to find the report
+ add_custom_command(TARGET ${Coverage_NAME} POST_BUILD
+ COMMAND ;
+ COMMENT "Coveralls code coverage report saved in ${Coverage_NAME}.json."
+ )
+endfunction() # setup_target_for_coverage_gcovr_coveralls
+
+# Defines a target for running and collection code coverage information
+# Builds dependencies, runs the given executable and outputs reports.
+# NOTE! The executable should always have a ZERO as exit code otherwise
+# the coverage generation will not complete.
+#
+# setup_target_for_coverage_gcovr_html(
+# NAME ctest_coverage # New target name
+# EXECUTABLE ctest -j ${PROCESSOR_COUNT} # Executable in PROJECT_BINARY_DIR
+# DEPENDENCIES executable_target # Dependencies to build first
+# BASE_DIRECTORY "../" # Base directory for report
+# # (defaults to PROJECT_SOURCE_DIR)
+# EXCLUDE "src/dir1/*" "src/dir2/*" # Patterns to exclude (can be relative
+# # to BASE_DIRECTORY, with CMake 3.4+)
+# )
+# The user can set the variable GCOVR_ADDITIONAL_ARGS to supply additional flags to the
+# GCVOR command.
+function(setup_target_for_coverage_gcovr_html)
+
+ set(options NONE)
+ set(oneValueArgs BASE_DIRECTORY NAME)
+ set(multiValueArgs EXCLUDE EXECUTABLE EXECUTABLE_ARGS DEPENDENCIES)
+ cmake_parse_arguments(Coverage "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
+
+ if(NOT GCOVR_PATH)
+ message(FATAL_ERROR "gcovr not found! Aborting...")
+ endif() # NOT GCOVR_PATH
+
+ # Set base directory (as absolute path), or default to PROJECT_SOURCE_DIR
+ if(DEFINED Coverage_BASE_DIRECTORY)
+ get_filename_component(BASEDIR ${Coverage_BASE_DIRECTORY} ABSOLUTE)
+ else()
+ set(BASEDIR ${PROJECT_SOURCE_DIR})
+ endif()
+
+ # Collect excludes (CMake 3.4+: Also compute absolute paths)
+ set(GCOVR_EXCLUDES "")
+ foreach(EXCLUDE ${Coverage_EXCLUDE} ${COVERAGE_EXCLUDES} ${COVERAGE_GCOVR_EXCLUDES})
+ if(CMAKE_VERSION VERSION_GREATER 3.4)
+ get_filename_component(EXCLUDE ${EXCLUDE} ABSOLUTE BASE_DIR ${BASEDIR})
+ endif()
+ list(APPEND GCOVR_EXCLUDES "${EXCLUDE}")
+ endforeach()
+ list(REMOVE_DUPLICATES GCOVR_EXCLUDES)
+
+ # Combine excludes to several -e arguments
+ set(GCOVR_EXCLUDE_ARGS "")
+ foreach(EXCLUDE ${GCOVR_EXCLUDES})
+ list(APPEND GCOVR_EXCLUDE_ARGS "-e")
+ list(APPEND GCOVR_EXCLUDE_ARGS "${EXCLUDE}")
+ endforeach()
+
+ # Set up commands which will be run to generate coverage data
+ # Run tests
+ set(GCOVR_HTML_EXEC_TESTS_CMD
+ ${Coverage_EXECUTABLE} ${Coverage_EXECUTABLE_ARGS}
+ )
+ # Create folder
+ set(GCOVR_HTML_FOLDER_CMD
+ ${CMAKE_COMMAND} -E make_directory ${PROJECT_BINARY_DIR}/${Coverage_NAME}
+ )
+ # Running gcovr
+ set(GCOVR_HTML_CMD
+ ${GCOVR_PATH} --html ${Coverage_NAME}/index.html --html-details -r ${BASEDIR} ${GCOVR_ADDITIONAL_ARGS}
+ ${GCOVR_EXCLUDE_ARGS} --object-directory=${PROJECT_BINARY_DIR}
+ )
+
+ if(CODE_COVERAGE_VERBOSE)
+ message(STATUS "Executed command report")
+
+ message(STATUS "Command to run tests: ")
+ string(REPLACE ";" " " GCOVR_HTML_EXEC_TESTS_CMD_SPACED "${GCOVR_HTML_EXEC_TESTS_CMD}")
+ message(STATUS "${GCOVR_HTML_EXEC_TESTS_CMD_SPACED}")
+
+ message(STATUS "Command to create a folder: ")
+ string(REPLACE ";" " " GCOVR_HTML_FOLDER_CMD_SPACED "${GCOVR_HTML_FOLDER_CMD}")
+ message(STATUS "${GCOVR_HTML_FOLDER_CMD_SPACED}")
+
+ message(STATUS "Command to generate gcovr HTML coverage data: ")
+ string(REPLACE ";" " " GCOVR_HTML_CMD_SPACED "${GCOVR_HTML_CMD}")
+ message(STATUS "${GCOVR_HTML_CMD_SPACED}")
+ endif()
+
+ add_custom_target(${Coverage_NAME}
+ COMMAND ${GCOVR_HTML_EXEC_TESTS_CMD}
+ COMMAND ${GCOVR_HTML_FOLDER_CMD}
+ COMMAND ${GCOVR_HTML_CMD}
+
+ BYPRODUCTS ${PROJECT_BINARY_DIR}/${Coverage_NAME}/index.html # report directory
+ WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
+ DEPENDS ${Coverage_DEPENDENCIES}
+ VERBATIM # Protect arguments to commands
+ COMMENT "Running gcovr to produce HTML code coverage report."
+ )
+
+ # Show info where to find the report
+ add_custom_command(TARGET ${Coverage_NAME} POST_BUILD
+ COMMAND ;
+ COMMENT "Open ./${Coverage_NAME}/index.html in your browser to view the coverage report."
+ )
+
+endfunction() # setup_target_for_coverage_gcovr_html
+
+# Defines a target for running and collection code coverage information
+# Builds dependencies, runs the given executable and outputs reports.
+# NOTE! The executable should always have a ZERO as exit code otherwise
+# the coverage generation will not complete.
+#
+# setup_target_for_coverage_fastcov(
+# NAME testrunner_coverage # New target name
+# EXECUTABLE testrunner -j ${PROCESSOR_COUNT} # Executable in PROJECT_BINARY_DIR
+# DEPENDENCIES testrunner # Dependencies to build first
+# BASE_DIRECTORY "../" # Base directory for report
+# # (defaults to PROJECT_SOURCE_DIR)
+# EXCLUDE "src/dir1/" "src/dir2/" # Patterns to exclude.
+# NO_DEMANGLE # Don't demangle C++ symbols
+# # even if c++filt is found
+# SKIP_HTML # Don't create html report
+# POST_CMD perl -i -pe s!${PROJECT_SOURCE_DIR}/!!g ctest_coverage.json # E.g. for stripping source dir from file paths
+# )
+function(setup_target_for_coverage_fastcov)
+
+ set(options NO_DEMANGLE SKIP_HTML)
+ set(oneValueArgs BASE_DIRECTORY NAME)
+ set(multiValueArgs EXCLUDE EXECUTABLE EXECUTABLE_ARGS DEPENDENCIES FASTCOV_ARGS GENHTML_ARGS POST_CMD)
+ cmake_parse_arguments(Coverage "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
+
+ if(NOT FASTCOV_PATH)
+ message(FATAL_ERROR "fastcov not found! Aborting...")
+ endif()
+
+ if(NOT Coverage_SKIP_HTML AND NOT GENHTML_PATH)
+ message(FATAL_ERROR "genhtml not found! Aborting...")
+ endif()
+
+ # Set base directory (as absolute path), or default to PROJECT_SOURCE_DIR
+ if(Coverage_BASE_DIRECTORY)
+ get_filename_component(BASEDIR ${Coverage_BASE_DIRECTORY} ABSOLUTE)
+ else()
+ set(BASEDIR ${PROJECT_SOURCE_DIR})
+ endif()
+
+ # Collect excludes (Patterns, not paths, for fastcov)
+ set(FASTCOV_EXCLUDES "")
+ foreach(EXCLUDE ${Coverage_EXCLUDE} ${COVERAGE_EXCLUDES} ${COVERAGE_FASTCOV_EXCLUDES})
+ list(APPEND FASTCOV_EXCLUDES "${EXCLUDE}")
+ endforeach()
+ list(REMOVE_DUPLICATES FASTCOV_EXCLUDES)
+
+ # Conditional arguments
+ if(CPPFILT_PATH AND NOT ${Coverage_NO_DEMANGLE})
+ set(GENHTML_EXTRA_ARGS "--demangle-cpp")
+ endif()
+
+ # Set up commands which will be run to generate coverage data
+ set(FASTCOV_EXEC_TESTS_CMD ${Coverage_EXECUTABLE} ${Coverage_EXECUTABLE_ARGS})
+
+ set(FASTCOV_CAPTURE_CMD ${FASTCOV_PATH} ${Coverage_FASTCOV_ARGS} --gcov ${GCOV_PATH}
+ --search-directory ${BASEDIR}
+ --process-gcno
+ --output ${Coverage_NAME}.json
+ --exclude ${FASTCOV_EXCLUDES}
+ )
+
+ set(FASTCOV_CONVERT_CMD ${FASTCOV_PATH}
+ -C ${Coverage_NAME}.json --lcov --output ${Coverage_NAME}.info
+ )
+
+ if(Coverage_SKIP_HTML)
+ set(FASTCOV_HTML_CMD ";")
+ else()
+ set(FASTCOV_HTML_CMD ${GENHTML_PATH} ${GENHTML_EXTRA_ARGS} ${Coverage_GENHTML_ARGS}
+ -o ${Coverage_NAME} ${Coverage_NAME}.info
+ )
+ endif()
+
+ set(FASTCOV_POST_CMD ";")
+ if(Coverage_POST_CMD)
+ set(FASTCOV_POST_CMD ${Coverage_POST_CMD})
+ endif()
+
+ if(CODE_COVERAGE_VERBOSE)
+ message(STATUS "Code coverage commands for target ${Coverage_NAME} (fastcov):")
+
+ message(" Running tests:")
+ string(REPLACE ";" " " FASTCOV_EXEC_TESTS_CMD_SPACED "${FASTCOV_EXEC_TESTS_CMD}")
+ message(" ${FASTCOV_EXEC_TESTS_CMD_SPACED}")
+
+ message(" Capturing fastcov counters and generating report:")
+ string(REPLACE ";" " " FASTCOV_CAPTURE_CMD_SPACED "${FASTCOV_CAPTURE_CMD}")
+ message(" ${FASTCOV_CAPTURE_CMD_SPACED}")
+
+ message(" Converting fastcov .json to lcov .info:")
+ string(REPLACE ";" " " FASTCOV_CONVERT_CMD_SPACED "${FASTCOV_CONVERT_CMD}")
+ message(" ${FASTCOV_CONVERT_CMD_SPACED}")
+
+ if(NOT Coverage_SKIP_HTML)
+ message(" Generating HTML report: ")
+ string(REPLACE ";" " " FASTCOV_HTML_CMD_SPACED "${FASTCOV_HTML_CMD}")
+ message(" ${FASTCOV_HTML_CMD_SPACED}")
+ endif()
+ if(Coverage_POST_CMD)
+ message(" Running post command: ")
+ string(REPLACE ";" " " FASTCOV_POST_CMD_SPACED "${FASTCOV_POST_CMD}")
+ message(" ${FASTCOV_POST_CMD_SPACED}")
+ endif()
+ endif()
+
+ # Setup target
+ add_custom_target(${Coverage_NAME}
+
+ # Cleanup fastcov
+ COMMAND ${FASTCOV_PATH} ${Coverage_FASTCOV_ARGS} --gcov ${GCOV_PATH}
+ --search-directory ${BASEDIR}
+ --zerocounters
+
+ COMMAND ${FASTCOV_EXEC_TESTS_CMD}
+ COMMAND ${FASTCOV_CAPTURE_CMD}
+ COMMAND ${FASTCOV_CONVERT_CMD}
+ COMMAND ${FASTCOV_HTML_CMD}
+ COMMAND ${FASTCOV_POST_CMD}
+
+ # Set output files as GENERATED (will be removed on 'make clean')
+ BYPRODUCTS
+ ${Coverage_NAME}.info
+ ${Coverage_NAME}.json
+ ${Coverage_NAME}/index.html # report directory
+
+ WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
+ DEPENDS ${Coverage_DEPENDENCIES}
+ VERBATIM # Protect arguments to commands
+ COMMENT "Resetting code coverage counters to zero. Processing code coverage counters and generating report."
+ )
+
+ set(INFO_MSG "fastcov code coverage info report saved in ${Coverage_NAME}.info and ${Coverage_NAME}.json.")
+ if(NOT Coverage_SKIP_HTML)
+ string(APPEND INFO_MSG " Open ${PROJECT_BINARY_DIR}/${Coverage_NAME}/index.html in your browser to view the coverage report.")
+ endif()
+ # Show where to find the fastcov info report
+ add_custom_command(TARGET ${Coverage_NAME} POST_BUILD
+ COMMAND ${CMAKE_COMMAND} -E echo ${INFO_MSG}
+ )
+
+endfunction() # setup_target_for_coverage_fastcov
+
+function(append_coverage_compiler_flags)
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COVERAGE_COMPILER_FLAGS}" PARENT_SCOPE)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COVERAGE_COMPILER_FLAGS}" PARENT_SCOPE)
+ set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${COVERAGE_COMPILER_FLAGS}" PARENT_SCOPE)
+ message(STATUS "Appending code coverage compiler flags: ${COVERAGE_COMPILER_FLAGS}")
+endfunction() # append_coverage_compiler_flags
+
+# Setup coverage for specific library
+function(append_coverage_compiler_flags_to_target name)
+ separate_arguments(_flag_list NATIVE_COMMAND "${COVERAGE_COMPILER_FLAGS}")
+ target_compile_options(${name} PRIVATE ${_flag_list})
+ if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
+ target_link_libraries(${name} PRIVATE gcov)
+ endif()
+endfunction()
diff --git a/foreign/cpp/docs/CMakeLists.txt b/foreign/cpp/docs/CMakeLists.txt
new file mode 100644
index 00000000..de08a9e1
--- /dev/null
+++ b/foreign/cpp/docs/CMakeLists.txt
@@ -0,0 +1,16 @@
+# set up Doxygen for API doc generation
+if(BUILD_DOCS)
+ find_package(Doxygen)
+
+ if(DOXYGEN_FOUND)
+ # Note the option ALL which allows to build the docs together with the application
+ set(DOXYGEN_CFG ${CMAKE_CURRENT_SOURCE_DIR}/../Doxyfile)
+ add_custom_target( docs ALL
+ COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_CFG}
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../
+ COMMENT "Generating API documentation with Doxygen"
+ VERBATIM )
+ else()
+ message(FATAL_ERROR, "Doxygen need to be installed to generate the doxygen documentation")
+ endif()
+endif()
diff --git a/foreign/cpp/docs/images/init_act.png b/foreign/cpp/docs/images/init_act.png
new file mode 100644
index 00000000..d222fb0f
Binary files /dev/null and b/foreign/cpp/docs/images/init_act.png differ
diff --git a/foreign/cpp/docs/images/pre-commit_run.png b/foreign/cpp/docs/images/pre-commit_run.png
new file mode 100644
index 00000000..fc0c248d
Binary files /dev/null and b/foreign/cpp/docs/images/pre-commit_run.png differ
diff --git a/foreign/cpp/images/iggy-cpp-build/.devcontainer/devcontainer.json b/foreign/cpp/images/iggy-cpp-build/.devcontainer/devcontainer.json
new file mode 100644
index 00000000..7a18e777
--- /dev/null
+++ b/foreign/cpp/images/iggy-cpp-build/.devcontainer/devcontainer.json
@@ -0,0 +1,39 @@
+{
+ "image": "mcr.microsoft.com/devcontainers/cpp:1-ubuntu-22.04",
+ "features": {
+ "ghcr.io/akhildevelops/devcontainer-features/pip:0": {
+ "packages": [
+ "flawfinder",
+ "lizard"
+ ]
+ },
+ "ghcr.io/devcontainers/features/common-utils:2": {},
+ "ghcr.io/devcontainers/features/docker-in-docker:2": {},
+ "ghcr.io/devcontainers/features/github-cli:1": {},
+ "ghcr.io/devcontainers-contrib/features/act:1": {},
+ "ghcr.io/devcontainers-contrib/features/apt-packages": {
+ "packages": [
+ "autoconf",
+ "autoconf-archive",
+ "automake",
+ "build-essential",
+ "clang-format",
+ "clang-tidy",
+ "doxygen",
+ "gcovr",
+ "graphviz",
+ "lcov",
+ "libtool",
+ "ninja-build",
+ "python3",
+ "xdg-utils"
+ ]
+ },
+ "ghcr.io/devcontainers-contrib/features/markdownlint-cli2:1": {},
+ "ghcr.io/devcontainers-contrib/features/pre-commit:2": {},
+ "ghcr.io/dhoeric/features/hadolint:1": {},
+ "ghcr.io/msclock/features/vcpkg:1": {
+ "vcpkgversion": "stable"
+ }
+ }
+}
diff --git a/foreign/cpp/images/iggy-cpp-build/README.md b/foreign/cpp/images/iggy-cpp-build/README.md
new file mode 100644
index 00000000..50388dbc
--- /dev/null
+++ b/foreign/cpp/images/iggy-cpp-build/README.md
@@ -0,0 +1,6 @@
+
+# Iggy C++ Build Container
+
+This directory contains the source for the pre-built devcontainer referenced in `.devcontainer` at the top level.
+
+Under normal circumstances you should not need to modify or load this; it gets build in a dedicated GitHub Action.
diff --git a/foreign/cpp/sdk/binary.h b/foreign/cpp/sdk/binary.h
new file mode 100644
index 00000000..78462b28
--- /dev/null
+++ b/foreign/cpp/sdk/binary.h
@@ -0,0 +1,61 @@
+#pragma once
+
+#include "serialization.h"
+
+namespace icp {
+namespace serialization {
+/**
+ * @namespace binary
+ * @brief All related types for the binary format used in Iggy's TCP and QUIC transports.
+ *
+ * The definitions \htmlonly <a href="https://docs.iggy.rs/specification/binary">binary specification</a> \endhtmlonly
+ * which should be taken as canonical; E2E conformance tests will be used to ensure client stays in line. I am not sure
+ * about this design yet; ideally I want minimal duplication between the binary and JSON variations, and so may
+ * introduce format-specific serializers. This is less natural in C++ than Rust.
+ */
+namespace binary {
+
+/**
+ * @enum CommandCode
+ * @brief Complete list of supported integer codes for the Iggy protocol.
+ */
+enum CommandCode {
+ PING = 1,
+ GET_STATS = 10,
+ GET_ME = 20,
+ GET_CLIENT = 21,
+ GET_CLIENTS = 22,
+ POLL_MESSAGES = 100,
+ SEND_MESSAGES = 101,
+ GET_CONSUMER_OFFSET = 120,
+ STORE_CONSUMER_OFFSET = 121,
+ GET_STREAM = 200,
+ GET_STREAMS = 201,
+ CREATE_STREAM = 202,
+ DELETE_STREAM = 203,
+ GET_TOPIC = 300,
+ GET_TOPICS = 301,
+ CREATE_TOPIC = 302,
+ DELETE_TOPIC = 303,
+ CREATE_PARTITIONS = 402,
+ DELETE_PARTITIONS = 403,
+ GET_CONSUMER_GROUP = 600,
+ GET_CONSUMER_GROUPS = 601,
+ CREATE_CONSUMER_GROUP = 602,
+ DELETE_CONSUMER_GROUP = 603,
+ JOIN_CONSUMER_GROUP = 604,
+ LEAVE_CONSUMER_GROUP = 605
+};
+
+/**
+ * @class BinaryWireFormat
+ * @brief Simple binary serialization and deserialization for Iggy's protocol.
+ */
+class BinaryWireFormat : icp::serialization::WireFormat {
+public:
+ BinaryWireFormat() = default;
+}
+
+} // namespace binary
+} // namespace serialization
+} // namespace icp
diff --git a/foreign/cpp/sdk/client.cc b/foreign/cpp/sdk/client.cc
new file mode 100644
index 00000000..a60e854e
--- /dev/null
+++ b/foreign/cpp/sdk/client.cc
@@ -0,0 +1,24 @@
+#include "client.h"
+#include <reproc++/reproc.hpp>
+#include <string>
+#include <vector>
+
+icp::client::Client::Client(const Options& options) {
+ // to make more natural interface for setting options we use a struct, so need to validate it.
+ options.validate();
+}
+
+void icp::client::Client::ping() {
+ // temporary! using the Rust CLI from Docker to execute the ping to demonstrate test fixture
+ reproc::process ping_process;
+ reproc::options options;
+ options.redirect.parent = true;
+ std::vector<std::string> ping_args = {"docker", "exec", "iggy_test", "/iggy/iggy", "ping"};
+ ping_process.start(ping_args, options);
+ ping_process.wait(reproc::milliseconds(5000));
+}
+
+icp::model::sys::Stats icp::client::Client::getStats() {
+ // temporary! need to send GetStats command to server then use WireFormat to read the response
+ return icp::model::sys::Stats(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", "", "");
+}
diff --git a/foreign/cpp/sdk/client.h b/foreign/cpp/sdk/client.h
new file mode 100644
index 00000000..f62d5a90
--- /dev/null
+++ b/foreign/cpp/sdk/client.h
@@ -0,0 +1,92 @@
+#pragma once
+
+#include <sodium.h>
+#include <stdexcept>
+#include <string>
+#include "model.h"
+#include "net/iggy.h"
+#include "net/transport.h"
+
+namespace icp {
+namespace client {
+
+/**
+ * @class Credentials
+ * @brief Iggy server login credentials: username and password for now.
+ *
+ * This class provides a secure holder for the password; when destroyed, it zeroes of the memory.
+ */
+class Credentials {
+private:
+ std::string username;
+ std::string password;
+
+public:
+ Credentials(const std::string& username, const std::string& password)
+ : username(username)
+ , password(password) {}
+
+ ~Credentials() { sodium_memzero(&password[0], password.size()); }
+};
+
+/**
+ * @struct Options
+ * @brief A struct to hold various options.
+ *
+ * This struct is used to hold various options and settings
+ * that are used throughout the application. Each field in the
+ * struct represents a different option.
+ */
+struct Options {
+ /**
+ * @brief The hostname of the Iggy server.
+ */
+ std::string hostname = "localhost";
+
+ /**
+ * @brief The port the Iggy server is listening on; default depends on transport. Defaults to the DEFAULT_TCP_PORT.
+ */
+ unsigned short port = icp::net::DEFAULT_TCP_PORT;
+
+ /**
+ * @brief The network transport to use when connecting to the server. Defaults to TCP.
+ */
+ icp::net::transport::Transport transport = icp::net::transport::Transport::TCP;
+
+ /**
+ * @brief The user credentials to use when connecting to the server.
+ *
+ * Note that the default credentials are built-in and are not secure. We recommend that you create a new
+ * admin user with a strong password and then deactivate this user.
+ */
+ client::Credentials credentials = client::Credentials("iggy", "iggy");
+
+ void validate() const {
+ if (hostname.empty()) {
+ throw std::invalid_argument("Hostname cannot be empty");
+ }
+ }
+};
+
+/**
+ * @class Client
+ * @brief Flexible client for connecting to the Iggy server.
+ *
+ * Main Iggy C++ client. You can use Options to configure the endpoint, credentials and transport.
+ */
+class Client {
+public:
+ explicit Client(const Options& options);
+
+ /**
+ * @brief Send a synchronous ping to the server to check if it is alive.
+ */
+ void ping();
+
+ /**
+ * @brief Get the Iggy server's performance statistics.
+ */
+ icp::model::sys::Stats getStats();
+};
+}; // namespace client
+}; // namespace icp
diff --git a/foreign/cpp/sdk/command.h b/foreign/cpp/sdk/command.h
new file mode 100644
index 00000000..1db6b849
--- /dev/null
+++ b/foreign/cpp/sdk/command.h
@@ -0,0 +1,465 @@
+#pragma once
+
+#include <string>
+#include "model.h"
+#include "types.h"
+
+namespace icp {
+
+/**
+ * @brief All supported commands in the Iggy protocol.
+ *
+ * Serialization-agnostic Command classes that you can send via an @ref icp::client::Client.
+ */
+namespace command {
+
+class Command {
+public:
+ virtual ~Command() = default;
+};
+
+/**
+ * @brief Commands related to managing Iggy streams.
+ */
+namespace stream {
+class GetStream : Command {
+private:
+ const icp::model::shared::Identifier& streamId;
+
+public:
+ explicit GetStream(const icp::model::shared::Identifier& streamId)
+ : streamId(streamId) {}
+
+ const icp::model::shared::Identifier& getStreamId() const { return streamId; }
+};
+
+class GetStreams : Command {};
+class CreateStream : Command {
+private:
+ const icp::model::shared::Identifier& streamId;
+ const std::string& name;
+
+public:
+ CreateStream(const icp::model::shared::Identifier& streamId, const std::string& name)
+ : streamId(streamId)
+ , name(name) {}
+
+ const icp::model::shared::Identifier& getStreamId() const { return streamId; }
+ const std::string& getName() const { return name; }
+};
+
+class DeleteStream : Command {
+private:
+ const icp::model::shared::Identifier& streamId;
+
+public:
+ explicit DeleteStream(const icp::model::shared::Identifier& streamId)
+ : streamId(streamId) {}
+
+ const icp::model::shared::Identifier& getStreamId() const { return streamId; }
+};
+} // namespace stream
+
+/**
+ * @brief Commands related to managing Iggy topics.
+ */
+namespace topic {
+class GetTopic : Command {
+private:
+ const icp::model::shared::Identifier& streamId;
+ const icp::model::shared::Identifier& topicId;
+
+public:
+ GetTopic(const icp::model::shared::Identifier& streamId, const icp::model::shared::Identifier& topicId)
+ : streamId(streamId)
+ , topicId(topicId) {}
+
+ const icp::model::shared::Identifier& getStreamId() const { return streamId; }
+ const icp::model::shared::Identifier& getTopicId() const { return topicId; }
+};
+
+class GetTopics : Command {
+private:
+ const icp::model::shared::Identifier& streamId;
+
+public:
+ explicit GetTopics(const icp::model::shared::Identifier& streamId)
+ : streamId(streamId) {}
+
+ const icp::model::shared::Identifier& getStreamId() const { return streamId; }
+};
+
+class CreateTopic : Command {
+private:
+ const icp::model::shared::Identifier& streamId;
+ const uint32_t topicId;
+ const uint32_t partitionsCount;
+ const std::optional<uint32_t> messageExpiry;
+ const std::string& name;
+
+public:
+ CreateTopic(const icp::model::shared::Identifier& streamId,
+ uint32_t topicId,
+ uint32_t partitionsCount,
+ const std::optional<uint32_t> messageExpiry,
+ const std::string& name)
+ : streamId(streamId)
+ , topicId(topicId)
+ , partitionsCount(partitionsCount)
+ , messageExpiry(messageExpiry)
+ , name(name) {}
+
+ const icp::model::shared::Identifier& getStreamId() const { return streamId; }
+ uint32_t getTopicId() const { return topicId; }
+ uint32_t getPartitionsCount() const { return partitionsCount; }
+ const std::optional<uint32_t> getMessageExpiry() const { return messageExpiry; }
+ const std::string& getName() const { return name; }
+};
+} // namespace topic
+
+/**
+ * @brief Commands related to managing Iggy partitions.
+ */
+namespace partition {
+class CreatePartitions : Command {
+private:
+ const icp::model::shared::Identifier& streamId;
+ const icp::model::shared::Identifier& topicId;
+ const uint32_t partitionsCount;
+
+public:
+ CreatePartitions(const icp::model::shared::Identifier& streamId,
+ const icp::model::shared::Identifier& topicId,
+ uint32_t partitionsCount)
+ : streamId(streamId)
+ , topicId(topicId)
+ , partitionsCount(partitionsCount) {}
+
+ const icp::model::shared::Identifier& getStreamId() const { return streamId; }
+ const icp::model::shared::Identifier& getTopicId() const { return topicId; }
+ uint32_t getPartitionsCount() const { return partitionsCount; }
+};
+
+class DeletePartitions : Command {
+private:
+ const icp::model::shared::Identifier& streamId;
+ const icp::model::shared::Identifier& topicId;
+ const uint32_t partitionsCount;
+
+public:
+ DeletePartitions(const icp::model::shared::Identifier& streamId,
+ const icp::model::shared::Identifier& topicId,
+ uint32_t partitionsCount)
+ : streamId(streamId)
+ , topicId(topicId)
+ , partitionsCount(partitionsCount) {}
+
+ const icp::model::shared::Identifier& getStreamId() const { return streamId; }
+ const icp::model::shared::Identifier& getTopicId() const { return topicId; }
+ uint32_t getPartitionsCount() const { return partitionsCount; }
+};
+} // namespace partition
+
+/**
+ * @brief Commands related to reading and writing messages.
+ */
+namespace message {
+enum PollingKind { OFFSET = 1, TIMESTAMP = 2, FIRST = 3, LAST = 4, NEXT = 5 };
+class PollingStrategy {
+private:
+ const PollingKind kind;
+ const uint64_t value;
+
+public:
+ PollingStrategy(PollingKind kind, uint64_t value)
+ : kind(kind)
+ , value(value) {}
+ PollingKind getKind() const { return kind; }
+ uint64_t getValue() const { return value; }
+};
+
+class PollMessages : Command {
+private:
+ const icp::model::shared::Consumer& consumer;
+ const icp::model::shared::Identifier& streamId;
+ const icp::model::shared::Identifier& topicId;
+ const uint32_t partitionId;
+ const PollingStrategy strategy;
+ const uint32_t count;
+ const bool autoCommit;
+
+public:
+ PollMessages(const icp::model::shared::Consumer& consumer,
+ const icp::model::shared::Identifier& streamId,
+ const icp::model::shared::Identifier& topicId,
+ uint32_t partitionId,
+ PollingStrategy strategy,
+ uint32_t count,
+ bool autoCommit)
+ : consumer(consumer)
+ , streamId(streamId)
+ , topicId(topicId)
+ , partitionId(partitionId)
+ , strategy(strategy)
+ , count(count)
+ , autoCommit(autoCommit) {}
+
+ const icp::model::shared::Consumer& getConsumer() const { return consumer; }
+ const icp::model::shared::Identifier& getStreamId() const { return streamId; }
+ const icp::model::shared::Identifier& getTopicId() const { return topicId; }
+ uint32_t getPartitionId() const { return partitionId; }
+ PollingStrategy getStrategy() const { return strategy; }
+ uint32_t getCount() const { return count; }
+ bool getAutoCommit() const { return autoCommit; }
+};
+
+enum PartitioningKind { BALANCED = 1, PARITION_ID = 2, MESSAGES_KEY = 3 };
+
+/**
+ * @brief Layout for how to partition the messages being sent in @ref SendMessages.
+ */
+class Partitioning {
+private:
+ const PartitioningKind kind;
+ const uint8_t length;
+ const std::vector<unsigned char>& value;
+
+public:
+ Partitioning(PartitioningKind kind, uint8_t length, const std::vector<unsigned char>& value)
+ : kind(kind)
+ , length(length)
+ , value(value) {}
+
+ PartitioningKind getKind() const { return kind; }
+ uint8_t getLength() const { return length; }
+ const std::vector<unsigned char>& getValue() const { return value; }
+};
+class SendMessages : Command {};
+
+} // namespace message
+
+/**
+ * @brief Commands related to managing server-side managed stream consumer offsets.
+ */
+namespace consumeroffset {
+
+/**
+ * @brief Command to retrieve a server-side managed consumer offset.
+ */
+class GetConsumerOffset : Command {
+private:
+ const icp::model::shared::Consumer& consumer;
+ const icp::model::shared::Identifier& streamId;
+ const icp::model::shared::Identifier& topicId;
+ const uint32_t partitionId;
+
+public:
+ GetConsumerOffset(const icp::model::shared::Consumer& consumer,
+ const icp::model::shared::Identifier& streamId,
+ const icp::model::shared::Identifier& topicId,
+ uint32_t partitionId)
+ : consumer(consumer)
+ , streamId(streamId)
+ , topicId(topicId)
+ , partitionId(partitionId) {}
+
+ const icp::model::shared::Consumer& getConsumer() const { return consumer; }
+ const icp::model::shared::Identifier& getStreamId() const { return streamId; }
+ const icp::model::shared::Identifier& getTopicId() const { return topicId; }
+ uint32_t getPartitionId() const { return partitionId; }
+};
+
+/**
+ * @brief Command to store a server-side managed consumer offset.
+ */
+class StoreConsumerOffset : Command {
+private:
+ const icp::model::shared::Consumer& consumer;
+ const icp::model::shared::Identifier& streamId;
+ const icp::model::shared::Identifier& topicId;
+ const uint32_t partitionId;
+ const uint64_t offset;
+
+public:
+ StoreConsumerOffset(const icp::model::shared::Consumer& consumer,
+ const icp::model::shared::Identifier& streamId,
+ const icp::model::shared::Identifier& topicId,
+ uint32_t partitionId,
+ uint64_t offset)
+ : consumer(consumer)
+ , streamId(streamId)
+ , topicId(topicId)
+ , partitionId(partitionId)
+ , offset(offset) {}
+
+ const icp::model::shared::Consumer& getConsumer() const { return consumer; }
+ const icp::model::shared::Identifier& getStreamId() const { return streamId; }
+ const icp::model::shared::Identifier& getTopicId() const { return topicId; }
+ uint32_t getPartitionId() const { return partitionId; }
+ uint64_t getOffset() const { return offset; }
+};
+
+} // namespace consumeroffset
+
+/**
+ * @brief Commands related to managing server-side managed stream consumer groups.
+ */
+namespace consumergroup {
+
+/**
+ * @brief Command to retrieve details on a server-side managed consumer group.
+ */
+class GetConsumerGroup : Command {
+private:
+ const icp::model::shared::Identifier& streamId;
+ const icp::model::shared::Identifier& topicId;
+ const uint32_t consumerGroupId;
+
+public:
+ GetConsumerGroup(const icp::model::shared::Identifier& streamId,
+ const icp::model::shared::Identifier& topicId,
+ uint32_t consumerGroupId)
+ : streamId(streamId)
+ , topicId(topicId)
+ , consumerGroupId(consumerGroupId) {}
+
+ const icp::model::shared::Identifier& getStreamId() const { return streamId; }
+ const icp::model::shared::Identifier& getTopicId() const { return topicId; }
+ uint32_t getConsumerGroupId() const { return consumerGroupId; }
+};
+
+/**
+ * @brief Command to retrieve details on all server-side managed consumer groups for a given stream and topic.
+ */
+class GetConsumerGroups : Command {
+private:
+ const icp::model::shared::Identifier& streamId;
+ const icp::model::shared::Identifier& topicId;
+
+public:
+ GetConsumerGroups(const icp::model::shared::Identifier& streamId, const icp::model::shared::Identifier& topicId)
+ : streamId(streamId)
+ , topicId(topicId) {}
+
+ const icp::model::shared::Identifier& getStreamId() const { return streamId; }
+ const icp::model::shared::Identifier& getTopicId() const { return topicId; }
+};
+
+class CreateConsumerGroup : Command {
+private:
+ const icp::model::shared::Identifier& streamId;
+ const icp::model::shared::Identifier& topicId;
+ const uint32_t consumerGroupId;
+
+public:
+ CreateConsumerGroup(const icp::model::shared::Identifier& streamId,
+ const icp::model::shared::Identifier& topicId,
+ uint32_t consumerGroupId)
+ : streamId(streamId)
+ , topicId(topicId)
+ , consumerGroupId(consumerGroupId) {}
+
+ const icp::model::shared::Identifier& getStreamId() const { return streamId; }
+ const icp::model::shared::Identifier& getTopicId() const { return topicId; }
+ uint32_t getConsumerGroupId() const { return consumerGroupId; }
+};
+
+class DeleteConsumerGroup : Command {
+private:
+ const icp::model::shared::Identifier& streamId;
+ const icp::model::shared::Identifier& topicId;
+ const uint32_t consumerGroupId;
+
+public:
+ DeleteConsumerGroup(const icp::model::shared::Identifier& streamId,
+ const icp::model::shared::Identifier& topicId,
+ uint32_t consumerGroupId)
+ : streamId(streamId)
+ , topicId(topicId)
+ , consumerGroupId(consumerGroupId) {}
+
+ const icp::model::shared::Identifier& getStreamId() const { return streamId; }
+ const icp::model::shared::Identifier& getTopicId() const { return topicId; }
+ uint32_t getConsumerGroupId() const { return consumerGroupId; }
+};
+
+class JoinConsumerGroup : Command {
+private:
+ const icp::model::shared::Identifier& streamId;
+ const icp::model::shared::Identifier& topicId;
+ const uint32_t consumerGroupId;
+
+public:
+ JoinConsumerGroup(const icp::model::shared::Identifier& streamId,
+ const icp::model::shared::Identifier& topicId,
+ uint32_t consumerGroupId)
+ : streamId(streamId)
+ , topicId(topicId)
+ , consumerGroupId(consumerGroupId) {}
+
+ const icp::model::shared::Identifier& getStreamId() const { return streamId; }
+ const icp::model::shared::Identifier& getTopicId() const { return topicId; }
+ uint32_t getConsumerGroupId() const { return consumerGroupId; }
+};
+
+class LeaveConsumerGroup : Command {
+private:
+ const icp::model::shared::Identifier& streamId;
+ const icp::model::shared::Identifier& topicId;
+ const uint32_t consumerGroupId;
+
+public:
+ LeaveConsumerGroup(const icp::model::shared::Identifier& streamId,
+ const icp::model::shared::Identifier& topicId,
+ uint32_t consumerGroupId)
+ : streamId(streamId)
+ , topicId(topicId)
+ , consumerGroupId(consumerGroupId) {}
+
+ const icp::model::shared::Identifier& getStreamId() const { return streamId; }
+ const icp::model::shared::Identifier& getTopicId() const { return topicId; }
+ uint32_t getConsumerGroupId() const { return consumerGroupId; }
+};
+
+} // namespace consumergroup
+
+/**
+ * @brief Commands related to global system state.
+ */
+namespace sys {
+/**
+ * @brief Simple ping command to check if the server is alive.
+ */
+class Ping : Command {};
+
+/**
+ * @brief Command to get information about the calling client.
+ */
+class GetMe : Command {};
+
+/**
+ * @brief Command to get information about a specific client.
+ */
+class GetClient : Command {
+private:
+ const uint32_t clientId;
+
+public:
+ explicit GetClient(uint32_t clientId)
+ : clientId(clientId) {}
+
+ uint32_t getClientId() const { return clientId; }
+};
+
+/**
+ * @brief Command to get the full list of clients on the server.
+ */
+class GetClients : Command {};
+
+/**
+ * @brief Command to get information about the server's performance
+ */
+class GetStats : Command {};
+} // namespace sys
+} // namespace command
+} // namespace icp
diff --git a/foreign/cpp/sdk/json.cc b/foreign/cpp/sdk/json.cc
new file mode 100644
index 00000000..31d85432
--- /dev/null
+++ b/foreign/cpp/sdk/json.cc
@@ -0,0 +1 @@
+#include "json.h"
diff --git a/foreign/cpp/sdk/json.h b/foreign/cpp/sdk/json.h
new file mode 100644
index 00000000..2aa414fb
--- /dev/null
+++ b/foreign/cpp/sdk/json.h
@@ -0,0 +1,26 @@
+#pragma once
+
+#include <nlohmann/json.hpp>
+#include "serialization.h"
+
+using json = nlohmann::json;
+
+namespace icp {
+namespace serialization {
+
+/**
+ * @brief All related types for the JSON format used in Iggy's HTTP REST transport.
+ */
+namespace json {
+
+/**
+ * @brief JSON serialization and deserialization for Iggy's wire protocol.
+ */
+class JsonWireFormat : icp::serialization::WireFormat {
+public:
+ JsonWireFormat() = default;
+};
+
+} // namespace json
+} // namespace serialization
+} // namespace icp
diff --git a/foreign/cpp/sdk/model.cc b/foreign/cpp/sdk/model.cc
new file mode 100644
index 00000000..0e1234cd
--- /dev/null
+++ b/foreign/cpp/sdk/model.cc
@@ -0,0 +1 @@
+#include "model.h"
diff --git a/foreign/cpp/sdk/model.h b/foreign/cpp/sdk/model.h
new file mode 100644
index 00000000..651d65e4
--- /dev/null
+++ b/foreign/cpp/sdk/model.h
@@ -0,0 +1,663 @@
+#pragma once
+
+#include <optional>
+#include <string>
+#include <unordered_map>
+#include <vector>
+#include "types.h"
+
+namespace icp {
+
+/**
+ * @brief Value objects used in the Iggy protocol.
+ */
+namespace model {
+
+/**
+ * @brief Base class for all value objects used in the Iggy protocol.
+ */
+class Model {
+public:
+ virtual ~Model() = default;
+};
+
+/**
+ * @brief Models shared across multiple functional groups.
+ */
+namespace shared {
+/**
+ * @brief Discriminator to allow correct decoding of identifier bytes.
+ */
+enum IdKind { NUMERIC = 1, STRING = 2 };
+
+/**
+ * @brief An identifier for a stream or a topic.
+ */
+class Identifier : Model {
+private:
+ const IdKind kind;
+ const uint8_t length;
+ const std::vector<unsigned char>& value;
+
+public:
+ Identifier(IdKind kind, uint8_t length, const std::vector<unsigned char>& value)
+ : kind(kind)
+ , length(length)
+ , value(value) {}
+ IdKind getKind() { return kind; }
+ uint8_t getLength() { return length; }
+ const std::vector<unsigned char>& getValue() { return value; }
+};
+
+/**
+ * @brief Discriminator to allow correct decoding of consumer kind bytes.
+ */
+enum ConsumerKind { CONSUMER = 1, CONSUMER_GROUP = 2 };
+
+/**
+ * @brief A consumer of a message stream; may be part of a consumer group.
+ */
+class Consumer : Model {
+private:
+ const ConsumerKind kind;
+ const uint32_t id;
+
+public:
+ Consumer(ConsumerKind kind, uint32_t id)
+ : kind(kind)
+ , id(id) {}
+ ConsumerKind getKind() { return kind; }
+ uint32_t getId() { return id; }
+};
+}; // namespace shared
+
+namespace partition {
+
+/**
+ * @brief Metadata describing a partition of a topic.
+ */
+class Partition : Model {
+private:
+ const uint32_t id;
+ const uint64_t createdAt;
+ const uint32_t segmentsCount;
+ const uint64_t currentOffset;
+ const uint64_t sizeBytes;
+ uint64_t messagesCount;
+
+public:
+ Partition(uint32_t id, uint64_t createdAt, uint32_t segmentsCount, uint64_t currentOffset, uint64_t sizeBytes, uint64_t messagesCount)
+ : id(id)
+ , createdAt(createdAt)
+ , segmentsCount(segmentsCount)
+ , currentOffset(currentOffset)
+ , sizeBytes(sizeBytes)
+ , messagesCount(messagesCount) {}
+ uint32_t getId() { return id; }
+ uint64_t getCreatedAt() { return createdAt; }
+ uint32_t getSegmentsCount() { return segmentsCount; }
+ uint64_t getCurrentOffset() { return currentOffset; }
+ uint64_t getSizeBytes() { return sizeBytes; }
+ uint64_t getMessagesCount() { return messagesCount; }
+};
+}; // namespace partition
+
+/**
+ * @brief Models related to topic metadata.
+ */
+namespace topic {
+
+/**
+ * @brief Metadata describing a topic at a summary level.
+ */
+class Topic : Model {
+private:
+ const uint32_t id;
+ const uint64_t createdAt;
+ const std::string& name;
+ const uint64_t sizeBytes;
+ const std::optional<uint32_t> messageExpiry;
+ const std::optional<uint64_t> maxTopicSize;
+ const uint8_t replicationFactor;
+ const uint64_t messagesCount;
+ const uint32_t partitionsCount;
+
+public:
+ Topic(uint32_t id,
+ uint64_t createdAt,
+ const std::string& name,
+ uint64_t sizeBytes,
+ std::optional<uint32_t> messageExpiry,
+ std::optional<uint64_t> maxTopicSize,
+ uint8_t replicationFactor,
+ uint64_t messagesCount,
+ uint32_t partitionsCount)
+ : id(id)
+ , createdAt(createdAt)
+ , name(name)
+ , sizeBytes(sizeBytes)
+ , messageExpiry(messageExpiry)
+ , maxTopicSize(maxTopicSize)
+ , replicationFactor(replicationFactor)
+ , messagesCount(messagesCount)
+ , partitionsCount(partitionsCount) {}
+ uint32_t getId() { return id; }
+ uint64_t getCreatedAt() { return createdAt; }
+ const std::string& getName() { return name; }
+ uint64_t getSizeBytes() { return sizeBytes; }
+ std::optional<uint32_t> getMessageExpiry() { return messageExpiry; }
+ std::optional<uint64_t> getMaxTopicSize() { return maxTopicSize; }
+ uint8_t getReplicationFactor() { return replicationFactor; }
+ uint64_t getMessagesCount() { return messagesCount; }
+ uint32_t getPartitionsCount() { return partitionsCount; }
+};
+
+/**
+ * @brief Metadata describing a topic, including partition details.
+ */
+class TopicDetails : Model {
+private:
+ uint32_t id;
+ uint64_t createdAt;
+ std::string name;
+ uint64_t sizeBytes;
+ const std::optional<uint32_t> messageExpiry;
+ const std::optional<uint64_t> maxTopicSize;
+ uint8_t replicationFactor;
+ uint64_t messagesCount;
+ uint32_t partitionsCount;
+ const std::vector<partition::Partition>& partitions;
+
+public:
+ TopicDetails(uint32_t id,
+ uint64_t createdAt,
+ const std::string& name,
+ uint64_t sizeBytes,
+ std::optional<uint32_t> messageExpiry,
+ std::optional<uint64_t> maxTopicSize,
+ uint8_t replicationFactor,
+ uint64_t messagesCount,
+ uint32_t partitionsCount,
+ const std::vector<partition::Partition>& partitions)
+ : id(id)
+ , createdAt(createdAt)
+ , name(name)
+ , sizeBytes(sizeBytes)
+ , messageExpiry(messageExpiry)
+ , maxTopicSize(maxTopicSize)
+ , replicationFactor(replicationFactor)
+ , messagesCount(messagesCount)
+ , partitionsCount(partitionsCount)
+ , partitions(partitions) {}
+
+ uint32_t getId() { return id; }
+ uint64_t getCreatedAt() { return createdAt; }
+ const std::string& getName() { return name; }
+ uint64_t getSizeBytes() { return sizeBytes; }
+ std::optional<uint32_t> getMessageExpiry() { return messageExpiry; }
+ std::optional<uint64_t> getMaxTopicSize() { return maxTopicSize; }
+ uint8_t getReplicationFactor() { return replicationFactor; }
+ uint64_t getMessagesCount() { return messagesCount; }
+ uint32_t getPartitionsCount() { return partitionsCount; }
+ const std::vector<partition::Partition>& getPartitions() { return partitions; }
+};
+}; // namespace topic
+
+/**
+ * @brief Models related to message stream metadata.
+ */
+namespace stream {
+
+/**
+ * @brief Metadata describing a message stream including topic details.
+ */
+class StreamDetails : Model {
+private:
+ const uint32_t id;
+ const uint64_t createdAt;
+ const std::string& name;
+ const uint64_t sizeBytes;
+ const uint64_t messagesCount;
+ const uint32_t topicsCount;
+ const std::vector<topic::Topic>& topics;
+
+public:
+ StreamDetails(uint32_t id,
+ uint64_t createdAt,
+ const std::string& name,
+ uint64_t sizeBytes,
+ uint64_t messagesCount,
+ uint32_t topicsCount,
+ const std::vector<topic::Topic>& topics)
+ : id(id)
+ , createdAt(createdAt)
+ , name(name)
+ , sizeBytes(sizeBytes)
+ , messagesCount(messagesCount)
+ , topicsCount(topicsCount)
+ , topics(topics) {}
+ uint32_t getId() { return id; }
+ uint64_t getCreatedAt() { return createdAt; }
+ const std::string getName() & { return name; }
+ uint64_t getSizeBytes() { return sizeBytes; }
+ uint64_t getMessagesCount() { return messagesCount; }
+ uint32_t getTopicsCount() { return topicsCount; }
+ const std::vector<topic::Topic>& getTopics() { return topics; }
+};
+}; // namespace stream
+
+/**
+ * @brief Models related to messages consumed and sent to the Iggy server.
+ */
+namespace message {
+
+/**
+ * @brief Current state of the message on the server.
+ */
+enum MessageState { AVAILABLE = 1, UNAVAILABLE = 10, POISONED = 20, MARKED_FOR_DELETION = 30 };
+
+typedef std::string HeaderKey;
+
+/**
+ * @brief Discriminator to allow correct decoding of header value bytes representing different value types.
+ */
+enum HeaderKind {
+ RAW = 1,
+ STRING = 2,
+ BOOL = 3,
+ INT8 = 4,
+ INT16 = 5,
+ INT32 = 6,
+ INT64 = 7,
+ INT128 = 8,
+ UINT8 = 9,
+ UINT16 = 10,
+ UINT32 = 11,
+ UINT64 = 12,
+ UINT128 = 13,
+ FLOAT32 = 14,
+ FLOAT64 = 15
+};
+
+/**
+ * @brief A value of various types associated with the message header -- message metadata.
+ */
+class HeaderValue : Model {
+private:
+ const HeaderKind kind;
+ const std::vector<unsigned char>& value;
+
+public:
+ HeaderValue(HeaderKind kind, const std::vector<unsigned char>& value)
+ : kind(kind)
+ , value(value) {}
+
+ HeaderKind getKind() const { return kind; }
+ const std::vector<unsigned char>& getValue() const { return value; }
+};
+
+/**
+ * @brief A message consumed or sent to the server, with binary payload and flexible metadata.
+ */
+class Message : Model {
+private:
+ // core message state
+ const uint128_t id;
+ const std::unordered_map<HeaderKey, HeaderValue>& headers;
+ const uint32_t length;
+ const std::vector<unsigned char>& payload;
+
+ // message state set on the server-side
+ const std::optional<uint64_t> offset;
+ const std::optional<MessageState> state;
+ const std::optional<uint64_t> timestamp;
+ const std::optional<uint32_t> checksum;
+
+public:
+ /**
+ * @brief Fully-qualified message constructor; @ref isComplete will be true.
+ */
+ Message(uint128_t id,
+ const std::unordered_map<HeaderKey, HeaderValue>& headers,
+ uint32_t length,
+ const std::vector<unsigned char>& payload,
+ std::optional<uint64_t> offset,
+ std::optional<MessageState> state,
+ std::optional<uint64_t> timestamp,
+ std::optional<uint32_t> checksum)
+ : id(id)
+ , headers(headers)
+ , length(length)
+ , payload(payload)
+ , offset(offset)
+ , state(state)
+ , timestamp(timestamp)
+ , checksum(checksum) {}
+
+ /**
+ * @brief Simpler constructor for a message to be delivered to the server; @ref isComplete will be false.
+ */
+ Message(uint128_t id,
+ const std::unordered_map<HeaderKey, HeaderValue>& headers,
+ uint32_t length,
+ const std::vector<unsigned char>& payload)
+ : Message(id,
+ headers,
+ length,
+ payload,
+ std::optional<uint64_t>(),
+ std::optional<MessageState>(),
+ std::optional<uint64_t>(),
+ std::optional<uint32_t>()) {}
+
+ uint128_t getId() const { return id; }
+ const std::unordered_map<HeaderKey, HeaderValue>& getHeaders() const { return headers; }
+ uint32_t getLength() const { return length; }
+ const std::vector<unsigned char>& getPayload() const { return payload; }
+ std::optional<uint64_t> getOffset() const { return offset; }
+ std::optional<MessageState> getState() const { return state; }
+ std::optional<uint64_t> getTimestamp() const { return timestamp; }
+ std::optional<uint32_t> getChecksum() const { return checksum; }
+
+ /**
+ * @brief Check if the message has all the server-side fields set.
+ */
+ bool isComplete() const { return offset.has_value() && state.has_value() && timestamp.has_value() && checksum.has_value(); }
+};
+
+/**
+ * @brief Carrier object for all the messages polled from the server,
+ */
+class PolledMessages : Model {
+private:
+ const uint32_t partition_id;
+ const uint64_t current_offset;
+ const std::vector<Message>& messages;
+
+public:
+ PolledMessages(uint32_t partition_id, uint64_t current_offset, const std::vector<Message>& messages)
+ : partition_id(partition_id)
+ , current_offset(current_offset)
+ , messages(messages) {}
+
+ uint32_t getPartitionId() const { return partition_id; }
+ uint64_t getCurrentOffset() const { return current_offset; }
+ const std::vector<Message>& getMessages() const { return messages; }
+};
+
+} // namespace message
+
+/**
+ * @brief Information about server-managed stream consumer offsets.
+ */
+namespace consumeroffset {
+
+/**
+ * @brief Current state of the client's position reading the stream via a consumer or consumer group.
+ */
+class ConsumerOffsetInfo : Model {
+private:
+ const uint32_t partitionId;
+ const uint64_t currentOffset;
+ const uint64_t storedOffset;
+
+public:
+ ConsumerOffsetInfo(uint32_t partitionId, uint64_t currentOffset, uint64_t storedOffset)
+ : partitionId(partitionId)
+ , currentOffset(currentOffset)
+ , storedOffset(storedOffset) {}
+ uint32_t getPartitionId() { return partitionId; }
+ uint64_t getCurrentOffset() { return currentOffset; }
+ uint64_t getStoredOffset() { return storedOffset; }
+};
+}; // namespace consumeroffset
+
+/**
+ * @brief Models related to consumer groups, which are used to coordinate message consumption across multiple clients.
+ */
+namespace consumergroup {
+
+class ConsumerGroupMember : Model {
+private:
+ const uint32_t id;
+ const uint32_t partitionsCount;
+ const std::vector<uint32_t>& partitions;
+
+public:
+ ConsumerGroupMember(uint32_t id, uint32_t partitionsCount, const std::vector<uint32_t>& partitions)
+ : id(id)
+ , partitionsCount(partitionsCount)
+ , partitions(partitions) {}
+ uint32_t getId() { return id; }
+ uint32_t getPartitionsCount() { return partitionsCount; }
+ const std::vector<uint32_t>& getPartitions() { return partitions; }
+};
+
+class ConsumerGroupDetails : Model {
+private:
+ uint32_t id;
+ const std::string& name;
+ uint32_t paritionsCount;
+ uint32_t membersCount;
+ const std::vector<ConsumerGroupMember>& members;
+
+public:
+ ConsumerGroupDetails(uint32_t id,
+ const std::string& name,
+ uint32_t paritionsCount,
+ uint32_t membersCount,
+ const std::vector<ConsumerGroupMember>& members)
+ : id(id)
+ , name(name)
+ , paritionsCount(paritionsCount)
+ , membersCount(membersCount)
+ , members(members) {}
+ uint32_t getId() const { return id; }
+ const std::string& getName() const { return name; }
+ uint32_t getParitionsCount() const { return paritionsCount; }
+ uint32_t getMembersCount() const { return membersCount; }
+ const std::vector<ConsumerGroupMember>& getMembers() const { return members; }
+};
+}; // namespace consumergroup
+
+/**
+ * @brief Models related to global system state.
+ */
+namespace sys {
+
+/**
+ * @brief Summary of the consumer groups that a client has joined.
+ */
+class ConsumerGroupInfo : Model {
+private:
+ const uint32_t streamId;
+ const uint32_t topicId;
+ const uint32_t consumerGroupId;
+
+public:
+ ConsumerGroupInfo(uint32_t streamId, uint32_t topicId, uint32_t consumerGroupId)
+ : streamId(streamId)
+ , topicId(topicId)
+ , consumerGroupId(consumerGroupId) {}
+ uint32_t getStreamId() { return streamId; }
+ uint32_t getTopicId() { return topicId; }
+ uint32_t getConsumerGroupId() { return consumerGroupId; }
+};
+
+/**
+ * @brief Information about a client connected to the server.
+ */
+class ClientInfoDetails : Model {
+private:
+ const uint32_t clientId;
+ const std::optional<uint32_t> userId;
+ const std::string& address;
+ const std::string& transport;
+ const uint32_t consumerGroupsCount;
+ const std::vector<ConsumerGroupInfo>& consumerGroups;
+
+public:
+ ClientInfoDetails(uint32_t clientId,
+ std::optional<uint32_t> userId,
+ const std::string& address,
+ const std::string& transport,
+ uint32_t consumerGroupsCount,
+ const std::vector<ConsumerGroupInfo>& consumerGroups)
+ : clientId(clientId)
+ , userId(userId)
+ , address(address)
+ , transport(transport)
+ , consumerGroupsCount(consumerGroupsCount)
+ , consumerGroups(consumerGroups) {}
+ uint32_t getClientId() const { return clientId; }
+ std::optional<uint32_t> getUserId() const { return userId; }
+ const std::string& getAddress() const { return address; }
+ const std::string& getTransport() const { return transport; }
+ uint32_t getConsumerGroupsCount() const { return consumerGroupsCount; }
+ const std::vector<ConsumerGroupInfo>& getConsumerGroups() const { return consumerGroups; }
+};
+
+/**
+ * @brief Model class holding server performance statistics.
+ *
+ * This class is used to represent the result of the GetStats call,
+ * which gets a snapshot of latest server performance statistics.
+ *
+ * @see [GetStats definition](https://docs.iggy.rs/specification/binary#get-stats)
+ * @see [stats.rs](https://github.com/iggy-rs/iggy/blob/master/iggy/src/models/stats.rs)
+ */
+class Stats : Model {
+private:
+ const pid_t process_id;
+ const percent_t cpu_usage;
+ const byte_cnt_t memory_usage;
+ const byte_cnt_t total_memory;
+ const byte_cnt_t available_memory;
+ const time_val_t run_time;
+ const time_val_t start_time;
+ const byte_cnt_t read_bytes;
+ const byte_cnt_t written_bytes;
+ const byte_cnt_t messages_size_bytes;
+ const obj_cnt_t streams_count;
+ const obj_cnt_t topics_count;
+ const obj_cnt_t partitions_count;
+ const obj_cnt_t segments_count;
+ const msg_cnt_t messages_count;
+ const obj_cnt_t clients_count;
+ const obj_cnt_t consumer_groups_count;
+ const std::string& hostname;
+ const std::string& os_name;
+ const std::string& os_version;
+ const std::string& kernel_version;
+
+public:
+ Stats(pid_t process_id,
+ percent_t cpu_usage,
+ byte_cnt_t memory_usage,
+ byte_cnt_t total_memory,
+ byte_cnt_t available_memory,
+ time_val_t run_time,
+ time_val_t start_time,
+ byte_cnt_t read_bytes,
+ byte_cnt_t written_bytes,
+ byte_cnt_t messages_size_bytes,
+ obj_cnt_t streams_count,
+ obj_cnt_t topics_count,
+ obj_cnt_t partitions_count,
+ obj_cnt_t segments_count,
+ msg_cnt_t messages_count,
+ obj_cnt_t clients_count,
+ obj_cnt_t consumer_groups_count,
+ const std::string& hostname,
+ const std::string& os_name,
+ const std::string& os_version,
+ const std::string& kernel_version)
+ : process_id(process_id)
+ , cpu_usage(cpu_usage)
+ , memory_usage(memory_usage)
+ , total_memory(total_memory)
+ , available_memory(available_memory)
+ , run_time(run_time)
+ , start_time(start_time)
+ , read_bytes(read_bytes)
+ , written_bytes(written_bytes)
+ , messages_size_bytes(messages_size_bytes)
+ , streams_count(streams_count)
+ , topics_count(topics_count)
+ , partitions_count(partitions_count)
+ , segments_count(segments_count)
+ , messages_count(messages_count)
+ , clients_count(clients_count)
+ , consumer_groups_count(consumer_groups_count)
+ , hostname(hostname)
+ , os_name(os_name)
+ , os_version(os_version)
+ , kernel_version(kernel_version) {}
+
+ /// @brief Get the server process ID (PID)
+ pid_t getProcessId() const { return process_id; }
+
+ /// @brief Get the server process CPU usage.
+ percent_t getCpuUsage() const { return cpu_usage; }
+
+ /// @brief Get the server total memory usage.
+ byte_cnt_t getMemoryUsage() const { return memory_usage; }
+
+ /// @brief Get the server total memory.
+ byte_cnt_t getTotalMemory() const { return total_memory; }
+
+ /// @brief Get the server available memory.
+ byte_cnt_t getAvailableMemory() const { return available_memory; }
+
+ /// @brief Get how long the server has been running, in seconds.
+ time_val_t getRunTime() const { return run_time; }
+
+ /// @brief Get the server start time, in seconds since the UNIX epoch.
+ time_val_t getStartTime() const { return start_time; }
+
+ /// @brief Get the number of bytes read since process start.
+ byte_cnt_t getReadBytes() const { return read_bytes; }
+
+ /// @brief Get the number of bytes written since process start.
+ byte_cnt_t getWrittenBytes() const { return written_bytes; }
+
+ /// @brief Get the total size of all messages processed.
+ byte_cnt_t getMessagesSizeBytes() const { return messages_size_bytes; }
+
+ /// @brief Get the total number of streams in the server.
+ obj_cnt_t getStreamsCount() const { return streams_count; }
+
+ /// @brief Get the total number of topics on the server.
+ obj_cnt_t getTopicsCount() const { return topics_count; }
+
+ /// @brief Get the total number of topic partitions on the server across all topics.
+ obj_cnt_t getPartitionsCount() const { return partitions_count; }
+
+ /// @brief Get the total number of fixed-size segments used for topic storage on disk.
+ obj_cnt_t getSegmentsCount() const { return segments_count; }
+
+ /// @brief Get the total number of messages processed by the server across all topics.
+ msg_cnt_t getMessagesCount() const { return messages_count; }
+
+ /// @brief Get the total number of active connected clients.
+ obj_cnt_t getClientsCount() const { return clients_count; }
+
+ /// @brief Get the total number of active consumer groups on the server.
+ obj_cnt_t getConsumerGroupsCount() const { return consumer_groups_count; }
+
+ /// @brief Get the name of the host that the server process is running on.
+ const std::string& getHostname() const { return hostname; }
+
+ /// @brief Get the name of the operating system that the server process is running on.
+ const std::string& getOsName() const { return os_name; }
+
+ /// @brief Get the version of the operating system that the server process is running on.
+ const std::string& getOsVersion() const { return os_version; }
+
+ /// @brief Get the version of the OS kernel that the server process is running on.
+ const std::string& getKernelVersion() const { return kernel_version; }
+};
+
+} // namespace sys
+} // namespace model
+} // namespace icp
diff --git a/foreign/cpp/sdk/net/address.cc b/foreign/cpp/sdk/net/address.cc
new file mode 100644
index 00000000..20603619
--- /dev/null
+++ b/foreign/cpp/sdk/net/address.cc
@@ -0,0 +1,35 @@
+#include "address.h"
+
+const icp::net::protocol::ProtocolDefinition& icp::net::address::LogicalAddress::getProtocolDefinition() const {
+ return this->protocolProvider->getProtocolDefinition(this->getProtocol());
+}
+
+icp::net::address::LogicalAddress::LogicalAddress(const std::string& url, const icp::net::protocol::ProtocolProvider* protocolProvider) {
+ auto parse_result = ada::parse<ada::url>(url);
+ if (!parse_result) {
+ throw std::invalid_argument("Invalid URL: " + url);
+ }
+ auto value = parse_result.value();
+ auto protocol = value.get_protocol();
+ protocol = protocol.substr(0, protocol.length() - 1);
+ if (!protocolProvider->isSupported(protocol)) {
+ throw std::invalid_argument("Unsupported protocol: " + protocol);
+ }
+ this->url = value;
+ this->protocolProvider = protocolProvider;
+}
+
+const uint16_t icp::net::address::LogicalAddress::getPort() const {
+ if (url.get_port().empty()) {
+ return this->getProtocolDefinition().getDefaultPort();
+ } else {
+ int port = std::stoi(url.get_port());
+
+ // this should not happen if ada::parse is working correctly
+ if (port < 0 || port > 65535) {
+ throw std::out_of_range("Port number out of range");
+ }
+
+ return port;
+ }
+}
diff --git a/foreign/cpp/sdk/net/address.h b/foreign/cpp/sdk/net/address.h
new file mode 100644
index 00000000..19fc098f
--- /dev/null
+++ b/foreign/cpp/sdk/net/address.h
@@ -0,0 +1,51 @@
+#pragma once
+
+#include <ada.h>
+#include <vector>
+#include "protocol.h"
+#include "transport.h"
+
+namespace icp {
+namespace net {
+namespace address {
+
+/***
+ * @brief Logical address used in configuration and API to specify desired transport in a compact way, e.g. iggy:quic://localhost:8080.
+ */
+class LogicalAddress {
+private:
+ ada::url url;
+ const icp::net::protocol::ProtocolProvider* protocolProvider;
+
+ const icp::net::protocol::ProtocolDefinition& getProtocolDefinition() const;
+
+public:
+ /**
+ * @brief Construct a logical address from a URL.
+ * @param url URL to parse.
+ * @param protocolProvider Context object providing supported protocols and default ports.
+ * @throws std::invalid_argument if the URL is invalid or the protocol is unknown.
+ */
+ LogicalAddress(const std::string& url, const icp::net::protocol::ProtocolProvider* protocolProvider);
+
+ /**
+ * @brief Gets the protocol; you have a guarantee that it will be one of the supported protocols from ProtocolProvider.
+ */
+ const std::string getProtocol() const noexcept {
+ auto protocol = url.get_protocol();
+ return protocol.substr(0, protocol.length() - 1);
+ }
+
+ /**
+ * @brief Gets the hostname to connect to or raw IP address.
+ */
+ const std::string getHost() const noexcept { return url.get_hostname(); }
+
+ /**
+ * @brief Gets the port to connect to; protocol default port will be substituted if not specified.
+ */
+ const uint16_t getPort() const;
+};
+}; // namespace address
+}; // namespace net
+}; // namespace icp
diff --git a/foreign/cpp/sdk/net/conn.cc b/foreign/cpp/sdk/net/conn.cc
new file mode 100644
index 00000000..69ac8dbf
--- /dev/null
+++ b/foreign/cpp/sdk/net/conn.cc
@@ -0,0 +1,5 @@
+#include "conn.h"
+
+icp::net::internal::lws::Logger::Logger() {
+ this->context.lll_flags = LLLF_LOG_CONTEXT_AWARE | LLL_ERR | LLL_WARN | LLL_NOTICE | LLL_USER;
+}
diff --git a/foreign/cpp/sdk/net/conn.h b/foreign/cpp/sdk/net/conn.h
new file mode 100644
index 00000000..716e0283
--- /dev/null
+++ b/foreign/cpp/sdk/net/conn.h
@@ -0,0 +1,51 @@
+#pragma once
+
+#include <libwebsockets.h>
+
+namespace icp {
+namespace net {
+
+class Connection;
+
+namespace internal {
+
+namespace lws {
+
+class Context {
+private:
+ lws_context_creation_info info;
+ lws_context* context;
+
+ friend class icp::net::Connection;
+
+public:
+ Context() = default;
+};
+
+class Logger {
+private:
+ lws_log_cx_t context;
+
+public:
+ Logger();
+};
+
+}; // namespace lws
+
+}; // namespace internal
+
+/**
+ * @brief Base class for all network connections.
+ *
+ * Shared base for HTTP, raw TCP and QUIC connections. It relies on the @ref icp::net::ssl
+ * for low-level set up of cryptography and SSL/TLS context, currently built on top
+ * of wolfSSL, and LWS for all low-level networking protocol support.
+ *
+ */
+class Connection {
+private:
+ icp::net::internal::lws::Context context;
+};
+
+}; // namespace net
+}; // namespace icp
diff --git a/foreign/cpp/sdk/net/http/conn.cc b/foreign/cpp/sdk/net/http/conn.cc
new file mode 100644
index 00000000..2a553706
--- /dev/null
+++ b/foreign/cpp/sdk/net/http/conn.cc
@@ -0,0 +1 @@
+#include "conn.h"
diff --git a/foreign/cpp/sdk/net/http/conn.h b/foreign/cpp/sdk/net/http/conn.h
new file mode 100644
index 00000000..6f70f09b
--- /dev/null
+++ b/foreign/cpp/sdk/net/http/conn.h
@@ -0,0 +1 @@
+#pragma once
diff --git a/foreign/cpp/sdk/net/iggy.cc b/foreign/cpp/sdk/net/iggy.cc
new file mode 100644
index 00000000..91e983d9
--- /dev/null
+++ b/foreign/cpp/sdk/net/iggy.cc
@@ -0,0 +1,25 @@
+#include "iggy.h"
+
+icp::net::IggyProtocolProvider::IggyProtocolProvider() {
+ for (const auto& protocol : this->supportedProtocols) {
+ this->supportedProtocolLookup[protocol.getName()] = protocol;
+ }
+}
+
+const std::vector<icp::net::protocol::ProtocolDefinition>& icp::net::IggyProtocolProvider::getSupportedProtocols() const {
+ return this->supportedProtocols;
+}
+
+const icp::net::protocol::ProtocolDefinition& icp::net::IggyProtocolProvider::getProtocolDefinition(const std::string& protocol) const {
+ auto normalizedName = icp::net::protocol::normalizeProtocolName(protocol);
+ auto it = this->supportedProtocolLookup.find(normalizedName);
+ if (it != this->supportedProtocolLookup.end()) {
+ return it->second;
+ } else {
+ throw std::invalid_argument("Unsupported protocol: " + protocol);
+ }
+}
+
+const bool icp::net::IggyProtocolProvider::isSupported(const std::string& protocol) const {
+ return this->supportedProtocolLookup.count(icp::net::protocol::normalizeProtocolName(protocol)) > 0;
+}
diff --git a/foreign/cpp/sdk/net/iggy.h b/foreign/cpp/sdk/net/iggy.h
new file mode 100644
index 00000000..f94bef8e
--- /dev/null
+++ b/foreign/cpp/sdk/net/iggy.h
@@ -0,0 +1,45 @@
+#pragma once
+#include <map>
+#include <vector>
+#include "address.h"
+
+namespace icp {
+namespace net {
+
+const uint16_t DEFAULT_HTTP_PORT = 3000;
+const uint16_t DEFAULT_TCP_PORT = 8090;
+const uint16_t DEFAULT_QUIC_PORT = 8080;
+
+const char QUIC_PROTOCOL[] = "quic";
+const char TCP_PROTOCOL[] = "tcp";
+const char TCP_TLS_PROTOCOL[] = "tcp+tls";
+const char HTTP_PROTOCOL[] = "http";
+const char HTTP_TLS_PROTOCOL[] = "http+tls";
+
+using icp::net::protocol::MessageEncoding;
+using icp::net::protocol::ProtocolDefinition;
+
+/**
+ * @brief Provider that declares support and offers defaults for all Iggy C++ supported protocols.
+ *
+ * At this time we support iggy:quic, iggy:tcp (binary messaging) and iggy:http (with JSON messaging).
+ */
+class IggyProtocolProvider : public icp::net::protocol::ProtocolProvider {
+private:
+ std::vector<ProtocolDefinition> supportedProtocols = {
+ ProtocolDefinition(QUIC_PROTOCOL, DEFAULT_QUIC_PORT, icp::net::transport::QUIC, true, MessageEncoding::BINARY),
+ ProtocolDefinition(TCP_PROTOCOL, DEFAULT_TCP_PORT, icp::net::transport::TCP, false, MessageEncoding::BINARY),
+ ProtocolDefinition(TCP_TLS_PROTOCOL, DEFAULT_TCP_PORT, icp::net::transport::TCP, true, MessageEncoding::BINARY),
+ ProtocolDefinition(HTTP_PROTOCOL, DEFAULT_HTTP_PORT, icp::net::transport::HTTP, false, MessageEncoding::TEXT),
+ ProtocolDefinition(HTTP_TLS_PROTOCOL, DEFAULT_HTTP_PORT, icp::net::transport::HTTP, true, MessageEncoding::TEXT)};
+ std::map<std::string, ProtocolDefinition> supportedProtocolLookup;
+
+public:
+ IggyProtocolProvider();
+ const std::vector<ProtocolDefinition>& getSupportedProtocols() const override;
+ const ProtocolDefinition& getProtocolDefinition(const std::string& protocol) const override;
+ const bool isSupported(const std::string& protocol) const override;
+};
+
+}; // namespace net
+}; // namespace icp
diff --git a/foreign/cpp/sdk/net/protocol.cc b/foreign/cpp/sdk/net/protocol.cc
new file mode 100644
index 00000000..26fa862b
--- /dev/null
+++ b/foreign/cpp/sdk/net/protocol.cc
@@ -0,0 +1,24 @@
+#include "protocol.h"
+#include "address.h"
+
+icp::net::address::LogicalAddress icp::net::protocol::ProtocolProvider::createAddress(const std::string& url) const {
+ return icp::net::address::LogicalAddress(url, this);
+}
+
+const std::string icp::net::protocol::normalizeProtocolName(const std::string& protocol) {
+ // convert to lowercase
+ std::string lowerStr = protocol;
+ std::transform(lowerStr.begin(), lowerStr.end(), lowerStr.begin(), ::tolower);
+
+ // trim whitespace from the start
+ auto start = lowerStr.find_first_not_of(" \t\n\r\f\v");
+ if (start == std::string::npos) {
+ throw std::invalid_argument("Protocol name cannot be empty");
+ }
+
+ // trim whitespace from the end
+ auto end = lowerStr.find_last_not_of(" \t\n\r\f\v");
+
+ // return the trimmed, lowercase string
+ return lowerStr.substr(start, end - start + 1);
+}
diff --git a/foreign/cpp/sdk/net/protocol.h b/foreign/cpp/sdk/net/protocol.h
new file mode 100644
index 00000000..641a0dcf
--- /dev/null
+++ b/foreign/cpp/sdk/net/protocol.h
@@ -0,0 +1,110 @@
+#pragma once
+
+#include <string>
+#include <vector>
+#include "transport.h"
+
+namespace icp {
+namespace net {
+namespace address {
+class LogicalAddress;
+};
+
+namespace protocol {
+
+/**
+ * @brief Enumerates the supported message encodings.
+ */
+enum MessageEncoding { BINARY = 0, TEXT = 1 };
+
+/**
+ * @brief Normalizes the protocol name to a canonical form.
+ */
+const std::string normalizeProtocolName(const std::string& protocol);
+
+/**
+ * @brief Metadata about a protocol including its default port, transport, TLS support and message encoding.
+ */
+class ProtocolDefinition {
+private:
+ std::string name;
+ uint16_t defaultPort;
+ icp::net::transport::Transport transport;
+ bool tlsSupported;
+ MessageEncoding messageEncoding;
+
+public:
+ ProtocolDefinition(const std::string& name,
+ uint16_t defaultPort,
+ icp::net::transport::Transport transport,
+ bool tlsSupported,
+ MessageEncoding messageEncoding)
+ : name(icp::net::protocol::normalizeProtocolName(name))
+ , defaultPort(defaultPort)
+ , transport(transport)
+ , tlsSupported(tlsSupported)
+ , messageEncoding(messageEncoding) {}
+
+ ProtocolDefinition() = default;
+ ProtocolDefinition(const ProtocolDefinition& other) = default;
+
+ /**
+ * @brief Get the protocol name, e.g. iggy:tcp+tls.
+ */
+ const std::string& getName() const { return name; }
+
+ /**
+ * @brief Gets the default port for the protocol, e.g. 443 for https.
+ */
+ uint16_t getDefaultPort() const { return defaultPort; }
+
+ /**
+ * @brief Gets the transport for the protocol, e.g. icp::net::transport::Transport::TCP.
+ */
+ icp::net::transport::Transport getTransport() const { return transport; }
+
+ /**
+ * @brief Tests whether the protocol supports TLS; insecure and TLS protocols should be separate.
+ */
+ bool isTlsSupported() const { return tlsSupported; }
+
+ /**
+ * @brief Gets the default message encoding used by the protocol, e.g. MessageEncoding::TEXT for JSON.
+ */
+ MessageEncoding getMessageEncoding() const { return messageEncoding; }
+};
+
+/**
+ * @brief Interface to plug in library-specific information on supported protocols.
+ */
+class ProtocolProvider {
+public:
+ ProtocolProvider() = default;
+ virtual ~ProtocolProvider() = default;
+
+ /**
+ * @brief Factory method to create a logical address from a URL.
+ * @param url The URL to parse in the context of this provider and its defaults.
+ */
+ icp::net::address::LogicalAddress createAddress(const std::string& url) const;
+
+ /**
+ * @brief Enumerates all the supported protocols in the provider.
+ */
+ virtual const std::vector<ProtocolDefinition>& getSupportedProtocols() const = 0;
+
+ /**
+ * @brief Given a normalized protocol name returns the definition with protocol metadata.
+ */
+ virtual const ProtocolDefinition& getProtocolDefinition(const std::string& protocol) const = 0;
+
+ /**
+ * @brief Tests whether the given protocol is supported by this provider.
+ * @param protocol The protocol name to test.
+ */
+ virtual const bool isSupported(const std::string& protocol) const = 0;
+};
+
+}; // namespace protocol
+}; // namespace net
+}; // namespace icp
diff --git a/foreign/cpp/sdk/net/quic/address.h b/foreign/cpp/sdk/net/quic/address.h
new file mode 100644
index 00000000..6f70f09b
--- /dev/null
+++ b/foreign/cpp/sdk/net/quic/address.h
@@ -0,0 +1 @@
+#pragma once
diff --git a/foreign/cpp/sdk/net/quic/conn.h b/foreign/cpp/sdk/net/quic/conn.h
new file mode 100644
index 00000000..6f70f09b
--- /dev/null
+++ b/foreign/cpp/sdk/net/quic/conn.h
@@ -0,0 +1 @@
+#pragma once
diff --git a/foreign/cpp/sdk/net/quic/stream.h b/foreign/cpp/sdk/net/quic/stream.h
new file mode 100644
index 00000000..6f70f09b
--- /dev/null
+++ b/foreign/cpp/sdk/net/quic/stream.h
@@ -0,0 +1 @@
+#pragma once
diff --git a/foreign/cpp/sdk/net/ssl/crypto.cc b/foreign/cpp/sdk/net/ssl/crypto.cc
new file mode 100644
index 00000000..c1950dd7
--- /dev/null
+++ b/foreign/cpp/sdk/net/ssl/crypto.cc
@@ -0,0 +1,72 @@
+#include "crypto.h"
+#include <fstream>
+#include "fmt/format.h"
+#include "spdlog/spdlog.h"
+#include "ssl_engine.h"
+
+icp::crypto::LocalCertificateStore::LocalCertificateStore(const std::optional<std::filesystem::path> certDir) {
+ auto certDirAbs = std::filesystem::absolute(certDir.value_or(std::filesystem::current_path())).make_preferred();
+ spdlog::debug("Loading certificates from {}", certDirAbs.string());
+ if (!std::filesystem::exists(certDirAbs)) {
+ throw std::invalid_argument(fmt::format("certificate directory does not exist: {}", certDirAbs.string()));
+ } else if (!std::filesystem::is_directory(certDirAbs)) {
+ throw std::invalid_argument(fmt::format("certificate directory is not a valid directory: {}", certDirAbs.string()));
+ }
+ this->certDir = certDirAbs;
+}
+
+const std::vector<uint8_t> icp::crypto::LocalCertificateStore::getCertificate(const std::string& certPath) const {
+ std::filesystem::path certFile = (this->certDir.value() / certPath).make_preferred();
+ spdlog::debug("Loading certificate from {}", certFile.string());
+ if (!std::filesystem::exists(certFile)) {
+ throw std::invalid_argument(fmt::format("certificate file does not exist: {}", certFile.string()));
+ }
+ std::ifstream certStream(certFile, std::ios::binary);
+ if (!certStream.is_open()) {
+ throw std::runtime_error(fmt::format("Failed to open certificate file: {}", certFile.string()));
+ }
+ std::vector<uint8_t> certData((std::istreambuf_iterator<char>(certStream)), std::istreambuf_iterator<char>());
+ if (certData.empty()) {
+ throw std::runtime_error(fmt::format("Invalid certificate file (empty): {}", certFile.string()));
+ }
+ return certData;
+}
+
+icp::crypto::LocalKeyStore::LocalKeyStore(const std::optional<std::filesystem::path> keyDir) {
+ auto keyDirAbs = std::filesystem::absolute(keyDir.value_or(std::filesystem::current_path())).make_preferred();
+ spdlog::debug("Loading private keys from {}", keyDirAbs.string());
+ if (!std::filesystem::exists(keyDirAbs)) {
+ throw std::invalid_argument(fmt::format("key directory does not exist: {}", keyDirAbs.string()));
+ }
+ if (!std::filesystem::is_directory(keyDirAbs)) {
+ throw std::invalid_argument(fmt::format("key directory is not a valid directory: {}", keyDirAbs.string()));
+ }
+ this->privateKeyDir = keyDirAbs;
+}
+
+const std::vector<uint8_t> icp::crypto::LocalKeyStore::getPrivateKey(const std::string& keyPath) const {
+ std::filesystem::path keyFile = (this->privateKeyDir.value() / keyPath).make_preferred();
+ spdlog::debug("Loading private key from {}", keyFile.string());
+ if (!std::filesystem::exists(keyFile)) {
+ throw std::invalid_argument(fmt::format("private key file does not exist: {}", keyFile.string()));
+ }
+ std::ifstream keyStream(keyFile, std::ios::binary);
+ if (!keyStream.is_open()) {
+ throw std::runtime_error(fmt::format("Failed to open private key file: {}", keyFile.string()));
+ }
+ std::vector<uint8_t> keyData((std::istreambuf_iterator<char>(keyStream)), std::istreambuf_iterator<char>());
+ if (keyData.empty()) {
+ throw std::runtime_error(fmt::format("Invalid private key file (empty): {}", keyFile.string()));
+ }
+ return keyData;
+}
+
+template <>
+void icp::crypto::CRL<WOLFSSL_CTX*>::configure(WOLFSSL_CTX* handle, const icp::crypto::PKIEnvironment<WOLFSSL_CTX*>& pkiEnv) {}
+
+template <>
+void icp::crypto::OCSP<WOLFSSL_CTX*>::configure(WOLFSSL_CTX* handle, const icp::crypto::PKIEnvironment<WOLFSSL_CTX*>& pkiEnv) {}
+
+template <>
+void icp::crypto::CertificateAuthority<WOLFSSL_CTX*>::configure(WOLFSSL_CTX* handle,
+ const icp::crypto::PKIEnvironment<WOLFSSL_CTX*>& pkiEnv) {}
diff --git a/foreign/cpp/sdk/net/ssl/crypto.h b/foreign/cpp/sdk/net/ssl/crypto.h
new file mode 100644
index 00000000..eb3c0be1
--- /dev/null
+++ b/foreign/cpp/sdk/net/ssl/crypto.h
@@ -0,0 +1,312 @@
+#pragma once
+
+#include <wolfssl/options.h>
+#include <wolfssl/ssl.h>
+#include <filesystem>
+#include <optional>
+#include <string>
+#include <vector>
+#include "ada.h"
+
+namespace icp {
+namespace crypto {
+
+/**
+ * @brief Encoding format used for certificates and keys.
+ */
+enum CertificateFormat { PEM = 1, ASN1 = 2 };
+
+/**
+ * @brief A mechanism for loading public key certificates: from file; database;
+ * or a secret vault.
+ */
+class CertificateStore {
+public:
+ CertificateStore() = default;
+ virtual ~CertificateStore() = default;
+
+ /**
+ * @brief Retrieves a certificate from the store.
+ * @param certPath A slash-delimited abstract path to the certificate file;
+ * this may be translated according to the backend storage to a
+ * filesystem-specific path or some other convention.
+ * @return A vector of bytes representing the certificate in PEM or ASN.1.
+ */
+ virtual const std::vector<uint8_t> getCertificate(const std::string& certPath) const = 0;
+};
+
+/**
+ * @brief A certificate store that loads certificates from the local filesystem.
+ */
+class LocalCertificateStore : public CertificateStore {
+private:
+ std::optional<std::filesystem::path> certDir;
+
+public:
+ explicit LocalCertificateStore(const std::optional<std::filesystem::path> certDir = std::nullopt);
+ ~LocalCertificateStore() = default;
+
+ /**
+ * @brief Gets the default instance, which loads from the current working directory.
+ */
+ static LocalCertificateStore& getDefault() {
+ static LocalCertificateStore instance;
+ return instance;
+ }
+
+ /**
+ * Retrieves the certificate from the filesystem, translating the abstract
+ * path to a filesystem-appropriate absolute path.
+ */
+ const std::vector<uint8_t> getCertificate(const std::string& certPath) const override;
+};
+
+/**
+ * @brief A mechanism for loading private keys: from file; database; or a secret
+ * vault.
+ */
+class KeyStore {
+public:
+ KeyStore() = default;
+ virtual ~KeyStore() = default;
+
+ /**
+ * @brief Retrieves the private key data from the store.
+ * @param keyPath A slash-delimited abstract path to the key file;
+ * this may be translated according to the backend storage to a
+ * filesystem-specific path or some other convention.
+ * @return A vector of bytes representing the key in PEM or ASN.1.
+ */
+ virtual const std::vector<uint8_t> getPrivateKey(const std::string& keyPath) const = 0;
+};
+
+/**
+ * @brief A key store that loads private key materials from the local
+ * filesystem.
+ */
+class LocalKeyStore : public KeyStore {
+private:
+ std::optional<std::filesystem::path> privateKeyDir;
+
+public:
+ explicit LocalKeyStore(const std::optional<std::filesystem::path> privateKeyDir = std::nullopt);
+ ~LocalKeyStore() = default;
+
+ /**
+ * @brief Gets the default instance, which loads from the current working directory.
+ */
+ static LocalKeyStore& getDefault() {
+ static LocalKeyStore instance;
+ return instance;
+ }
+
+ /**
+ * Retrieves the private key materials from the filesystem, translating the abstract
+ * path to a filesystem-appropriate absolute path.
+ */
+ const std::vector<uint8_t> getPrivateKey(const std::string& keyPath) const override;
+};
+
+// forward declaration
+template <typename HandleType>
+class PKIEnvironment;
+
+/**
+ * Base type for objects that can be configured with library-specific calls. You will need
+ * a specialization for each library supported, e.g. wolfSSL, OpenSSL/BoringSSL, mbedTLS, etc.,
+ * which makes that library C API calls for handling the particular object's settings.
+ */
+template <typename HandleType>
+class Configurable {
+ /**
+ * Crypto library-specific implementation to configure the revocation method, usually with C API.
+ */
+ virtual void configure(HandleType handle, const PKIEnvironment<HandleType>& pkiEnv) = 0;
+};
+
+/**
+ * @brief A mechanism for revoking certificates: through CRL or OCSP.
+ */
+template <typename HandleType>
+class RevocationMethod : Configurable<HandleType> {
+public:
+ RevocationMethod() = default;
+ virtual ~RevocationMethod() = default;
+};
+
+/**
+ * @brief Certificate revocation list (CRL)-based revocation method. If there are no CRL paths or URLs
+ * specified, the CRL is assumed to be embedded in the CA certificate.
+ */
+template <typename HandleType>
+class CRL : public RevocationMethod<HandleType> {
+private:
+ std::optional<std::filesystem::path> crlPath;
+ std::optional<ada::url> crlUrl;
+
+public:
+ explicit CRL(std::optional<std::filesystem::path> crlPath = std::nullopt, std::optional<ada::url> crlUrl = std::nullopt)
+ : crlPath(crlPath)
+ , crlUrl(crlUrl) {}
+
+ /**
+ * @brief If specified (default: not), the filesystem path to the CRL file.
+ */
+ const std::optional<std::filesystem::path> getCrlPath() const { return this->crlPath; }
+
+ /**
+ * @brief If specified (default: not), an HTTP URL from which to load the CRL.
+ */
+ const std::optional<ada::url> getCrlUrl() const { return this->crlUrl; }
+
+ /**
+ * Installs all CRL settings supported in the library into the given handle.
+ */
+ void configure(HandleType handle, const PKIEnvironment<HandleType>& pkiEnv) override;
+};
+
+/**
+ * @brief Online Certificate Status Protocol (OCSP)-based revocation method. If there is no override
+ * OCSP URL specified, the OCSP URL is assumed to be embedded in the CA certificate.
+ */
+template <typename HandleType>
+class OCSP : public RevocationMethod<HandleType> {
+private:
+ const std::optional<ada::url> ocspOverrideUrl;
+ const bool staplingEnabled;
+
+public:
+ explicit OCSP(const std::optional<ada::url> ocspOverrideUrl = std::nullopt, const bool staplingEnabled = true)
+ : ocspOverrideUrl(ocspOverrideUrl)
+ , staplingEnabled(staplingEnabled) {}
+
+ /**
+ * @brief If specified (default: not), an HTTP URL used to check the status of certificates.
+ */
+ const std::optional<ada::url> getOcspOverrideUrl() const { return this->ocspOverrideUrl; }
+
+ /**
+ * @brief If enabled, servers will cache OCSP verification checks to improve performance.
+ */
+ const bool isStaplingEnabled() const { return this->staplingEnabled; }
+
+ /**
+ * Installs all OCSP settings supported in the library into the given handle.
+ */
+ void configure(HandleType handle, const PKIEnvironment<HandleType>& pkiEnv) override;
+};
+
+/**
+ * @brief Authority for verifying certificates -- either through checking against a centralized CA, or via a trusted peer relationship. If
+ * all defaults are taken, the system CA paths will be used, with revocation checking enabled via OCSP.
+ */
+template <typename HandleType>
+class CertificateAuthority : public Configurable<HandleType> {
+private:
+ const std::optional<std::string> overrideCaCertificatePath;
+ std::vector<std::string> trustedPeerCertificatePaths = std::vector<std::string>();
+ const RevocationMethod<HandleType>* revocationMethod;
+
+public:
+ explicit CertificateAuthority(std::optional<std::string> overrideCaCertificatePath = std::nullopt,
+ RevocationMethod<HandleType>* revocationMethod = new OCSP<HandleType>())
+ : overrideCaCertificatePath(overrideCaCertificatePath)
+ , revocationMethod(revocationMethod) {}
+
+ /**
+ * @brief Gets the default instance, which uses the system CA store and OCSP.
+ */
+ static CertificateAuthority& getDefault() {
+ static CertificateAuthority instance;
+ return instance;
+ }
+
+ /**
+ * @brief If specified (default: not), the filesystem path to the CA certificate path file.
+ */
+ const std::optional<std::string> getOverrideCaCertificatePath() const { return this->overrideCaCertificatePath; }
+
+ /**
+ * @brief Gets all specified trusted peer certificate paths, if any.
+ */
+ const std::vector<std::string> getTrustedPeerCertificatePaths() const { return this->trustedPeerCertificatePaths; }
+
+ /**
+ * @brief Adds a trusted peer certificate path; optional -- if none, only CA-verified certificates will be trusted.
+ */
+ void addTrustedPeerCertificate(const std::string& certPath) { this->trustedPeerCertificatePaths.push_back(certPath); }
+
+ /**
+ * @brief Gets the revocation method to use for verifying certificates: CRL or OCSP.
+ */
+ RevocationMethod<HandleType>* getRevocationMethod() const { return this->revocationMethod; }
+
+ /**
+ * Installs all CA settings supported in the library into the given handle.
+ */
+ void configure(HandleType handle, const PKIEnvironment<HandleType>& pkiEnv) override;
+};
+
+/**
+ * @brief All options related to the environment library is in -- where to load CA, certificates and keys.
+ *
+ * Mutable configuration object containing our hooks to load CA certificates, peer & trusted certificates, and keys. It offers reasonable
+ * defaults if you are loading from PEM files on the filesystem and are OK using the operating system default CA store with OCSP.
+ */
+template <typename HandleType>
+class PKIEnvironment : Configurable<HandleType> {
+private:
+ CertificateAuthority<HandleType>& certAuth;
+ CertificateStore& certStore;
+ KeyStore& keyStore;
+
+public:
+ PKIEnvironment(CertificateAuthority<HandleType>& certAuth = CertificateAuthority<HandleType>::getDefault(),
+ CertificateStore& certStore = LocalCertificateStore::getDefault(),
+ KeyStore& keyStore = LocalKeyStore::getDefault())
+ : certAuth(certAuth)
+ , certStore(certStore)
+ , keyStore(keyStore) {}
+
+ /**
+ * @brief Gets the certificate authority to use for verifying peer certificates; defaults to local system CA store.
+ */
+ const CertificateAuthority<HandleType>& getCertificateAuthority() const { return this->certAuth; }
+
+ /**
+ * @brief Sets an alternative certificate authority to use for verifying peer certificates, e.g. if you use a custom CA service,
+ * API-based secret store like Vault or 1Password, or a custom database.
+ */
+ void setCertificateAuthority(const CertificateAuthority<HandleType>& certAuth) { this->certAuth = certAuth; }
+
+ /**
+ * @brief Gets the certificate store to use for loading this peer's own certificate and any trusted peer certificates; defaults to a
+ * local filesystem store.
+ */
+ const CertificateStore& getCertificateStore() const { return this->certStore; }
+
+ /**
+ * @brief Sets an alternative certificate store to use for loading this peer's own certificate and any trusted peer certificates, e.g.
+ * if you use a database.
+ */
+ void setCertificateStore(const CertificateStore& certStore) { this->certStore = certStore; }
+
+ /**
+ * @brief Gets the certificate store to use for loading private key materials; defaults to a local filesystem store.
+ */
+ const KeyStore& getKeyStore() const { return this->keyStore; }
+
+ /**
+ * @brief Sets an alternative key store to use for loading private key materials, e.g. if you use an API-based secret store like Vault
+ * or 1Password, cloud HSM-based vault, or a custom database.
+ */
+ void setKeyStore(const KeyStore& keyStore) { this->keyStore = keyStore; }
+
+ /**
+ * @brief Installs all PKI settings supported in the library into the given handle, walking the tree of objects.
+ */
+ void configure(HandleType handle, const PKIEnvironment<HandleType>& pkiEnv) override { this->certAuth.configure(handle, pkiEnv); }
+};
+
+}; // namespace crypto
+}; // namespace icp
diff --git a/foreign/cpp/sdk/net/ssl/ssl.cc b/foreign/cpp/sdk/net/ssl/ssl.cc
new file mode 100644
index 00000000..c3244235
--- /dev/null
+++ b/foreign/cpp/sdk/net/ssl/ssl.cc
@@ -0,0 +1,196 @@
+#include "ssl.h"
+#include <numeric>
+#include "fmt/format.h"
+
+std::string icp::ssl::getProtocolVersionName(icp::ssl::ProtocolVersion protocolVersion) {
+ switch (protocolVersion) {
+ case icp::ssl::ProtocolVersion::TLSV1_3:
+ return "TLSV1_3";
+ case icp::ssl::ProtocolVersion::TLSV1_2:
+ return "TLSV1_2";
+ default:
+ int protocolVersionInt = static_cast<int>(protocolVersion);
+ throw std::runtime_error(fmt::format("Unsupported protocol version code: {}", protocolVersionInt));
+ }
+}
+
+template <>
+const std::vector<std::string> icp::ssl::SSLOptions<WOLFSSL_CTX*>::getDefaultCipherList(icp::ssl::ProtocolVersion protocolVersion) {
+ auto ciphers = std::vector<std::string>();
+
+ // References:
+ // - https://cheatsheetseries.owasp.org/cheatsheets/Transport_Layer_Security_Cheat_Sheet.html
+ // - https://ssl-config.mozilla.org
+
+ if (protocolVersion == icp::ssl::ProtocolVersion::TLSV1_3) {
+// sanity check to make sure TLS 1.3 is compiled in
+#ifdef WOLFSSL_NO_TLS13
+ throw std::runtime_error("TLS 1.3 is not supported by this build of WolfSSL");
+#else
+ // recommended TLS 1.3 ciphers
+#if defined(HAVE_AESGCM) && !defined(NO_AES)
+ ciphers.push_back("TLS_AES_128_GCM_SHA256");
+#if defined(WOLFSSL_SHA384)
+ ciphers.push_back("TLS_AES_256_GCM_SHA384");
+#endif // WOLFSSL_SHA384
+#endif // HAVE_AESGCM && !NO_AES
+#if defined(HAVE_CHACHA) && defined(HAVE_POLY1305)
+ ciphers.push_back("TLS_CHACHA20_POLY1305_SHA256");
+#endif // HAVE_CHACHA && HAVE_POLY1305
+#endif // WOLFSSL_NO_TLS13
+ } else if (protocolVersion == icp::ssl::ProtocolVersion::TLSV1_2) {
+#ifdef WOLFSSL_NO_TLS12
+ throw std::runtime_error("TLS 1.2 is not supported by this build of WolfSSL");
+#else
+#if !defined(HAVE_ECC) || !defined(HAVE_SUPPORTED_CURVES)
+ throw std::runtime_error("ECC + Supported Curves must be enabled to support ECDHE");
+#endif // HAVE_ECC && HAVE_SUPPORTED_CURVES
+
+ // recommended TLS 1.2 ciphers
+#if defined(HAVE_AESGCM) && !defined(NO_AES)
+ ciphers.push_back("TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256");
+#ifndef NO_RSA
+ ciphers.push_back("TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256");
+#endif // NO_RSA
+#if defined(WOLFSSL_SHA384)
+ ciphers.push_back("TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384");
+#endif // WOLFSSL_SHA384
+#ifndef NO_RSA
+ ciphers.push_back("TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384");
+#endif // NO_RSA
+#endif // HAVE_AESGCM && !NO_AES
+#if defined(HAVE_CHACHA) && defined(HAVE_POLY1305)
+ ciphers.push_back("TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305");
+#ifndef NO_RSA
+ ciphers.push_back("TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305");
+#endif // NO_RSA
+#endif // HAVE_CHACHA && HAVE_POLY1305
+#endif // WOLFSSL_NO_TLS12
+ } else {
+ auto protocolVersionName = icp::ssl::getProtocolVersionName(protocolVersion);
+ throw std::runtime_error(fmt::format("Unsupported protocol version: {}", protocolVersionName));
+ }
+
+ if (ciphers.empty()) {
+ auto protocolVersionName = icp::ssl::getProtocolVersionName(protocolVersion);
+ throw std::runtime_error(fmt::format("No ciphers available for the specified protocol version: {}", protocolVersionName));
+ }
+ return ciphers;
+}
+
+template <>
+void icp::ssl::SSLOptions<WOLFSSL_CTX*>::configure(WOLFSSL_CTX* handle, const icp::crypto::PKIEnvironment<WOLFSSL_CTX*>& pkiEnv) {
+ // TODO
+}
+
+template <>
+void icp::ssl::SSLContext<WOLFSSL_CTX*>::raiseSSLError(const std::string& message) const {
+ char* errMsg = wolfSSL_ERR_error_string(wolfSSL_ERR_get_error(), nullptr);
+ throw std::runtime_error(fmt::format("{}: {}", message, errMsg));
+}
+
+template <>
+icp::ssl::SSLContext<WOLFSSL_CTX*>::SSLContext(const SSLOptions<WOLFSSL_CTX*>& options,
+ const icp::crypto::PKIEnvironment<WOLFSSL_CTX*>& pkiEnv)
+ : options(options)
+ , pkiEnv(pkiEnv) {
+ // before we make any other wolfSSL calls, make sure library is initialized once and only once
+ std::call_once(sslInitDone, []() { wolfSSL_Init(); });
+
+ auto protocolVersion = options.getMinimumSupportedProtocolVersion();
+ if (protocolVersion == icp::ssl::ProtocolVersion::TLSV1_2) {
+ this->ctx = wolfSSL_CTX_new(wolfTLSv1_2_client_method());
+ if (!this->ctx) {
+ raiseSSLError("Failed to allocate WolfSSL context");
+ }
+ wolfSSL_CTX_set_min_proto_version(this->ctx, TLS1_2_VERSION);
+ } else if (protocolVersion == icp::ssl::ProtocolVersion::TLSV1_3) {
+ this->ctx = wolfSSL_CTX_new(wolfTLSv1_3_client_method());
+ if (!this->ctx) {
+ raiseSSLError("Failed to allocate WolfSSL context");
+ }
+ wolfSSL_CTX_set_min_proto_version(this->ctx, TLS1_3_VERSION);
+ } else {
+ auto protocolVersionName = icp::ssl::getProtocolVersionName(protocolVersion);
+ throw std::runtime_error(fmt::format("Unsupported protocol version: {}", protocolVersionName));
+ }
+ this->cm = wolfSSL_CTX_GetCertManager(ctx);
+
+ // set up the supported ciphers
+ std::string delimiter = ":";
+ std::string joinedCiphers;
+
+ auto supportedCiphers = options.getCiphers();
+ if (!supportedCiphers.empty()) {
+ joinedCiphers = std::accumulate(std::next(supportedCiphers.begin()), supportedCiphers.end(), supportedCiphers[0],
+ [delimiter](const std::string& a, const std::string& b) { return a + delimiter + b; });
+ }
+ int ret = wolfSSL_CTX_set_cipher_list(this->ctx, joinedCiphers.c_str());
+ if (ret != SSL_SUCCESS) {
+ char* errMsg = wolfSSL_ERR_error_string(wolfSSL_ERR_get_error(), nullptr);
+ throw std::runtime_error(fmt::format("Failed to set cipher list: {}", errMsg));
+ }
+}
+
+template <>
+void icp::ssl::SSLOptions<WOLFSSL_CTX*>::validate(bool strict) const {
+ if (strict) {
+ if (this->minimumSupportedProtocolVersion != icp::ssl::ProtocolVersion::TLSV1_3) {
+ throw std::runtime_error("Only TLS 1.3 is supported in strict mode");
+ }
+ }
+ if (this->peerType == icp::ssl::PeerType::SERVER && !this->peerCertPath.has_value()) {
+ throw std::runtime_error("Server mode requires a peer certificate path");
+ }
+}
+
+template <>
+icp::ssl::SSLContext<WOLFSSL_CTX*>::SSLContext(const SSLContext<WOLFSSL_CTX*>& other)
+ : options(other.options)
+ , pkiEnv(other.pkiEnv) {
+ this->ctx = wolfSSL_CTX_new(wolfTLSv1_3_client_method());
+ this->cm = wolfSSL_CTX_GetCertManager(ctx);
+}
+
+template <>
+icp::ssl::SSLContext<WOLFSSL_CTX*>::SSLContext(SSLContext<WOLFSSL_CTX*>&& other)
+ : options(other.options)
+ , pkiEnv(other.pkiEnv) {
+ this->ctx = other.ctx;
+ this->cm = other.cm;
+ other.ctx = nullptr;
+ other.cm = nullptr;
+}
+
+template <>
+icp::ssl::SSLContext<WOLFSSL_CTX*>::~SSLContext() {
+ if (this->ctx) {
+ wolfSSL_CTX_free(this->ctx);
+ }
+}
+
+template <>
+icp::ssl::SSLContext<WOLFSSL_CTX*>& icp::ssl::SSLContext<WOLFSSL_CTX*>::operator=(const icp::ssl::SSLContext<WOLFSSL_CTX*>& other) {
+ if (this != &other) {
+ if (this->ctx) {
+ wolfSSL_CTX_free(this->ctx);
+ }
+ this->ctx = wolfSSL_CTX_new(wolfTLSv1_3_client_method());
+ }
+ return *this;
+}
+
+template <>
+icp::ssl::SSLContext<WOLFSSL_CTX*>& icp::ssl::SSLContext<WOLFSSL_CTX*>::operator=(SSLContext<WOLFSSL_CTX*>&& other) {
+ if (this != &other) {
+ if (this->ctx) {
+ wolfSSL_CTX_free(this->ctx);
+ }
+ this->ctx = other.ctx;
+ other.ctx = nullptr;
+ }
+ return *this;
+}
+
+template <>
+std::once_flag icp::ssl::SSLContext<WOLFSSL_CTX*>::sslInitDone = std::once_flag();
diff --git a/foreign/cpp/sdk/net/ssl/ssl.h b/foreign/cpp/sdk/net/ssl/ssl.h
new file mode 100644
index 00000000..44086116
--- /dev/null
+++ b/foreign/cpp/sdk/net/ssl/ssl.h
@@ -0,0 +1,150 @@
+#pragma once
+
+#include <mutex>
+#include <optional>
+#include <string>
+#include "crypto.h"
+#include "ssl_engine.h"
+
+namespace icp {
+namespace ssl {
+
+/**
+ * @brief The type of peer endpoint represented by the local end of the socket.
+ */
+enum PeerType { CLIENT, SERVER };
+
+/**
+ * @brief The version of the SSL/TLS protocol to use.
+ *
+ * We do not support the older, less-secure variations since the expectation is the library will be used in a controlled client-server
+ * environment where the developer can ensure the server endpoint is adequately hardened.
+ */
+enum ProtocolVersion { TLSV1_2 = 0, TLSV1_3 = 1 };
+
+/**
+ * @brief Helper function to get protocol version name given the enum.
+ */
+std::string getProtocolVersionName(icp::ssl::ProtocolVersion protocolVersion);
+
+/**
+ * @brief All options related to SSL/TLS are in -- what ciphers to use, client vs. server, etc..
+ *
+ * Mutable configuration object containing all options related to SSL/TLS. It offers reasonable defaults for a strict client. If you need to
+ * talk to an SSL/TLS server that has not been hardened you may need to modify this.
+ */
+template <typename HandleType>
+class SSLOptions : public icp::crypto::Configurable<HandleType> {
+private:
+ PeerType peerType;
+ std::optional<std::string> peerCertPath = std::nullopt;
+ ProtocolVersion minimumSupportedProtocolVersion = ProtocolVersion::TLSV1_3;
+ std::vector<std::string> ciphers = getDefaultCipherList(ProtocolVersion::TLSV1_3);
+
+public:
+ /**
+ * Creates a default set of options for a TLS 1.3-compatible client.
+ */
+ explicit SSLOptions(PeerType peerType = PeerType::CLIENT)
+ : peerType(peerType) {}
+
+ /**
+ * @brief Gets the default cipher list for use in SSL/TLS contexts.
+ * @return A vector of cipher strings, all uppercase.
+ */
+ static const std::vector<std::string> getDefaultCipherList(ProtocolVersion protocolVersion);
+
+ /**
+ * @brief Gets the type of peer endpoint represented by this end of the socket.
+ */
+ PeerType getPeerType() const { return this->peerType; }
+
+ /**
+ * @brief Sets the type of peer endpoint represented by the local end of the socket.
+ */
+ void setPeerType(PeerType peerType) { this->peerType = peerType; }
+
+ /**
+ * @brief Sets the type of peer endpoint represented by the local end of the socket.
+ */
+ std::optional<std::string> getPeerCertificatePath() const { return this->peerCertPath; }
+
+ /**
+ * @brief Sets the path to the peer's certificate, if any, to use for verifying the peer's identity.
+ */
+ void setPeerCertificatePath(const std::string& peerCertPath) { this->peerCertPath = peerCertPath; }
+
+ /**
+ * @brief Gets the minimum supported protocol version for the SSL/TLS context.
+ */
+ ProtocolVersion getMinimumSupportedProtocolVersion() const { return this->minimumSupportedProtocolVersion; }
+
+ /**
+ * @brief Sets the minimum supported protocol version for the SSL/TLS context.
+ */
+ void setMinimumSupportedProtocolVersion(ProtocolVersion minimumSupportedProtocolVersion) {
+ this->minimumSupportedProtocolVersion = minimumSupportedProtocolVersion;
+ }
+
+ /**
+ * @brief Gets the list of requested supported ciphers; will be validated by the context during init.
+ */
+ const std::vector<std::string>& getCiphers() const { return this->ciphers; }
+
+ /**
+ * @brief Sets the list of requested supported ciphers; will be validated by the context during init.
+ */
+ void setCiphers(const std::vector<std::string>& ciphers) { this->ciphers = ciphers; }
+
+ /**
+ * @brief Sanity checks the combination of options configured by the user.
+ * @param strict if true, will apply additional validations that may be more restrictive.
+ *
+ * Applies basic validations to the SSL options, e.g. if PeerType::SERVER is set, then a peer certificate path must be provided.
+ */
+ void validate(bool strict = true) const;
+
+ /**
+ * @brief Configures the SSL/TLS context handle with these options.
+ */
+ void configure(HandleType handle, const icp::crypto::PKIEnvironment<HandleType>& pkiEnv) override;
+};
+
+/**
+ * @brief An SSL/TLS context for use in secure communication.
+ *
+ * This class is a portable wrapper around the WolfSSL context object, providing a C++ interface to the underlying C library, encapsulating
+ * all the defaults of how to initialize and clean up the SSL context. It does not expose every possible option, and the intention is to
+ * support OpenSSL and BoringSSL in the future.
+ */
+template <typename HandleType>
+class SSLContext {
+private:
+ static std::once_flag sslInitDone;
+
+ const SSLOptions<HandleType>& options;
+ const icp::crypto::PKIEnvironment<HandleType>& pkiEnv;
+
+ WOLFSSL_CTX* ctx;
+ WOLFSSL_CERT_MANAGER* cm;
+
+ void raiseSSLError(const std::string& message) const;
+
+public:
+ explicit SSLContext(const SSLOptions<HandleType>& options = SSLOptions<HandleType>(),
+ const icp::crypto::PKIEnvironment<HandleType>& pkiEnv = icp::crypto::PKIEnvironment<HandleType>());
+ SSLContext(const SSLContext& other);
+ SSLContext(SSLContext&& other);
+ ~SSLContext();
+
+ SSLContext& operator=(const SSLContext& other);
+ SSLContext& operator=(SSLContext&& other);
+
+ /**
+ * @brief Gets access to the underlying C SSL context handle. Subsequent internal C library calls should make a static cast to ensure
+ * that the expected handle type is used.
+ */
+ HandleType getNativeHandle() const { return this->ctx; }
+};
+}; // namespace ssl
+}; // namespace icp
diff --git a/foreign/cpp/sdk/net/ssl/ssl_engine.h b/foreign/cpp/sdk/net/ssl/ssl_engine.h
new file mode 100644
index 00000000..a8038c09
--- /dev/null
+++ b/foreign/cpp/sdk/net/ssl/ssl_engine.h
@@ -0,0 +1,5 @@
+#pragma once
+
+#include <wolfssl/options.h>
+#include <wolfssl/ssl.h>
+#include <wolfssl/wolfcrypt/settings.h>
diff --git a/foreign/cpp/sdk/net/tcp/conn.cc b/foreign/cpp/sdk/net/tcp/conn.cc
new file mode 100644
index 00000000..2a553706
--- /dev/null
+++ b/foreign/cpp/sdk/net/tcp/conn.cc
@@ -0,0 +1 @@
+#include "conn.h"
diff --git a/foreign/cpp/sdk/net/tcp/conn.h b/foreign/cpp/sdk/net/tcp/conn.h
new file mode 100644
index 00000000..6f70f09b
--- /dev/null
+++ b/foreign/cpp/sdk/net/tcp/conn.h
@@ -0,0 +1 @@
+#pragma once
diff --git a/foreign/cpp/sdk/net/transport.h b/foreign/cpp/sdk/net/transport.h
new file mode 100644
index 00000000..878147a0
--- /dev/null
+++ b/foreign/cpp/sdk/net/transport.h
@@ -0,0 +1,31 @@
+#pragma once
+
+namespace icp {
+namespace net {
+namespace transport {
+
+/**
+ * @brief Available network transports in the client library.
+ */
+enum Transport {
+ /**
+ * @brief Modern networking protocol from Google built on top of UDP.
+ *
+ * @ref [Wikipedia](https://en.wikipedia.org/wiki/QUIC)
+ */
+ QUIC,
+
+ /**
+ * @brief Classic HTTP REST encoded as JSON. Not recommended for high performance applications.
+ */
+ HTTP,
+
+ /**
+ * @brief Binary protocol over TCP/IP.
+ */
+ TCP
+};
+
+}; // namespace transport
+}; // namespace net
+}; // namespace icp
diff --git a/foreign/cpp/sdk/serialization.cc b/foreign/cpp/sdk/serialization.cc
new file mode 100644
index 00000000..2847898a
--- /dev/null
+++ b/foreign/cpp/sdk/serialization.cc
@@ -0,0 +1,20 @@
+#include "serialization.h"
+#include <fmt/format.h>
+#include <utf8h/utf8.h>
+#include <stdexcept>
+
+std::string icp::serialization::convertToUTF8(const std::string& source, bool strict) {
+ std::unique_ptr<char8_t[]> data(new char8_t[source.size() + 1]);
+ std::copy(source.begin(), source.end(), data.get());
+ data[source.size()] = u8'\0';
+ if (utf8valid(data.get()) == 0) {
+ return source;
+ } else {
+ if (strict) {
+ throw std::invalid_argument(fmt::format("The input string is not a valid UTF-8 string: '{}'", source));
+ } else {
+ utf8makevalid(data.get(), '?');
+ return std::string(reinterpret_cast<char*>(data.get()));
+ }
+ }
+}
diff --git a/foreign/cpp/sdk/serialization.h b/foreign/cpp/sdk/serialization.h
new file mode 100644
index 00000000..e28ec124
--- /dev/null
+++ b/foreign/cpp/sdk/serialization.h
@@ -0,0 +1,29 @@
+#pragma once
+
+#include <string>
+#include "command.h"
+#include "model.h"
+
+namespace icp {
+namespace serialization {
+
+/***
+ * @brief Helper function to ensure C++ strings are UTF-8 clean.
+ */
+std::string convertToUTF8(const std::string& source, bool strict = true);
+
+/***
+ * @brief Base class for
+ */
+class WireFormat {
+public:
+ virtual ~WireFormat() = 0;
+
+ template <typename T, typename std::enable_if<std::is_base_of<icp::model::Model, T>::value>::type* = nullptr>
+ T readModel(std::istream& in);
+
+ template <typename T, typename std::enable_if<std::is_base_of<icp::command::Command, T>::value>::type* = nullptr>
+ void writeModel(std::ostream& out, const T& value);
+};
+} // namespace serialization
+} // namespace icp
diff --git a/foreign/cpp/sdk/types.h b/foreign/cpp/sdk/types.h
new file mode 100644
index 00000000..a3bd3d29
--- /dev/null
+++ b/foreign/cpp/sdk/types.h
@@ -0,0 +1,25 @@
+#pragma once
+
+#include <sys/types.h>
+#include <cstdint>
+
+/// @brief Mapping for fractional values between 0 and 1.
+typedef float percent_t;
+
+/// @brief Mapping for absolute times and time durations; currently in seconds.
+typedef uint64_t time_val_t;
+
+/// @brief Mapping for values that measure byte counts.
+typedef uint64_t byte_cnt_t;
+
+/// @brief Mapping for values that measure object counts.
+typedef uint32_t obj_cnt_t;
+
+/// @brief Mapping for values that measure (potentially very large) message counts.
+typedef uint64_t msg_cnt_t;
+
+/// @brief Mapping for a 128-bit integer support; supports gcc, clang and ICC, not MSVC.
+/// @ref
+/// [https://quuxplusone.github.io/blog/2019/02/28/is-int128-integral](https://quuxplusone.github.io/blog/2019/02/28/is-int128-integral)
+using I128 = __int128;
+typedef unsigned __int128 uint128_t;
diff --git a/foreign/cpp/tests/CMakeLists.txt b/foreign/cpp/tests/CMakeLists.txt
new file mode 100644
index 00000000..db22de8e
--- /dev/null
+++ b/foreign/cpp/tests/CMakeLists.txt
@@ -0,0 +1,85 @@
+
+if(BUILD_TESTS)
+ find_package(Catch2 CONFIG REQUIRED)
+ find_package(inja CONFIG REQUIRED)
+ find_package(reproc++ CONFIG REQUIRED)
+
+ file(GLOB_RECURSE UT_SOURCES "unit/*.cc")
+ add_executable(
+ iggy_cpp_test
+
+ ${UT_SOURCES}
+ )
+ target_include_directories(iggy_cpp_test PRIVATE ${IGGY_INCLUDE_DIRS})
+ target_link_libraries(
+ iggy_cpp_test
+
+ iggy
+ Catch2::Catch2
+ Catch2::Catch2WithMain
+ pantor::inja
+ reproc++
+ )
+
+ file(GLOB_RECURSE E2E_SOURCES "e2e/*.cc")
+ add_executable(
+ iggy_e2e_test
+
+ ${E2E_SOURCES}
+ )
+ target_include_directories(iggy_e2e_test PRIVATE ${IGGY_INCLUDE_DIRS})
+ target_link_libraries(
+ iggy_e2e_test
+
+ PRIVATE
+
+ iggy
+ Catch2::Catch2
+ Catch2::Catch2WithMain
+ reproc++
+ )
+
+
+ if(ENABLE_CODE_COVERAGE)
+ include(../cmake/modules/CodeCoverage.cmake)
+
+ setup_target_for_coverage_gcovr_coveralls(
+ NAME coveralls
+ EXECUTABLE iggy_cpp_test
+ EXCLUDE "build/vcpkg_installed/*" "tests/*"
+ DEPENDENCIES iggy)
+
+ setup_target_for_coverage_gcovr_html(
+ NAME coverage
+ EXECUTABLE iggy_cpp_test
+ EXCLUDE "build/vcpkg_installed/*" "tests/*"
+ DEPENDENCIES iggy)
+ endif()
+
+ # download correct version of Iggy, flatten out the binaries and make them executable;
+ # we are going to use these directly for E2E testing rather than the Docker version
+ # to allow for finer-grained control
+ execute_process(
+ COMMAND bash -c "curl --silent https://api.github.com/repos/iggy-rs/iggy/releases/latest | jq -r .tag_name"
+ OUTPUT_VARIABLE IGGY_VERSION
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ )
+ set(ARCH "${CMAKE_HOST_SYSTEM_PROCESSOR}")
+ set(IGGY_DOWNLOAD_BASENAME "iggy-Linux-${ARCH}-musl.zip")
+ set(URL "https://github.com/iggy-rs/iggy/releases/download/${IGGY_VERSION}/${IGGY_DOWNLOAD_BASENAME}")
+ set(IGGY_DOWNLOAD_FILE "${CMAKE_CURRENT_BINARY_DIR}/${IGGY_DOWNLOAD_BASENAME}")
+ message(STATUS "Downloading latest Iggy server MUSL release build from ${URL}")
+
+ file(DOWNLOAD ${URL} ${IGGY_DOWNLOAD_FILE} SHOW_PROGRESS)
+ execute_process(COMMAND unzip -o ${IGGY_DOWNLOAD_FILE} -d ${CMAKE_CURRENT_BINARY_DIR})
+ execute_process(COMMAND find ${CMAKE_CURRENT_BINARY_DIR}/all_artifacts -type f -exec mv {} ${CMAKE_CURRENT_BINARY_DIR} \;)
+ execute_process(COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_CURRENT_BINARY_DIR}/all_artifacts)
+ file(REMOVE ${IGGY_DOWNLOAD_FILE})
+
+ set(EXECUTABLE_FILES "iggy" "iggy-server")
+ foreach(FILE_NAME ${EXECUTABLE_FILES})
+ set(FILE_PATH "${CMAKE_CURRENT_BINARY_DIR}/${FILE_NAME}")
+ file(CHMOD ${FILE_PATH} PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ)
+ endforeach()
+
+endif()
diff --git a/foreign/cpp/tests/e2e/e2e_testutils.cc b/foreign/cpp/tests/e2e/e2e_testutils.cc
new file mode 100644
index 00000000..943f5df7
--- /dev/null
+++ b/foreign/cpp/tests/e2e/e2e_testutils.cc
@@ -0,0 +1,33 @@
+#include "e2e_testutils.h"
+#include <chrono>
+#include <stdexcept>
+#include <string>
+#include <thread>
+#include <vector>
+
+IggyRunner::IggyRunner() {
+ // start the Docker process with stdout redirected to parent process
+ std::vector<std::string> arguments = {"docker", "run", "-d", "--name", "iggy_test", "iggyrs/iggy:latest"};
+ reproc::options options;
+ options.redirect.parent = true;
+ auto err = process.start(arguments, options);
+ if (err) {
+ throw std::runtime_error("Failed to start Docker process");
+ }
+
+ // need to figure out a polling mechanism to check if the server is up and running
+ std::this_thread::sleep_for(std::chrono::seconds(5));
+}
+
+IggyRunner::~IggyRunner() {
+ // stop the Docker process
+ process.stop(reproc::stop_actions{{reproc::stop::terminate, reproc::milliseconds(5000)},
+ {reproc::stop::kill, reproc::milliseconds(2000)},
+ {reproc::stop::wait, reproc::milliseconds(2000)}});
+
+ // remove the Docker container
+ reproc::process remove_process;
+ std::vector<std::string> remove_arguments = {"docker", "rm", "-f", "iggy_test"};
+ remove_process.start(remove_arguments);
+ remove_process.wait(reproc::milliseconds(5000));
+}
diff --git a/foreign/cpp/tests/e2e/e2e_testutils.h b/foreign/cpp/tests/e2e/e2e_testutils.h
new file mode 100644
index 00000000..3e062ea8
--- /dev/null
+++ b/foreign/cpp/tests/e2e/e2e_testutils.h
@@ -0,0 +1,22 @@
+#pragma once
+
+#include <catch.hpp>
+#include <reproc++/reproc.hpp>
+
+const char E2E_TAG[] = "[E2E Tests]";
+
+/**
+ * @brief Test fixture that starts and stops a Docker container for each test.
+ *
+ * This test fixture is meant for use in end-to-end (E2E) tests for the Iggy C++ client.
+ * It will start up the latest Iggy server inside a Docker container, allow you to
+ * interact with it, then stop and remove the container in the TearDown() method.
+ */
+class IggyRunner {
+private:
+ reproc::process process;
+
+public:
+ IggyRunner();
+ ~IggyRunner();
+};
diff --git a/foreign/cpp/tests/e2e/ping_cmd_test.cc b/foreign/cpp/tests/e2e/ping_cmd_test.cc
new file mode 100644
index 00000000..58820190
--- /dev/null
+++ b/foreign/cpp/tests/e2e/ping_cmd_test.cc
@@ -0,0 +1,14 @@
+#include "../../sdk/client.h"
+#include "e2e_testutils.h"
+
+TEST_CASE("ping Iggy server", E2E_TAG) {
+ // Start the Docker container; shuts down when this object goes out of scope
+ IggyRunner runner;
+
+ // Create a client object with all defaults
+ icp::client::Options options;
+ icp::client::Client client(options);
+
+ // Perform the ping operation
+ client.ping();
+}
diff --git a/foreign/cpp/tests/e2e/server.toml b/foreign/cpp/tests/e2e/server.toml
new file mode 100644
index 00000000..d765b88e
--- /dev/null
+++ b/foreign/cpp/tests/e2e/server.toml
@@ -0,0 +1,375 @@
+# HTTP server configuration
+[http]
+# Determines if the HTTP server is active.
+# `true` enables the server, allowing it to handle HTTP requests.
+# `false` disables the server, preventing it from handling HTTP requests.
+enabled = true
+
+# Specifies the network address and port for the HTTP server.
+# The format is "HOST:PORT". For example, "0.0.0.0:3000" listens on all network interfaces on port 3000.
+address = "0.0.0.0:3000"
+
+# Maximum size of the request body in bytes. For security reasons, the default limit is 2 MB.
+max_request_size = "2 MB"
+
+# Configuration for Cross-Origin Resource Sharing (CORS).
+[http.cors]
+# Controls whether CORS is enabled for the HTTP server.
+# `true` allows handling cross-origin requests with specified rules.
+# `false` blocks cross-origin requests, enhancing security.
+enabled = true
+
+# Specifies which HTTP methods are allowed when CORS is enabled.
+# For example, ["GET", "POST"] would allow only GET and POST requests.
+allowed_methods = ["GET", "POST", "PUT", "DELETE"]
+
+# Defines which origins are permitted to make cross-origin requests.
+# An asterisk "*" allows all origins. Specific domains can be listed to restrict access.
+allowed_origins = ["*"]
+
+# Lists allowed headers that can be used in CORS requests.
+# For example, ["content-type"] permits only the content-type header.
+allowed_headers = ["content-type"]
+
+# Headers that browsers are allowed to access in CORS responses.
+# An empty array means no additional headers are exposed to browsers.
+exposed_headers = [""]
+
+# Determines if credentials like cookies or HTTP auth can be included in CORS requests.
+# `true` allows credentials to be included, useful for authenticated sessions.
+# `false` prevents credentials, enhancing privacy and security.
+allow_credentials = false
+
+# Allows or blocks requests from private networks in CORS.
+# `true` permits requests from private networks.
+# `false` disallows such requests, providing additional security.
+allow_private_network = false
+
+# JWT (JSON Web Token) configuration for HTTP.
+[http.jwt]
+# Specifies the algorithm used for signing JWTs.
+# For example, "HS256" indicates HMAC with SHA-256.
+algorithm = "HS256"
+
+# The issuer of the JWT, typically a URL or an identifier of the issuing entity.
+issuer = "iggy.rs"
+
+# Intended audience for the JWT, usually the recipient or system intended to process the token.
+audience = "iggy.rs"
+
+# Lists valid issuers for JWT validation to ensure tokens are from trusted sources.
+valid_issuers = ["iggy.rs"]
+
+# Lists valid audiences for JWT validation to confirm tokens are for the intended recipient.
+valid_audiences = ["iggy.rs"]
+
+# Expiry time for access tokens.
+access_token_expiry = "1 h"
+
+# Expiry time for refresh tokens.
+refresh_token_expiry = "1 d"
+
+# Tolerance for timing discrepancies during token validation.
+clock_skew = "5 s"
+
+# Time before which the token should not be considered valid.
+not_before = "0 s"
+
+# Secret key for encoding JWTs.
+encoding_secret = "top_secret$iggy.rs$_jwt_HS256_key#!"
+
+# Secret key for decoding JWTs.
+decoding_secret = "top_secret$iggy.rs$_jwt_HS256_key#!"
+
+# Indicates if the secret key is base64 encoded.
+# `true` means the secret is base64 encoded.
+# `false` means the secret is in plain text.
+use_base64_secret = false
+
+# Metrics configuration for HTTP.
+[http.metrics]
+# Enable or disable the metrics endpoint.
+# `true` makes metrics available at the specified endpoint.
+# `false` disables metrics collection.
+enabled = true
+
+# Specifies the endpoint for accessing metrics, e.g., "/metrics".
+endpoint = "/metrics"
+
+# TLS (Transport Layer Security) configuration for HTTP.
+[http.tls]
+# Controls the use of TLS for encrypted HTTP connections.
+# `true` enables TLS, enhancing security.
+# `false` disables TLS, which may be appropriate in secure internal networks.
+enabled = false
+
+# Path to the TLS certificate file.
+cert_file = "certs/iggy_cert.pem"
+
+# Path to the TLS key file.
+key_file = "certs/iggy_key.pem"
+
+# TCP server configuration.
+[tcp]
+# Determines if the TCP server is active.
+# `true` enables the TCP server for handling TCP connections.
+# `false` disables it, preventing any TCP communication.
+enabled = true
+
+# Defines the network address and port for the TCP server.
+# For example, "0.0.0.0:8090" listens on all network interfaces on port 8090.
+address = "0.0.0.0:8090"
+
+# TLS configuration for the TCP server.
+[tcp.tls]
+# Enables or disables TLS for TCP connections.
+# `true` secures TCP connections with TLS.
+# `false` leaves TCP connections unencrypted.
+enabled = false
+
+# Path to the TLS certificate for TCP.
+certificate = "certs/iggy.pfx"
+
+# Password for the TLS certificate, required for accessing the private key.
+password = "iggy123"
+
+# QUIC protocol configuration.
+[quic]
+# Controls whether the QUIC server is enabled.
+# `true` enables QUIC for fast, secure connections.
+# `false` disables QUIC, possibly for compatibility or simplicity.
+enabled = true
+
+# Network address and port for the QUIC server.
+# For example, "0.0.0.0:8080" binds to all interfaces on port 8080.
+address = "0.0.0.0:8080"
+
+# Maximum number of simultaneous bidirectional streams in QUIC.
+max_concurrent_bidi_streams = 10_000
+
+# Size of the buffer for sending datagrams in QUIC.
+datagram_send_buffer_size = "100 KB"
+
+# Initial Maximum Transmission Unit (MTU) for QUIC connections.
+initial_mtu = "8 KB"
+
+# Size of the sending window in QUIC, controlling data flow.
+send_window = "100 KB"
+
+# Size of the receiving window in QUIC, controlling data flow.
+receive_window = "100 KB"
+
+# Interval for sending keep-alive messages in QUIC.
+keep_alive_interval = "5 s"
+
+# Maximum idle time before a QUIC connection is closed.
+max_idle_timeout = "10 s"
+
+# QUIC certificate configuration.
+[quic.certificate]
+# Indicates whether the QUIC certificate is self-signed.
+# `true` for self-signed certificates, often used in internal or testing environments.
+# `false` for certificates issued by a certificate authority, common in production.
+self_signed = true
+
+# Path to the QUIC TLS certificate file.
+cert_file = "certs/iggy_cert.pem"
+
+# Path to the QUIC TLS key file.
+key_file = "certs/iggy_key.pem"
+
+# Message cleaner configuration.
+[message_cleaner]
+# Enables or disables the background process for deleting expired messages.
+# `true` activates the message cleaner.
+# `false` turns it off, messages will not be auto-deleted based on expiry.
+enabled = true
+
+# Interval for running the message cleaner.
+interval = "1 m"
+
+# Message saver configuration.
+[message_saver]
+# Enables or disables the background process for saving buffered data to disk.
+# `true` ensures data is periodically written to disk.
+# `false` turns off automatic saving, relying on other triggers for data persistence.
+enabled = true
+
+# Controls whether data saving is synchronous (enforce fsync) or asynchronous.
+# `true` for synchronous saving, ensuring data integrity at the cost of performance.
+# `false` for asynchronous saving, improving performance but with delayed data writing.
+enforce_fsync = true
+
+# Interval for running the message saver.
+interval = "30 s"
+
+# Personal access token configuration.
+[personal_access_token]
+# Sets the maximum number of active tokens allowed per user.
+max_tokens_per_user = 100
+
+# Personal access token cleaner configuration.
+[personal_access_token.cleaner]
+# Enables or disables the token cleaner process.
+# `true` activates periodic token cleaning.
+# `false` disables it, tokens remain active until manually revoked or expired.
+enabled = true
+
+# Interval for running the token cleaner.
+interval = "1 m"
+
+# System configuration.
+[system]
+# Base path for system data storage.
+path = ".iggy/local_data"
+
+# Backup configuration
+[system.backup]
+# Path for storing backup.
+path = "backup"
+
+# Compatibility conversion configuration
+[system.backup.compatibility]
+# Subpath of the backup directory where converted segment data is stored after compatibility conversion.
+path = "compatibility"
+
+# Database configuration.
+[system.database]
+# Path for storing database files.
+# Specifies the directory where database files are stored, relative to `system.path`.
+path = "database"
+
+# Runtime configuration.
+[system.runtime]
+# Path for storing runtime data.
+# Specifies the directory where any runtime data is stored, relative to `system.path`.
+path = "runtime"
+
+# Logging configuration.
+[system.logging]
+# Path for storing log files.
+path = "logs"
+
+# Level of logging detail. Options: "debug", "info", "warn", "error".
+level = "info"
+
+# Maximum size of the log files before rotation.
+max_size = "512 MB"
+
+# Time to retain log files before deletion.
+retention = "7 days"
+
+# Interval for printing system information to the log.
+sysinfo_print_interval = "10 s"
+
+# Cache configuration.
+[system.cache]
+# Enables or disables the system cache.
+# `true` activates caching for frequently accessed data.
+# `false` disables caching, data is always read from the source.
+enabled = true
+
+# Maximum size of the cache, e.g. "4GB".
+size = "4 GB"
+
+# Data retention policy configuration.
+[system.retention_policy]
+# Configures the message time-based expiry setting.
+# "disabled" means messages are kept indefinitely.
+# A time value in human-readable format determines the lifespan of messages.
+# Example: `message_expiry = "2 days 4 hours 15 minutes"` means messages will expire after that duration.
+message_expiry = "disabled"
+
+# Configures the topic size-based expiry setting.
+# "unlimited" or "0" means topics are kept indefinitely.
+# A size value in human-readable format determines the maximum size of a topic.
+# When a topic reaches this size, the oldest messages are deleted to make room for new ones.
+# Messages are removed in full segments, so if segment size is 1 GB and the topic size is 10 GB,
+# the oldest segment will be deleted upon reaching 10 GB.
+# Example: `max_topic_size = "10 GB"` means oldest messages in topics will be deleted when they reach 10 GB.
+# Note: this setting can be overwritten with CreateTopic and UpdateTopic requests.
+max_topic_size = "10 GB"
+
+# Encryption configuration
+[system.encryption]
+# Determines whether server-side data encryption is enabled (boolean).
+# `true` enables encryption for stored data using AES-256-GCM.
+# `false` means data is stored without encryption.
+enabled = false
+
+# The encryption key used when encryption is enabled (string).
+# Should be a 32 bytes length key, provided as a base64 encoded string.
+# This key is required and used only if encryption is enabled.
+key = ""
+
+# Compression configuration
+[system.compression]
+# Allows overriding the default compression algorithm per data segment (boolean).
+# `true` permits different compression algorithms for individual segments.
+# `false` means all data segments use the default compression algorithm.
+allow_override = false
+
+# The default compression algorithm used for data storage (string).
+# "none" indicates no compression, other values can specify different algorithms.
+default_algorithm = "none"
+
+# Stream configuration
+[system.stream]
+# Path for storing stream-related data (string).
+# Specifies the directory where stream data is stored, relative to `system.path`.
+path = "streams"
+
+# Topic configuration
+[system.topic]
+# Path for storing topic-related data (string).
+# Specifies the directory where topic data is stored, relative to `stream.path`.
+path = "topics"
+
+# Partition configuration
+[system.partition]
+# Path for storing partition-related data (string).
+# Specifies the directory where partition data is stored, relative to `topic.path`.
+path = "partitions"
+
+# Determines whether to enforce file synchronization on partition updates (boolean).
+# `true` ensures immediate writing of data to disk for durability.
+# `false` allows the OS to manage write operations, which can improve performance.
+enforce_fsync = false
+
+# Enables checksum validation for data integrity (boolean).
+# `true` activates CRC checks when loading data, guarding against corruption.
+# `false` skips these checks for faster loading at the risk of undetected corruption.
+validate_checksum = false
+
+# The threshold of buffered messages before triggering a save to disk (integer).
+# Specifies how many messages accumulate before persisting to storage.
+# Adjusting this can balance between write performance and data durability.
+messages_required_to_save = 10_000
+
+# Segment configuration
+[system.segment]
+# Defines the soft limit for the size of a storage segment.
+# When a segment reaches this size, a new segment is created for subsequent data.
+# Example: if `size` is set "1GB", the actual segment size may be 1GB + the size of remaining messages in received batch.
+size = "1 GB"
+
+# Controls whether to cache indexes for segment access (boolean).
+# `true` keeps indexes in memory, speeding up data retrieval.
+# `false` reads indexes from disk, which can conserve memory at the cost of access speed.
+cache_indexes = true
+
+# Determines whether to cache time-based indexes for segments (boolean).
+# `true` allows faster timestamp-based data retrieval by keeping indexes in memory.
+# `false` conserves memory by reading time indexes from disk, which may slow down access.
+cache_time_indexes = true
+
+# Message deduplication configuration
+[system.message_deduplication]
+# Controls whether message deduplication is enabled (boolean).
+# `true` activates deduplication, ignoring messages with duplicate IDs.
+# `false` treats each message as unique, even if IDs are duplicated.
+enabled = false
+# Maximum number of ID entries in the deduplication cache (u64).
+max_entries = 1000
+# Maximum age of ID entries in the deduplication cache in human-readable format.
+expiry = "1 m"
diff --git a/foreign/cpp/tests/unit/client_test.cc b/foreign/cpp/tests/unit/client_test.cc
new file mode 100644
index 00000000..48b72960
--- /dev/null
+++ b/foreign/cpp/tests/unit/client_test.cc
@@ -0,0 +1,9 @@
+#include "../../sdk/client.h"
+#include "unit_testutils.h"
+
+TEST_CASE("client connection", UT_TAG) {
+ icp::client::Options options;
+ auto client = icp::client::Client(options);
+ auto stats = client.getStats();
+ REQUIRE(&stats != nullptr);
+}
diff --git a/foreign/cpp/tests/unit/crypto_test.cc b/foreign/cpp/tests/unit/crypto_test.cc
new file mode 100644
index 00000000..0293fe2d
--- /dev/null
+++ b/foreign/cpp/tests/unit/crypto_test.cc
@@ -0,0 +1,34 @@
+#include "../../sdk/net/ssl/crypto.h"
+#include "unit_testutils.h"
+
+TEST_CASE_METHOD(icp::testutil::SelfSignedCertificate, "certificate loading", UT_TAG) {
+ auto tmpDir = std::filesystem::temp_directory_path();
+ icp::crypto::CertificateStore* cs = new icp::crypto::LocalCertificateStore(tmpDir);
+ auto cert = cs->getCertificate(getCertificatePath().filename());
+ REQUIRE(cert.size() > 0);
+ delete cs;
+}
+
+TEST_CASE_METHOD(icp::testutil::SelfSignedCertificate, "private key loading", UT_TAG) {
+ auto tmpDir = std::filesystem::temp_directory_path();
+ icp::crypto::KeyStore* ks = new icp::crypto::LocalKeyStore(tmpDir);
+ auto pk = ks->getPrivateKey(getKeyPath().filename());
+ REQUIRE(pk.size() > 0);
+ delete ks;
+}
+
+TEST_CASE("revocation methods", UT_TAG) {
+ SECTION("default CRL configuration") {
+ icp::crypto::CRL<WOLFSSL_CTX*> crl;
+
+ REQUIRE(!crl.getCrlPath().has_value());
+ REQUIRE(!crl.getCrlUrl().has_value());
+ }
+
+ SECTION("default OCSP configuration") {
+ icp::crypto::OCSP<WOLFSSL_CTX*> ocsp;
+
+ REQUIRE(!ocsp.getOcspOverrideUrl().has_value());
+ REQUIRE(ocsp.isStaplingEnabled());
+ }
+}
diff --git a/foreign/cpp/tests/unit/iggy_protocol_provider_test.cc b/foreign/cpp/tests/unit/iggy_protocol_provider_test.cc
new file mode 100644
index 00000000..d7d8c973
--- /dev/null
+++ b/foreign/cpp/tests/unit/iggy_protocol_provider_test.cc
@@ -0,0 +1,34 @@
+#define CATCH_CONFIG_MAIN
+#include "../../sdk/net/iggy.h"
+#include "unit_testutils.h"
+
+TEST_CASE("Iggy protocols", UT_TAG) {
+ icp::net::IggyProtocolProvider provider;
+
+ SECTION("enumerate supported protocols") {
+ REQUIRE(provider.getSupportedProtocols().size() == 5);
+ }
+
+ SECTION("check supported protocol definitions") {
+ auto [protocolName, tlsSupported] =
+ GENERATE(table<std::string, bool>({{"quic", true}, {"tcp", false}, {"tcp+tls", true}, {"http", false}, {"http+tls", true}}));
+
+ REQUIRE(provider.isSupported(protocolName));
+ REQUIRE(provider.getProtocolDefinition(protocolName).getName() == protocolName);
+ REQUIRE(provider.getProtocolDefinition(protocolName).isTlsSupported() == tlsSupported);
+ }
+
+ SECTION("create addresses") {
+ auto [address, protocolName, host, port] =
+ GENERATE(table<std::string, std::string, std::string, int>({{"quic://localhost", "quic", "localhost", 8080},
+ {"tcp://localhost:1234", "tcp", "localhost", 1234},
+ {"tcp+tls://localhost:1234", "tcp+tls", "localhost", 1234},
+ {"http://localhost", "http", "localhost", 3000},
+ {"http+tls://localhost:1234", "http+tls", "localhost", 1234}}));
+
+ auto addr = provider.createAddress(address);
+ REQUIRE(addr.getProtocol() == protocolName);
+ REQUIRE(addr.getHost() == host);
+ REQUIRE(addr.getPort() == port);
+ }
+}
diff --git a/foreign/cpp/tests/unit/model_test.cc b/foreign/cpp/tests/unit/model_test.cc
new file mode 100644
index 00000000..9e8f19f8
--- /dev/null
+++ b/foreign/cpp/tests/unit/model_test.cc
@@ -0,0 +1,7 @@
+#include "../../sdk/model.h"
+#include "unit_testutils.h"
+
+TEST_CASE("model objects", UT_TAG) {
+ icp::model::sys::Stats stats = icp::model::sys::Stats(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", "", "");
+ REQUIRE(&stats != nullptr);
+}
diff --git a/foreign/cpp/tests/unit/serialization_test.cc b/foreign/cpp/tests/unit/serialization_test.cc
new file mode 100644
index 00000000..8cdd24d2
--- /dev/null
+++ b/foreign/cpp/tests/unit/serialization_test.cc
@@ -0,0 +1,16 @@
+#include "../../sdk/serialization.h"
+#include "unit_testutils.h"
+
+TEST_CASE("serialization utilities", UT_TAG) {
+ SECTION("valid UTF-8") {
+ auto utf8 = icp::serialization::convertToUTF8("hello world");
+ REQUIRE(utf8 == "hello world");
+ }
+ SECTION("invalid UTF-8, strict checking") {
+ REQUIRE_THROWS_AS(icp::serialization::convertToUTF8("hello \x80 world", true), std::invalid_argument);
+ }
+ SECTION("invalid UTF-8, non-strict checking") {
+ auto utf8 = icp::serialization::convertToUTF8("hello \x80 world", false);
+ REQUIRE(utf8 == "hello ? world");
+ }
+}
diff --git a/foreign/cpp/tests/unit/ssl_test.cc b/foreign/cpp/tests/unit/ssl_test.cc
new file mode 100644
index 00000000..cf428ec3
--- /dev/null
+++ b/foreign/cpp/tests/unit/ssl_test.cc
@@ -0,0 +1,132 @@
+#include "../../sdk/net/ssl/ssl.h"
+#include "unit_testutils.h"
+
+TEST_CASE("SSL configuration", UT_TAG) {
+ icp::ssl::SSLOptions<WOLFSSL_CTX*> options;
+
+ SECTION("expected basic default settings") {
+ // default options should always be strictly valid
+ REQUIRE_NOTHROW(options.validate(true));
+
+ REQUIRE(options.getPeerType() == icp::ssl::PeerType::CLIENT);
+ REQUIRE(options.getPeerCertificatePath().has_value() == false);
+ REQUIRE(options.getMinimumSupportedProtocolVersion() == icp::ssl::ProtocolVersion::TLSV1_3);
+ }
+
+ SECTION("default cipher list configured") {
+ auto cipherListTLSV1_2 = options.getDefaultCipherList(icp::ssl::ProtocolVersion::TLSV1_2);
+ auto cipherListTLSV1_3 = options.getDefaultCipherList(icp::ssl::ProtocolVersion::TLSV1_3);
+
+ REQUIRE(cipherListTLSV1_2.size() == 6);
+ REQUIRE(cipherListTLSV1_3.size() == 3);
+
+ std::string tls12Cipher = "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384";
+ std::string tls13Cipher = "TLS_CHACHA20_POLY1305_SHA256";
+ CHECK(std::find(cipherListTLSV1_2.begin(), cipherListTLSV1_2.end(), tls12Cipher) != cipherListTLSV1_2.end());
+ CHECK(std::find(cipherListTLSV1_3.begin(), cipherListTLSV1_3.end(), tls13Cipher) != cipherListTLSV1_3.end());
+ }
+
+ SECTION("configure bespoke cipers") {
+ auto testCipher = "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384";
+ options.setCiphers({testCipher});
+
+ auto ciphers = options.getCiphers();
+ REQUIRE(ciphers.size() == 1);
+ CHECK(std::find(ciphers.begin(), ciphers.end(), testCipher) != ciphers.end());
+
+ REQUIRE_NOTHROW(options.validate(true));
+ }
+
+ SECTION("configure server options") {
+ options.setPeerType(icp::ssl::PeerType::SERVER);
+
+ // missing certificate path
+ REQUIRE_THROWS(options.validate());
+
+ // fix the issue
+ options.setPeerCertificatePath("test.pem");
+
+ // first try strict validation, fail
+ options.setMinimumSupportedProtocolVersion(icp::ssl::ProtocolVersion::TLSV1_2);
+ REQUIRE_THROWS(options.validate(true));
+
+ // loosen the validation
+ REQUIRE_NOTHROW(options.validate(false));
+
+ // finally harden the settings and tighten up validation
+ options.setMinimumSupportedProtocolVersion(icp::ssl::ProtocolVersion::TLSV1_3);
+ REQUIRE_NOTHROW(options.validate(true));
+ }
+}
+
+TEST_CASE_METHOD(icp::testutil::SelfSignedCertificate, "SSL context init", UT_TAG) {
+ auto certPath = getCertificatePath().filename();
+ auto keyPath = getKeyPath().filename();
+
+ auto ca = icp::crypto::CertificateAuthority<WOLFSSL_CTX*>();
+ auto certStore = icp::crypto::LocalCertificateStore(std::filesystem::temp_directory_path());
+ auto keyStore = icp::crypto::LocalKeyStore(std::filesystem::temp_directory_path());
+
+ auto options = icp::ssl::SSLOptions<WOLFSSL_CTX*>();
+ options.setPeerCertificatePath(certPath);
+
+ icp::crypto::PKIEnvironment<WOLFSSL_CTX*> pkiEnv(ca, certStore, keyStore);
+
+ SECTION("TLS version support") {
+ auto [requestedVersion, minProtoVersion, maxProtoVersion] =
+ GENERATE(std::make_tuple(icp::ssl::ProtocolVersion::TLSV1_2, TLS1_2_VERSION, TLS1_3_VERSION),
+ std::make_tuple(icp::ssl::ProtocolVersion::TLSV1_3, TLS1_3_VERSION, TLS1_3_VERSION));
+
+ SECTION(icp::ssl::getProtocolVersionName(requestedVersion)) {
+ options.setMinimumSupportedProtocolVersion(requestedVersion);
+ auto sslCtx = icp::ssl::SSLContext<WOLFSSL_CTX*>(options, pkiEnv);
+
+ WOLFSSL_CTX* handle = sslCtx.getNativeHandle();
+ REQUIRE(handle != nullptr);
+
+ WOLFSSL* ssl = wolfSSL_new(handle);
+ REQUIRE(ssl != nullptr);
+
+ WOLFSSL_CERT_MANAGER* cm = wolfSSL_CTX_GetCertManager(handle);
+ REQUIRE(cm != nullptr);
+
+ // sanity check configuration
+ REQUIRE(wolfSSL_CTX_get_min_proto_version(handle) == minProtoVersion);
+ REQUIRE(wolfSSL_CTX_get_max_proto_version(handle) == maxProtoVersion);
+
+ // check cipher list
+
+ // check certificate configuration
+
+ // check CA configuration
+
+ // test copy and move constructors
+ auto sslCtxNew = sslCtx;
+
+ // cppcheck-suppress knownConditionTrueFalse
+ REQUIRE(sslCtx.getNativeHandle() != sslCtxNew.getNativeHandle());
+
+ auto sslCtxMoved = std::move(sslCtxNew);
+ REQUIRE(sslCtxNew.getNativeHandle() == nullptr);
+ REQUIRE(sslCtxMoved.getNativeHandle() != nullptr);
+
+ // test copy and move operators
+ sslCtxNew = sslCtxMoved;
+ REQUIRE(sslCtx.getNativeHandle() != sslCtxNew.getNativeHandle());
+
+ icp::ssl::SSLContext<WOLFSSL_CTX*> sslCtxNew2;
+ sslCtxNew2 = std::move(sslCtx);
+ }
+ }
+}
+
+TEST_CASE("error message conversion", UT_TAG) {
+ SECTION("TLS 1.2") {
+ auto displayName = icp::ssl::getProtocolVersionName(icp::ssl::ProtocolVersion::TLSV1_2);
+ REQUIRE(displayName == "TLSV1_2");
+ }
+ SECTION("TLS 1.3") {
+ auto displayName = icp::ssl::getProtocolVersionName(icp::ssl::ProtocolVersion::TLSV1_3);
+ REQUIRE(displayName == "TLSV1_3");
+ }
+}
diff --git a/foreign/cpp/tests/unit/unit_testutils.cc b/foreign/cpp/tests/unit/unit_testutils.cc
new file mode 100644
index 00000000..836e0e3d
--- /dev/null
+++ b/foreign/cpp/tests/unit/unit_testutils.cc
@@ -0,0 +1,47 @@
+#include "unit_testutils.h"
+#include <fmt/format.h>
+#include <iostream>
+#include <random>
+#include <reproc++/drain.hpp>
+#include <reproc++/reproc.hpp>
+#include <stdexcept>
+#include <vector>
+
+icp::testutil::SelfSignedCertificate::SelfSignedCertificate()
+ : certificatePath(generateRandomTempPath("cert.pem"))
+ , keyPath(generateRandomTempPath("key.pem")) {
+ std::vector<std::string> arguments = {"openssl", "req",
+ "-x509", "-newkey",
+ "rsa:2048", "-nodes",
+ "-keyout", this->keyPath.string(),
+ "-out", this->certificatePath.string(),
+ "-days", "365",
+ "-subj", "/CN=localhost"};
+ reproc::options options;
+ options.redirect.discard = true;
+ reproc::process process;
+
+ std::string output;
+ reproc::sink::string sink(output);
+ auto err = process.start(arguments, options);
+ if (err) {
+ throw std::runtime_error(fmt::format("Failed to run OpenSSL: {}", err.message()));
+ }
+ err = reproc::drain(process, sink, reproc::sink::null);
+ if (err) {
+ throw std::runtime_error(fmt::format("Failed to read OpenSSL output: {}", err.message()));
+ }
+ std::cout << output << std::flush;
+}
+
+icp::testutil::SelfSignedCertificate::~SelfSignedCertificate() {
+ std::filesystem::remove(this->certificatePath);
+ std::filesystem::remove(this->keyPath);
+}
+
+std::filesystem::path icp::testutil::SelfSignedCertificate::generateRandomTempPath(const std::string& baseName) {
+ std::random_device rd;
+ std::mt19937 gen(rd());
+ std::uniform_int_distribution<> distrib(0, RAND_MAX);
+ return std::filesystem::temp_directory_path() / (std::to_string(distrib(gen)) + baseName);
+}
diff --git a/foreign/cpp/tests/unit/unit_testutils.h b/foreign/cpp/tests/unit/unit_testutils.h
new file mode 100644
index 00000000..984cab17
--- /dev/null
+++ b/foreign/cpp/tests/unit/unit_testutils.h
@@ -0,0 +1,28 @@
+#pragma once
+
+#include <catch.hpp>
+#include <filesystem>
+#include <string>
+
+const char UT_TAG[] = "[Unit Tests]";
+
+namespace icp {
+namespace testutil {
+/**
+ * @brief A helper class for generating self-signed certificates for testing purposes using OpenSSL CLI.
+ */
+class SelfSignedCertificate {
+private:
+ const std::filesystem::path certificatePath;
+ const std::filesystem::path keyPath;
+
+ static std::filesystem::path generateRandomTempPath(const std::string& baseName);
+
+public:
+ SelfSignedCertificate();
+ ~SelfSignedCertificate();
+ std::filesystem::path getCertificatePath() { return this->certificatePath; }
+ std::filesystem::path getKeyPath() { return this->keyPath; }
+};
+} // namespace testutil
+} // namespace icp
diff --git a/foreign/cpp/vcpkg-configuration.json b/foreign/cpp/vcpkg-configuration.json
new file mode 100644
index 00000000..81cb92ed
--- /dev/null
+++ b/foreign/cpp/vcpkg-configuration.json
@@ -0,0 +1,14 @@
+{
+ "default-registry": {
+ "kind": "git",
+ "baseline": "47364fbc300756f64f7876b549d9422d5f3ec0d3",
+ "repository": "https://github.com/microsoft/vcpkg"
+ },
+ "registries": [
+ {
+ "kind": "artifact",
+ "location": "https://github.com/microsoft/vcpkg-ce-catalog/archive/refs/heads/main.zip",
+ "name": "microsoft"
+ }
+ ]
+}
diff --git a/foreign/cpp/vcpkg.json b/foreign/cpp/vcpkg.json
new file mode 100644
index 00000000..07fe5472
--- /dev/null
+++ b/foreign/cpp/vcpkg.json
@@ -0,0 +1,14 @@
+{
+ "dependencies": [
+ "ada-url",
+ "catch2",
+ "fmt",
+ "inja",
+ "libsodium",
+ "libuv",
+ "nlohmann-json",
+ "reproc",
+ "spdlog",
+ "utf8h"
+ ]
+}