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 - 2024 (C). Alex Robenko. All rights reserved.
3//
4// This Source Code Form is subject to the terms of the Mozilla Public
5// License, v. 2.0. If a copy of the MPL was not distributed with this
6// file, You can obtain one at http://mozilla.org/MPL/2.0/.
7
10
11#pragma once
12
14#define COMMS_MAJOR_VERSION 5U
15
17#define COMMS_MINOR_VERSION 2U
18
20#define COMMS_PATCH_VERSION 7U
21
23#define COMMS_MAKE_VERSION(major_, minor_, patch_) \
24 ((static_cast<unsigned>(major_) << 24) | \
25 (static_cast<unsigned>(minor_) << 8) | \
26 (static_cast<unsigned>(patch_)))
27
29#define COMMS_VERSION COMMS_MAKE_VERSION(COMMS_MAJOR_VERSION, COMMS_MINOR_VERSION, COMMS_PATCH_VERSION)
30
31namespace comms
32{
33
35inline
36constexpr unsigned versionMajor()
37{
39}
40
42inline
43constexpr unsigned versionMinor()
44{
46}
47
49inline
50constexpr unsigned versionPatch()
51{
53}
54
56inline
57constexpr unsigned versionCreate(unsigned major, unsigned minor, unsigned patch)
58{
59 return COMMS_MAKE_VERSION(major, minor, patch);
60}
61
63inline
64constexpr unsigned version()
65{
66 return COMMS_VERSION;
67}
68
69} // 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:64
constexpr unsigned versionCreate(unsigned major, unsigned minor, unsigned patch)
Create version of the library as single unsigned numeric value.
Definition version.h:57
constexpr unsigned versionMinor()
Minor verion of the library.
Definition version.h:43
constexpr unsigned versionPatch()
Patch level of the library.
Definition version.h:50
constexpr unsigned versionMajor()
Major verion of the library.
Definition version.h:36
#define COMMS_MAKE_VERSION(major_, minor_, patch_)
Macro to create numeric version as single unsigned number.
Definition version.h:23
#define COMMS_VERSION
Version of the COMMS library as single numeric value.
Definition version.h:29
#define COMMS_PATCH_VERSION
Patch level of the library.
Definition version.h:20
#define COMMS_MAJOR_VERSION
Major verion of the library.
Definition version.h:14
#define COMMS_MINOR_VERSION
Minor verion of the library.
Definition version.h:17