Skip to content

Commit

Permalink
Release v5.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
arobenko committed Jun 22, 2024
2 parents d410045 + ae05432 commit 4879850
Show file tree
Hide file tree
Showing 21 changed files with 570 additions and 203 deletions.
64 changes: 0 additions & 64 deletions .appveyor.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/actions_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Github Actions Build
on: [push]

env:
COMMS_TAG: v5.2.3
COMMS_TAG: v5.2.4

jobs:

Expand Down
18 changes: 10 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ option (CC_TOOLS_QT_BUILD_PLUGIN_DEMO_PROTOCOL "Build demo protocol plugin." OFF
# Extra configuration variables
# CC_TOOLS_QT_MAJOR_QT_VERSION - Major Qt version, defaults to 5.
# CC_TOOLS_QT_DEFAULT_NETWORK_PORT - Set default network port for the network plugins.
# CC_TOOLS_QT_CCACHE_EXECUTABLE - Path to ccache executable

# Used standard CMake variables
# CMAKE_CXX_STANDARD - Defaults to 17.
Expand Down Expand Up @@ -85,23 +86,24 @@ find_package(LibComms REQUIRED NO_MODULE)
#######################################################################

# Compiler options
set (warn_opt)
set (extra_opts)
if (CC_TOOLS_QT_WARN_AS_ERR)
set (warn_opt WARN_AS_ERR)
list (APPEND extra_opts WARN_AS_ERR)
endif ()

set (static_runtime_opt)
if (CC_TOOLS_QT_STATIC_RUNTIME)
set (static_runtime_opt STATIC_RUNTIME)
list (APPEND extra_opts STATIC_RUNTIME)
endif ()

set (ccache_opt)
if ((UNIX) AND (CC_TOOLS_QT_USE_CCACHE))
set (ccache_opt USE_CCACHE)
if (CC_TOOLS_QT_USE_CCACHE)
list (APPEND extra_opts USE_CCACHE)
if (NOT "${CC_TOOLS_QT_CCACHE_EXECUTABLE}" STREQUAL "")
list (APPEND extra_opts CCACHE_EXECUTABLE "${CC_TOOLS_QT_CCACHE_EXECUTABLE}")
endif ()
endif ()

include (${LibComms_DIR}/CC_Compile.cmake)
cc_compile(${warn_opt} ${static_runtime_opt} ${ccache_opt})
cc_compile(${extra_opts})
cc_msvc_force_warn_opt("/W4")

#######################################################################
Expand Down
4 changes: 3 additions & 1 deletion demo/cc_plugin/AllMessages.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include "cc_plugin/message/Optionals.h"
#include "cc_plugin/message/FloatValues.h"
#include "cc_plugin/message/Variants.h"
#include "cc_plugin/message/Bundles.h"

namespace demo
{
Expand All @@ -46,7 +47,8 @@ using AllMessages = std::tuple<
cc_plugin::message::Lists,
cc_plugin::message::Optionals,
cc_plugin::message::FloatValues,
cc_plugin::message::Variants
cc_plugin::message::Variants,
cc_plugin::message::Bundles
>;

static_assert(std::tuple_size<AllMessages>::value == MsgId_NumOfValues,
Expand Down
1 change: 1 addition & 0 deletions demo/cc_plugin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ function (cc_plugin_demo)
message/Optionals.cpp
message/FloatValues.cpp
message/Variants.cpp
message/Bundles.cpp
)

add_library (${name} MODULE ${src})
Expand Down
3 changes: 2 additions & 1 deletion demo/cc_plugin/DemoTransportMessage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ QVariantMap createMsgIdProperties()
"Lists",
"Optionals",
"FloatValues",
"Variants"
"Variants",
"Bundles",
};

static const auto NamesCount = std::extent<decltype(Names)>::value;
Expand Down
129 changes: 129 additions & 0 deletions demo/cc_plugin/message/Bundles.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
//
// Copyright 2015 - 2018 (C). Alex Robenko. All rights reserved.
//

// This file is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

#include <cassert>

#include "Bundles.h"

namespace cc = cc_tools_qt;

namespace demo
{

namespace cc_plugin
{

namespace message
{

namespace
{

using BundlesFields = demo::message::BundlesFields<>;

QVariantMap createProps_field1_mem1()
{
using Field = BundlesFields::field1_mem1;
auto props =
cc::property::field::ForField<Field>()
.name("length");
return props.asMap();
}

QVariantMap createProps_field1_mem2()
{
using Field = BundlesFields::field1_mem2;
auto props =
cc::property::field::ForField<Field>()
.name("str");
return props.asMap();
}

QVariantMap createProps_field1()
{
using Field = BundlesFields::field1;
auto props =
cc::property::field::ForField<Field>()
.name("field1")
.serialisedHidden()
.add(createProps_field1_mem1())
.add(createProps_field1_mem2());
assert(props.members().size() == Field::FieldIdx_numOfValues);
return props.asMap();
}

QVariantMap createProps_field2_mem1()
{
using Field = BundlesFields::field2_mem1;
auto props =
cc::property::field::ForField<Field>()
.name("length");
return props.asMap();
}

QVariantMap createProps_field2_mem2()
{
using Field = BundlesFields::field2_mem2;
auto props =
cc::property::field::ForField<Field>()
.name("data");
return props.asMap();
}

QVariantMap createProps_field2()
{
using Field = BundlesFields::field2;
auto props =
cc::property::field::ForField<Field>()
.name("field2")
.serialisedHidden()
.add(createProps_field2_mem1())
.add(createProps_field2_mem2());
assert(props.members().size() == Field::FieldIdx_numOfValues);
return props.asMap();
}

QVariantList createFieldsProperties()
{
QVariantList props;
props.append(createProps_field1());
props.append(createProps_field2());

assert(props.size() == Bundles::FieldIdx_numOfValues);
return props;
}

} // namespace

Bundles::Bundles() = default;
Bundles::~Bundles() noexcept = default;

Bundles& Bundles::operator=(const Bundles&) = default;
Bundles& Bundles::operator=(Bundles&&) = default;

const QVariantList& Bundles::fieldsPropertiesImpl() const
{
static const auto Props = createFieldsProperties();
return Props;
}

} // namespace message

} // namespace cc_plugin

} // namespace demo

57 changes: 57 additions & 0 deletions demo/cc_plugin/message/Bundles.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
//
// Copyright 2015 - 2018 (C). Alex Robenko. All rights reserved.
//

// This file is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.


#pragma once

#include "cc_tools_qt/cc_tools_qt.h"
#include "demo/message/Bundles.h"
#include "cc_plugin/DemoMessage.h"

namespace demo
{

namespace cc_plugin
{

namespace message
{

class Bundles : public
cc_tools_qt::ProtocolMessageBase<
demo::message::Bundles<demo::cc_plugin::DemoMessage>,
Bundles>
{
public:
Bundles();
Bundles(const Bundles&) = delete;
Bundles(Bundles&&) = delete;
virtual ~Bundles() noexcept;

Bundles& operator=(const Bundles&);
Bundles& operator=(Bundles&&);

protected:
virtual const QVariantList& fieldsPropertiesImpl() const override;
};

} // namespace message

} // namespace cc_plugin

} // namespace demo

25 changes: 25 additions & 0 deletions demo/include/demo/DefaultOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,28 @@ struct DefaultOptions
using field2 = comms::option::EmptyOption;
};

