Skip to content

Commit

Permalink
Release v7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
arobenko committed Jan 11, 2025
2 parents b2fa93c + d6892d2 commit 6f18da3
Show file tree
Hide file tree
Showing 596 changed files with 6,072 additions and 6,359 deletions.
30 changes: 18 additions & 12 deletions .github/workflows/actions_build.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
name: Github Actions Build

on: [push]
on:
push:
branches:
- '**'
tags-ignore:
- '**'

env:
COMMS_TAG: v5.2.7
CC_TOOLS_QT_TAG: v5.3.3
COMMS_TAG: v5.3
CC_TOOLS_QT_TAG: v6.0

jobs:
build_gcc_old_ubuntu_20_04:
Expand Down Expand Up @@ -110,6 +115,7 @@ jobs:
COMMON_CXX_STANDARD: ${{matrix.cpp}}
COMMS_TAG: ${{env.COMMS_TAG}}
CC_TOOLS_QT_TAG: ${{env.CC_TOOLS_QT_TAG}}
CC_TOOLS_QT_SKIP: 1

- name: Configure CMake
shell: bash
Expand All @@ -119,12 +125,11 @@ jobs:
-DCMAKE_PREFIX_PATH=${{runner.workspace}}/build/install -DCOMMSDSL_TESTS_CXX_STANDARD=${{matrix.cpp}} \
-DCOMMSDSL_BUILD_UNIT_TESTS=ON \
-DCOMMSDSL_BUILD_COMMSDSL2TEST=ON -DCOMMSDSL_BUILD_COMMSDSL2TOOLS_QT=ON \
-DCOMMSDSL_BUILD_COMMSDSL2TOOLS_QT_TESTS=${{env.BUILD_TOOLS_QT_UNIT_TESTS}} \
-DCOMMSDSL_BUILD_COMMSDSL2TOOLS_QT_TESTS=OFF \
-DCOMMSDSL_BUILD_WITH_SANITIZERS=ON
env:
CC: gcc-${{matrix.cc_ver}}
CXX: g++-${{matrix.cc_ver}}
BUILD_TOOLS_QT_UNIT_TESTS: "${{ matrix.cpp >= 17 && 'ON' || 'OFF' }}"

- name: Build Target
working-directory: ${{runner.workspace}}/build
Expand Down Expand Up @@ -256,7 +261,7 @@ jobs:
cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{matrix.type}} -DCMAKE_INSTALL_PREFIX=install \
-DCMAKE_PREFIX_PATH=${{runner.workspace}}/build/install -DCOMMSDSL_TESTS_CXX_STANDARD=${{matrix.cpp}} \
-DCMAKE_CXX_STANDARD=${{env.TOOLS_CXX_STANDARD}} -DCOMMSDSL_TESTS_QT_VERSION=${{matrix.qt_ver}} \
-DCOMMSDSL_BUILD_UNIT_TESTS=ON -DCOMMSDSL_TEST_BUILD_DOC=ON -DCMAKE_IGNORE_PATH=/usr/local/bin \
-DCOMMSDSL_BUILD_UNIT_TESTS=ON -DCOMMSDSL_TEST_BUILD_DOC=${{env.BUILD_TEST_DOCS}} -DCMAKE_IGNORE_PATH=/usr/local/bin \
-DCOMMSDSL_BUILD_COMMSDSL2TEST=ON -DCOMMSDSL_BUILD_COMMSDSL2TOOLS_QT=ON \
-DCOMMSDSL_BUILD_COMMSDSL2SWIG=ON -DCOMMSDSL_BUILD_COMMSDSL2EMSCRIPTEN=ON \
-DCOMMSDSL_BUILD_COMMSDSL2TOOLS_QT_TESTS=${{env.BUILD_TOOLS_QT_UNIT_TESTS}} \
Expand All @@ -265,6 +270,7 @@ jobs:
CC: gcc-${{matrix.cc_ver}}
CXX: g++-${{matrix.cc_ver}}
BUILD_TOOLS_QT_UNIT_TESTS: "${{ matrix.cpp >= 17 && 'ON' || 'OFF' }}"
BUILD_TEST_DOCS: "${{ matrix.type == 'Debug' && matrix.cpp == 11 && matrix.cc_ver == 14 && matrix.qt_ver == 5 && 'ON' || 'OFF' }}"
TOOLS_CXX_STANDARD: "${{ matrix.cpp >= 17 && matrix.cpp || '17' }}"

- name: Build Target
Expand Down Expand Up @@ -323,6 +329,7 @@ jobs:
COMMON_CXX_STANDARD: ${{matrix.cpp}}
COMMS_TAG: ${{env.COMMS_TAG}}
CC_TOOLS_QT_TAG: ${{env.CC_TOOLS_QT_TAG}}
CC_TOOLS_QT_SKIP: 1

