COMMS
Template library intended to help with implementation of communication protocols.
Loading...
Searching...
No Matches
version.h
Go to the documentation of this file.
1//
2// Copyright 2018 - 2026 (C). Alex Robenko. All rights reserved.
3//
4// SPDX-License-Identifier: MPL-2.0
5//
6// This Source Code Form is subject to the terms of the Mozilla Public
7// License, v. 2.0. If a copy of the MPL was not distributed with this
8// file, You can obtain one at http://mozilla.org/MPL/2.0/.
9
12
13#pragma once
14
16#define COMMS_MAJOR_VERSION 5U
17
19#define COMMS_MINOR_VERSION 5U
20
22#define COMMS_PATCH_VERSION 1U
23
25#define COMMS_MAKE_VERSION(major_, minor_, patch_) \
26 ((static_cast<unsigned>(major_) << 24) | \
27 (static_cast<unsigned>(minor_) << 8) | \
28 (static_cast<unsigned>(patch_)))
29
31#define COMMS_VERSION COMMS_MAKE_VERSION(COMMS_MAJOR_VERSION, COMMS_MINOR_VERSION, COMMS_PATCH_VERSION)
32
33namespace comms
34{
35
37inline
38constexpr unsigned versionMajor()
39{
41}
42
44inline
45constexpr unsigned versionMinor()
46{
48}
49
51inline
52constexpr unsigned versionPatch()
53{
55}
56
58inline
59constexpr unsigned versionCreate(unsigned major, unsigned minor, unsigned patch)
60{
61 return COMMS_MAKE_VERSION(major, minor, patch);
62}
63
65inline
66constexpr unsigned version()
67{
68 return COMMS_VERSION;
69}
70
71} // namespace comms
Main namespace for all classes / functions of COMMS library.
constexpr unsigned version()
Version of the COMMS library as single numeric value.
Definition version.h:66
constexpr unsigned versionCreate(unsigned major, unsigned minor, unsigned patch)
Create version of the library as single unsigned numeric value.
Definition version.h:59
constexpr unsigned versionMinor()
Minor verion of the library.
Definition version.h:45
constexpr unsigned versionPatch()
Patch level of the library.
Definition version.h:52
constexpr unsigned versionMajor()
Major verion of the library.
Definition version.h:38
#define COMMS_MAKE_VERSION(major_, minor_, patch_)
Macro to create numeric version as single unsigned number.
Definition version.h:25
#define COMMS_VERSION
Version of the COMMS library as single numeric value.
Definition version.h:31
#define COMMS_PATCH_VERSION
Patch level of the library.
Definition version.h:22
#define COMMS_MAJOR_VERSION
Major verion of the library.
Definition version.h:16
#define COMMS_MINOR_VERSION
Minor verion of the library.
Definition version.h:19