/// @brief Extra options for fields in @ref demo::message::BundlesFields struct
struct BundlesFields
{
/// @brief Extra options for @ref demo::message::BundlesFields::field1_mem1
using field1_mem1 = comms::option::EmptyOption;

/// @brief Extra options for @ref demo::message::BundlesFields::field1_mem2
using field1_mem2 = comms::option::EmptyOption;

/// @brief Extra options for @ref demo::message::BundlesFields::field1
using field1 = comms::option::EmptyOption;

/// @brief Extra options for @ref demo::message::BundlesFields::field2_mem1
using field2_mem1 = comms::option::EmptyOption;

/// @brief Extra options for @ref demo::message::BundlesFields::field2_mem2
using field2_mem2 = comms::option::EmptyOption;

/// @brief Extra options for @ref demo::message::BundlesFields::field2
using field2 = comms::option::EmptyOption;
};

/// @brief Extra options for @ref demo::message::Bitfields message
using Bitfields = comms::option::EmptyOption;

Expand All @@ -232,6 +254,9 @@ struct DefaultOptions

/// @brief Extra options for @ref demo::message::Variants message
using Variants = comms::option::EmptyOption;

/// @brief Extra options for @ref demo::message::Bundles message
using Bundles = comms::option::EmptyOption;
};
};

Expand Down
3 changes: 2 additions & 1 deletion demo/include/demo/MsgId.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright 2016 (C). Alex Robenko. All rights reserved.
// Copyright 2016 - 2024 (C). Alex Robenko. All rights reserved.
//

// This file is free software: you can redistribute it and/or modify
Expand Down Expand Up @@ -37,6 +37,7 @@ enum MsgId : std::uint8_t
MsgId_Optionals, ///< Message containing optional fields
MsgId_FloatValues, ///< Floating point values accumulating message
MsgId_Variants, ///< Variant values accumulating message
MsgId_Bundles, ///< Bundles accumulating message
MsgId_NumOfValues ///< Limit to valid message IDs, must be last
};

Expand Down
Loading

0 comments on commit 4879850

Please sign in to comment.