- name: Configure CMake
shell: bash
Expand All @@ -333,11 +340,10 @@ jobs:
-DCOMMSDSL_TESTS_C_COMPILER=clang-${{matrix.cc_ver}} -DCOMMSDSL_TESTS_CXX_COMPILER=clang++-${{matrix.cc_ver}} \
-DCOMMSDSL_TESTS_CXX_STANDARD=${{matrix.cpp}} -DCOMMSDSL_BUILD_UNIT_TESTS=ON -DCOMMSDSL_TEST_USE_SANITIZERS=OFF \
-DCOMMSDSL_BUILD_COMMSDSL2TEST=ON -DCOMMSDSL_BUILD_COMMSDSL2TOOLS_QT=ON \
-DCOMMSDSL_BUILD_COMMSDSL2TOOLS_QT_TESTS=${{env.BUILD_TOOLS_QT_UNIT_TESTS}}
-DCOMMSDSL_BUILD_COMMSDSL2TOOLS_QT_TESTS=OFF
env:
CC: clang-6.0
CXX: clang++-6.0
BUILD_TOOLS_QT_UNIT_TESTS: "${{ matrix.cpp >= 17 && 'ON' || 'OFF' }}"

- name: Build Target
working-directory: ${{runner.workspace}}/build
Expand Down Expand Up @@ -390,6 +396,7 @@ jobs:
COMMON_CXX_STANDARD: ${{matrix.cpp}}
COMMS_TAG: ${{env.COMMS_TAG}}
CC_TOOLS_QT_TAG: ${{env.CC_TOOLS_QT_TAG}}
CC_TOOLS_QT_SKIP: 1

- name: Configure CMake
shell: bash
Expand All @@ -399,12 +406,11 @@ jobs:
-DCMAKE_PREFIX_PATH=${{runner.workspace}}/build/install -DCOMMSDSL_TESTS_CXX_STANDARD=${{matrix.cpp}} \
-DCMAKE_CXX_STANDARD=${{env.TOOLS_CXX_STANDARD}} -DCOMMSDSL_BUILD_UNIT_TESTS=ON \
-DCOMMSDSL_BUILD_COMMSDSL2TEST=ON -DCOMMSDSL_BUILD_COMMSDSL2TOOLS_QT=ON \
-DCOMMSDSL_BUILD_COMMSDSL2TOOLS_QT_TESTS=${{env.BUILD_TOOLS_QT_UNIT_TESTS}} \
-DCOMMSDSL_BUILD_COMMSDSL2TOOLS_QT_TESTS=OFF \
-DCOMMSDSL_BUILD_WITH_SANITIZERS=ON
env:
CC: clang-${{matrix.cc_ver}}
CXX: clang++-${{matrix.cc_ver}}
BUILD_TOOLS_QT_UNIT_TESTS: "${{ matrix.cpp >= 17 && 'ON' || 'OFF' }}"
TOOLS_CXX_STANDARD: "${{ matrix.cpp >= 17 && matrix.cpp || '17' }}"

- name: Build Target
Expand Down Expand Up @@ -576,7 +582,7 @@ jobs:
strategy:
fail-fast: false
matrix:
type: [Debug, Release, MinSizeRel]
type: [Debug, Release]
arch: [x64]
cpp: [11, 14, 17]
qt_ver: [5, 6]
Expand Down Expand Up @@ -645,7 +651,7 @@ jobs:
strategy:
fail-fast: false
matrix:
type: [Debug, Release, MinSizeRel]
type: [Debug, Release]
arch: [x64]
cpp: [11, 14, 17, 20]

Expand Down
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,20 @@ to just clone the sources of this repository and use it without
any extra manipulations of looking for the latest stable version among the tags and
checking it out.

# Asking For Help
With time the [CommsChampion Ecosystem](https://commschamp.github.io) has grown with both
features and complexity. Sometimes it can become challenging, especially for first time users,
to find a proper way to define the required binary protocol, especially quite complex ones.
The most efficient way to ask for help would be:

1. forking the official [tutorial](https://github.com/commschamp/cc_tutorial/) project on github
2. create a separate folder (say **howto100**) where the minimal portion of
the required protocol which exposes the encountered problem is defined.
3. [get in touch](#contact-information) providing an info on the forked project and encountered problem.

The suggested resolution will be provided by a pull request and/or a comment. After the problem
is resolved, the forked project can be deleted.

# Contact Information
For bug reports, feature requests, or any other question you may open an issue
here in **github** or e-mail me directly to: **[email protected]**. I usually
Expand Down
32 changes: 31 additions & 1 deletion app/commsdsl2comms/src/CommsBitfieldField.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright 2019 - 2024 (C). Alex Robenko. All rights reserved.
// Copyright 2019 - 2025 (C). Alex Robenko. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -16,6 +16,7 @@
#include "CommsBitfieldField.h"

#include "CommsGenerator.h"
#include "CommsOptionalField.h"

#include "commsdsl/gen/comms.h"
#include "commsdsl/gen/util.h"
Expand Down Expand Up @@ -167,6 +168,35 @@ std::string CommsBitfieldField::commsDefPublicCodeImpl() const
return commsAccessCodeInternal();
}

std::string CommsBitfieldField::commsDefValidFuncBodyImpl() const
{
auto validCond = bitfieldDslObj().validCond();
if (!validCond.valid()) {
return strings::emptyString();
}

auto& gen = CommsGenerator::cast(generator());
auto str = CommsOptionalField::commsDslCondToString(gen, m_members, validCond, true);

if (str.empty()) {
return strings::emptyString();
}

static const std::string Templ =
"if (!Base::valid()) {\n"
" return false;\n"
"}\n\n"
"return\n"
" #^#CODE#$#;\n"
;

util::ReplacementMap repl = {
{"CODE", std::move(str)},
};

return util::processTemplate(Templ, repl);
}

bool CommsBitfieldField::commsIsVersionDependentImpl() const
{
return
Expand Down
3 changes: 2 additions & 1 deletion app/commsdsl2comms/src/CommsBitfieldField.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright 2019 - 2024 (C). Alex Robenko. All rights reserved.
// Copyright 2019 - 2025 (C). Alex Robenko. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -51,6 +51,7 @@ class CommsBitfieldField final : public commsdsl::gen::BitfieldField, public Com
virtual std::string commsDefMembersCodeImpl() const override;
virtual std::string commsDefBaseClassImpl() const override;
virtual std::string commsDefPublicCodeImpl() const override;
virtual std::string commsDefValidFuncBodyImpl() const override;
virtual bool commsIsVersionDependentImpl() const override;
virtual std::string commsMembersCustomizationOptionsBodyImpl(FieldOptsFunc fieldOptsFunc) const override;
virtual std::string commsValueAccessStrImpl(const std::string& accStr, const std::string& prefix) const override;
Expand Down
32 changes: 31 additions & 1 deletion app/commsdsl2comms/src/CommsBundleField.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright 2019 - 2024 (C). Alex Robenko. All rights reserved.
// Copyright 2019 - 2025 (C). Alex Robenko. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -16,6 +16,7 @@
#include "CommsBundleField.h"

#include "CommsGenerator.h"
#include "CommsOptionalField.h"

#include "commsdsl/gen/comms.h"
#include "commsdsl/gen/util.h"
Expand Down Expand Up @@ -333,6 +334,35 @@ std::string CommsBundleField::commsDefRefreshFuncBodyImpl() const
return util::processTemplate(Templ, repl);
}

std::string CommsBundleField::commsDefValidFuncBodyImpl() const
{
auto validCond = bundleDslObj().validCond();
if (!validCond.valid()) {
return strings::emptyString();
}

auto& gen = CommsGenerator::cast(generator());
auto str = CommsOptionalField::commsDslCondToString(gen, m_members, validCond, true);

if (str.empty()) {
return strings::emptyString();
}

static const std::string Templ =
"if (!Base::valid()) {\n"
" return false;\n"
"}\n\n"
"return\n"
" #^#CODE#$#;\n"
;

util::ReplacementMap repl = {
{"CODE", std::move(str)},
};

return util::processTemplate(Templ, repl);
}

bool CommsBundleField::commsPrepareInternal()
{
m_members = commsTransformFieldsList(members());
Expand Down
3 changes: 2 additions & 1 deletion app/commsdsl2comms/src/CommsBundleField.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright 2019 - 2024 (C). Alex Robenko. All rights reserved.
// Copyright 2019 - 2025 (C). Alex Robenko. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -54,6 +54,7 @@ class CommsBundleField final : public commsdsl::gen::BundleField, public CommsFi
virtual std::string commsDefPrivateCodeImpl() const override;
virtual std::string commsDefReadFuncBodyImpl() const override;
virtual std::string commsDefRefreshFuncBodyImpl() const override;
virtual std::string commsDefValidFuncBodyImpl() const override;
virtual bool commsIsVersionDependentImpl() const override;
virtual std::string commsMembersCustomizationOptionsBodyImpl(FieldOptsFunc fieldOptsFunc) const override;
virtual std::size_t commsMinLengthImpl() const override;
Expand Down
2 changes: 1 addition & 1 deletion app/commsdsl2comms/src/CommsChecksumLayer.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright 2019 - 2024 (C). Alex Robenko. All rights reserved.
// Copyright 2019 - 2025 (C). Alex Robenko. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion app/commsdsl2comms/src/CommsChecksumLayer.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright 2019 - 2024 (C). Alex Robenko. All rights reserved.
// Copyright 2019 - 2025 (C). Alex Robenko. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion app/commsdsl2comms/src/CommsCmake.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright 2019 - 2024 (C). Alex Robenko. All rights reserved.
// Copyright 2019 - 2025 (C). Alex Robenko. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion app/commsdsl2comms/src/CommsCmake.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright 2019 - 2024 (C). Alex Robenko. All rights reserved.
// Copyright 2019 - 2025 (C). Alex Robenko. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion app/commsdsl2comms/src/CommsCustomLayer.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright 2019 - 2024 (C). Alex Robenko. All rights reserved.
// Copyright 2019 - 2025 (C). Alex Robenko. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion app/commsdsl2comms/src/CommsCustomLayer.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright 2019 - 2024 (C). Alex Robenko. All rights reserved.
// Copyright 2019 - 2025 (C). Alex Robenko. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
Loading

0 comments on commit 6f18da3

Please sign in to comment.