COMMS
Template library intended to help with implementation of communication protocols.
options.h
Go to the documentation of this file.
1 //
2 // Copyright 2014 - 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 
13 #include <tuple>
14 #include <type_traits>
15 #include <limits>
16 #include <ratio>
17 #include <cstdint>
18 #include <cstddef>
19 
20 #include "comms/traits.h"
21 #include "comms/ErrorStatus.h"
23 #include "comms/util/type_traits.h"
24 
25 namespace comms
26 {
27 
28 namespace option
29 {
30 
31 namespace details
32 {
33 
34 template <typename T>
35 struct IsRatio
36 {
37  static const bool Value = false;
38 };
39 
40 template <std::intmax_t TNum, std::intmax_t TDen>
41 struct IsRatio<std::ratio<TNum, TDen> >
42 {
43  static const bool Value = true;
44 };
45 
46 template <typename T>
47 constexpr bool isRatio()
48 {
49  return IsRatio<T>::Value;
50 }
51 
52 template<typename T, T TVal>
53 struct DefaultNumValueInitialiser
54 {
55  template <typename TField>
56  void operator()(TField&& field)
57  {
58  using FieldType = typename std::decay<TField>::type;
59  using ValueType = typename FieldType::ValueType;
60  field.value() = static_cast<ValueType>(TVal);
61  }
62 };
63 
64 template<std::intmax_t TMinValue, std::intmax_t TMaxValue>
65 struct NumValueRangeValidator
66 {
67  static_assert(
68  TMinValue <= TMaxValue,
69  "Min value must be not greater than Max value");
70 
71  template <typename TField>
72  constexpr bool operator()(const TField& field) const
73  {
74  using MinTag =
75  typename comms::util::Conditional<
76  (std::numeric_limits<decltype(MinValue)>::min() < MinValue)
77  >::template Type<
78  CompareTag,
79  ReturnTrueTag
80  >;
81 
82  using MaxTag =
83  typename comms::util::Conditional<
84  (MaxValue < std::numeric_limits<decltype(MaxValue)>::max())
85  >::template Type<
86  CompareTag,
87  ReturnTrueTag
88  >::type;
89 
90  return aboveMin(field.value(), MinTag()) && belowMax(field.value(), MaxTag());
91  }
92 
93 private:
94  struct ReturnTrueTag {};
95  struct CompareTag {};
96 
97  template <typename TValue>
98  static constexpr bool aboveMin(const TValue& value, CompareTag)
99  {
100  using ValueType = typename std::decay<decltype(value)>::type;
101  return (static_cast<ValueType>(MinValue) <= static_cast<ValueType>(value));
102  }
103 
104  template <typename TValue>
105  static constexpr bool aboveMin(const TValue&, ReturnTrueTag)
106  {
107  return true;
108  }
109 
110  template <typename TValue>
111  static constexpr bool belowMax(const TValue& value, CompareTag)
112  {
113  using ValueType = typename std::decay<decltype(value)>::type;
114  return (value <= static_cast<ValueType>(MaxValue));
115  }
116 
117  template <typename TValue>
118  static constexpr bool belowMax(const TValue&, ReturnTrueTag)
119  {
120  return true;
121  }
122 
123 
124  static const auto MinValue = TMinValue;
125  static const auto MaxValue = TMaxValue;
126 };
127 
128 template<std::uintmax_t TMask, std::uintmax_t TValue>
129 struct BitmaskReservedBitsValidator
130 {
131  template <typename TField>
132  constexpr bool operator()(TField&& field) const
133  {
134  using FieldType = typename std::decay<TField>::type;
135  using ValueType = typename FieldType::ValueType;
136 
137  return (field.value() & static_cast<ValueType>(TMask)) == static_cast<ValueType>(TValue);
138  }
139 };
140 
141 template <comms::field::OptionalMode TVal>
142 struct DefaultOptModeInitialiser
143 {
144  template <typename TField>
145  void operator()(TField& field) const
146  {
147  field.setMode(TVal);
148  }
149 };
150 
151 template<std::size_t TIdx>
152 struct DefaultVariantIndexInitialiser
153 {
154  template <typename TField>
155  void operator()(TField& field)
156  {
157  field.template initField<TIdx>();
158  }
159 };
160 
161 } // namespace details
162 
163 
164 namespace def {
165 
170 template <typename TEndian>
171 struct Endian
172 {
173 };
174 
178 
182 
186 template <typename T>
187 struct MsgIdType {};
188 
192 template <std::intmax_t TId>
193 struct StaticNumIdImpl {};
194 
197 struct NoIdImpl {};
198 
201 template <typename TMsg>
202 struct MsgType {};
203 
206 template <typename TField>
207 struct FieldType {};
208 
217 template <typename TFields>
219 
225 template <std::size_t TIdx>
227 
233 template <typename TFields>
234 struct FieldsImpl;
235 
237 template <typename... TFields>
238 struct FieldsImpl<std::tuple<TFields...> >
239 {
240 };
242 
246 
250 struct HasDoGetId {};
251 
258 
279 template<std::size_t TLen, bool TSignExtend = true>
280 struct FixedLength {};
281 
309 template<std::size_t TLen, bool TSignExtend = true>
310 struct FixedBitLength {};
311 
335 template<std::size_t TMin, std::size_t TMax>
336 struct VarLength
337 {
338  static_assert(TMin <= TMax, "TMin must not be greater that TMax.");
339 };
340 
347 {
348 };
349 
377 template<std::intmax_t TOffset>
379 
408 template <std::intmax_t TNum, std::intmax_t TDenom>
410 {
411  static_assert(TNum != 0, "Wrong scaling ratio");
412  static_assert(TDenom != 0, "Wrong scaling ratio");
413 };
414 
437 template <typename TField>
439 
464 template <typename TField, comms::ErrorStatus TReadErrorStatus = comms::ErrorStatus::InvalidMsgData>
466 
474 template <typename TField, comms::ErrorStatus TReadErrorStatus = comms::ErrorStatus::InvalidMsgData>
476 
486 template <typename TField, comms::ErrorStatus TReadErrorStatus = comms::ErrorStatus::InvalidMsgData>
488 
506 template <typename TField>
508 
530 template <typename TField>
532 
545 
559 
571 
578 template <std::size_t TSize>
580 
615 template <typename T>
617 
661 template <typename T>
663 
673 template <comms::ErrorStatus TStatus = comms::ErrorStatus::InvalidMsgData>
674 struct FailOnInvalid {};
675 
683 struct IgnoreInvalid {};
684 
691 template <typename TType, typename TRatio>
692 struct Units
693 {
694  static_assert(details::isRatio<TRatio>(),
695  "TRatio parameter must be a variant of std::ratio");
696 
697  static_assert(TRatio::num != 0, "Wrong ratio value");
698  static_assert(TRatio::den != 0, "Wrong ratio value");
699 };
700 
705 
710 
715 
720 
725 
728 using UnitsHours =
730 
733 using UnitsDays =
735 
738 using UnitsWeeks =
740 
745 
750 
755 
760 
763 using UnitsMeters =
765 
770 
775 
780 
785 
790 
795 
800 
805 
808 using UnitsHertz =
810 
815 
820 
825 
830 
835 
840 
845 
850 
853 using UnitsAmps =
855 
860 
865 
870 
875 
878 using UnitsVolts =
880 
885 
888 using UnitsBytes =
890 
895 
900 
905 
910 
919 template<std::intmax_t TVal>
922  details::DefaultNumValueInitialiser<std::intmax_t, TVal>
923  >;
924 
933 template<std::uintmax_t TVal>
936  details::DefaultNumValueInitialiser<std::uintmax_t, TVal>
937  >;
938 
954 template<std::intmax_t TMinValue, std::intmax_t TMaxValue>
956 {
957  static_assert(TMinValue <= TMaxValue, "Invalid range");
958 };
959 
962 
968 template<std::intmax_t TMinValue, std::intmax_t TMaxValue>
970  std::tuple<
973  >;
974 
977 template<std::intmax_t TValue>
979 
983 template<std::intmax_t TValue>
985 
999 template<std::uintmax_t TMinValue, std::uintmax_t TMaxValue>
1001 {
1002  static_assert(TMinValue <= TMaxValue, "Invalid range");
1003 };
1004 
1010 template<std::uintmax_t TMinValue, std::uintmax_t TMaxValue>
1012  std::tuple<
1015  >;
1016 
1019 template<std::uintmax_t TValue>
1021 
1025 template<std::uintmax_t TValue>
1027 
1039 template<std::uintmax_t TMask, std::uintmax_t TValue = 0U>
1041 
1048 template<comms::field::OptionalMode TVal>
1050 
1057 
1064 
1067 
1070 
1075 template <std::size_t TIdx>
1077 
1083 
1093 
1098 
1106 
1114 
1123 
1127 struct HasCustomRead {};
1128 
1133 
1137 struct HasCustomWrite {};
1138 
1141 struct HasName {};
1142 
1149 
1152 struct PseudoValue {};
1153 
1157 template <typename T>
1159 {
1160  static_assert(std::is_integral<T>::value, "Only unsigned integral types are supported for versions");
1161  static_assert(std::is_unsigned<T>::value, "Only unsigned integral types are supported for versions");
1162 };
1163 
1168 
1175 template <std::uintmax_t TFrom, std::uintmax_t TUntil>
1177 {
1178  static_assert(TFrom <= TUntil, "Invalid version parameters");
1179 };
1180 
1186 template <std::uintmax_t TVer>
1188 
1194 template <std::uintmax_t TVer>
1196 
1200 
1204 struct VersionStorage {};
1205 
1209 template <typename T>
1210 struct ExtendingClass {};
1211 
1215 template <std::size_t TIdx>
1217 
1222 
1227 
1233 
1240 template <bool TVersionDependent>
1242 
1243 } // namespace def
1244 
1245 namespace app
1246 {
1247 
1250 struct EmptyOption {};
1251 
1255 template <typename TIter>
1256 struct ReadIterator {};
1257 
1261 template <typename TIter>
1262 struct WriteIterator {};
1263 
1267 
1271 
1275 
1279 
1282 struct NameInterface {};
1283 
1287 template <typename T>
1288 struct Handler {};
1289 
1293 struct NoDispatchImpl {};
1294 
1298 struct NoReadImpl {};
1299 
1303 struct NoWriteImpl {};
1304 
1308 struct NoValidImpl {};
1309 
1313 struct NoLengthImpl {};
1314 
1318 struct NoRefreshImpl {};
1319 
1324 
1329 template <typename TGenericMessage>
1331 
1345 template <std::size_t TSize>
1347 
1362 template <typename TType>
1364 
1373 
1378 
1399 struct OrigDataView {};
1400 
1403 template <typename T>
1404 struct ForceDispatch {};
1405 
1409 
1413 
1417 
1421 template <typename TFactory>
1422 struct MsgFactory {};
1423 
1429 template <template<typename, typename, typename...> class TFactory>
1431 
1432 } // namespace app
1433 
1434 // Definition options
1435 
1437 template <typename TEndian>
1439 
1442 
1445 
1447 template <typename T>
1449 
1451 template <std::intmax_t TId>
1453 
1456 
1458 template <typename TMsg>
1460 
1462 template <typename TMsg>
1464 
1466 template <typename TFields>
1468 
1470 template <std::size_t TIdx>
1472 
1474 template <typename TFields>
1476 
1479 
1482 
1485 
1487 template<std::size_t TLen, bool TSignExtend = true>
1489 
1491 template<std::size_t TLen, bool TSignExtend = true>
1493 
1495 template<std::size_t TMin, std::size_t TMax>
1497 
1499 template<std::intmax_t TOffset>
1501 
1503 template <std::intmax_t TNum, std::intmax_t TDenom>
1505 
1507 template <typename TField>
1509 
1511 template <typename TField, comms::ErrorStatus TReadErrorStatus = comms::ErrorStatus::InvalidMsgData>
1514 
1516 template <typename TField, comms::ErrorStatus TReadErrorStatus = comms::ErrorStatus::InvalidMsgData>
1519 
1521 template <typename TField, comms::ErrorStatus TReadErrorStatus = comms::ErrorStatus::InvalidMsgData>
1524 
1526 template <typename TField>
1528 
1530 template <typename TField>
1532 
1535 
1538 
1541 
1543 template <std::size_t TSize>
1545 
1547 template <typename T>
1549 
1551 template <comms::ErrorStatus TStatus = comms::ErrorStatus::InvalidMsgData>
1553 
1556 
1558 template <typename TType, typename TRatio>
1560 
1563 
1566 
1569 
1572 
1575 
1578 
1581 
1584 
1587 
1590 
1593 
1596 
1599 
1602 
1605 
1608 
1611 
1614 
1617 
1620 
1623 
1626 
1629 
1632 
1635 
1638 
1641 
1644 
1647 
1650 
1653 
1656 
1659 
1662 
1665 
1668 
1671 
1674 
1677 
1680 
1683 
1686 
1688 template<std::intmax_t TVal>
1690 
1692 template<std::uintmax_t TVal>
1694 
1696 template<std::intmax_t TMinValue, std::intmax_t TMaxValue>
1698 
1701 
1704 template<std::intmax_t TMinValue, std::intmax_t TMaxValue>
1706 
1708 template<std::intmax_t TValue>
1710 
1713 template<std::intmax_t TValue>
1715 
1717 template<std::uintmax_t TMinValue, std::uintmax_t TMaxValue>
1720 
1723 template<std::uintmax_t TMinValue, std::uintmax_t TMaxValue>
1726 
1728 template<std::uintmax_t TValue>
1731 
1734 template<std::uintmax_t TValue>
1737 
1739 template<std::uintmax_t TMask, std::uintmax_t TValue = 0U>
1741 
1743 template<comms::field::OptionalMode TVal>
1745 
1748 
1751 
1754 
1757 
1759 template <std::size_t TIdx>
1761 
1764 
1767 
1770 
1774 
1778 
1781 
1784 
1787 
1791 
1794 
1796 template <typename T>
1798 
1801 
1803 template <std::uintmax_t TFrom, std::uintmax_t TUntil>
1805 
1807 template <std::uintmax_t TVer>
1809 
1811 template <std::uintmax_t TVer>
1813 
1816 
1819 
1821 template <typename T>
1823 
1825 template <std::size_t TIdx>
1827 
1828 // Application customization options
1829 
1832 
1834 template <typename TIter>
1836 
1838 template <typename TIter>
1840 
1843 
1846 
1849 
1852 
1855 
1857 template <typename T>
1859 
1862 
1865 
1868 
1871 
1874 
1877 
1880 
1882 template <typename TGenericMessage>
1884 
1886 template <std::size_t TSize>
1888 
1890 template <typename TType>
1892 
1895 
1898 
1901 
1903 template <typename T>
1905 
1908 
1911 
1914 
1915 } // namespace option
1916 
1917 } // namespace comms
1918 
1919 
This file contain definition of error statuses used by comms module.
Contains definition of the mode used for comms::field::Optional fields.
ForceDispatch< comms::traits::dispatch::LinearSwitch > ForceDispatchLinearSwitch
Force generation of linear switch statmenets for dispatch logic of message object and/or message obje...
Definition: options.h:1416
ForceDispatch< comms::traits::dispatch::StaticBinSearch > ForceDispatchStaticBinSearch
Force generation of static binary search dispatch logic for message object and/or message object type...
Definition: options.h:1412
ForceDispatch< comms::traits::dispatch::Polymorphic > ForceDispatchPolymorphic
Force generation of v-tables and polymorphic dispatch logic for message object and/or message object ...
Definition: options.h:1408
Units< comms::traits::units::Speed, comms::traits::units::KilometersPerSecondRatio > UnitsKilometersPerSecond
Alias option, specifying field value units are "kilometers per second".
Definition: options.h:799
std::tuple< ValidBigUnsignedNumValueRange< TMinValue, TMaxValue >, ValidRangesClear > ValidBigUnsignedNumValueRangeOverride
Similar to ValidBigUnsignedNumValueRange, but overrides (nullifies) all previously set valid values r...
Definition: options.h:1015
Units< comms::traits::units::Distance, comms::traits::units::MicrometersRatio > UnitsMicrometers
Alias option, specifying field value units are "micrometers".
Definition: options.h:749
Units< comms::traits::units::Time, comms::traits::units::HoursRatio > UnitsHours
Alias option, specifying field value units are "hours".
Definition: options.h:729
Units< comms::traits::units::Frequency, comms::traits::units::MegaHzRatio > UnitsMegahertz
Alias option, specifying field value units are "megahertz".
Definition: options.h:819
Units< comms::traits::units::Time, comms::traits::units::MinutesRatio > UnitsMinutes
Alias option, specifying field value units are "minutes".
Definition: options.h:724
Units< comms::traits::units::Speed, comms::traits::units::KilometersPerHourRatio > UnitsKilometersPerHour
Alias option, specifying field value units are "kilometers per hour".
Definition: options.h:804
Units< comms::traits::units::Current, comms::traits::units::NanoampsRatio > UnitsNanoamps
Alias option, specifying field value units are "nanoamps".
Definition: options.h:839
Units< comms::traits::units::Time, comms::traits::units::WeeksRatio > UnitsWeeks
Alias option, specifying field value units are "weeks".
Definition: options.h:739
Units< comms::traits::units::Memory, comms::traits::units::TerabytesRatio > UnitsTerabytes
Alias option, specifying field value units are "terabytes".
Definition: options.h:909
Units< comms::traits::units::Memory, comms::traits::units::BytesRatio > UnitsBytes
Alias option, specifying field value units are "bytes".
Definition: options.h:889
Units< comms::traits::units::Frequency, comms::traits::units::GigaHzRatio > UnitsGigahertz
Alias option, specifying field value units are "gigahertz".
Definition: options.h:824
Units< comms::traits::units::Distance, comms::traits::units::MillimetersRatio > UnitsMillimeters
Alias option, specifying field value units are "millimeters".
Definition: options.h:754
Units< comms::traits::units::Time, comms::traits::units::MillisecondsRatio > UnitsMilliseconds
Alias option, specifying field value units are "milliseconds".
Definition: options.h:714
Units< comms::traits::units::Speed, comms::traits::units::MillimetersPerSecondRatio > UnitsMillimetersPerSecond
Alias option, specifying field value units are "millimeters per second".
Definition: options.h:784
Units< comms::traits::units::Time, comms::traits::units::DaysRatio > UnitsDays
Alias option, specifying field value units are "days".
Definition: options.h:734
Units< comms::traits::units::Distance, comms::traits::units::KilometersRatio > UnitsKilometers
Alias option, specifying field value units are "kilometers".
Definition: options.h:769
std::tuple< ValidNumValueRange< TMinValue, TMaxValue >, ValidRangesClear > ValidNumValueRangeOverride
Similar to ValidNumValueRange, but overrides (nullifies) all previously set valid values ranges.
Definition: options.h:973
Units< comms::traits::units::Speed, comms::traits::units::MicrometersPerSecondRatio > UnitsMicrometersPerSecond
Alias option, specifying field value units are "micrometers per second".
Definition: options.h:779
Units< comms::traits::units::Speed, comms::traits::units::CentimetersPerSecondRatio > UnitsCentimetersPerSecond
Alias option, specifying field value units are "centimeters per second".
Definition: options.h:789
Units< comms::traits::units::Voltage, comms::traits::units::NanovoltsRatio > UnitsNanovolts
Alias option, specifying field value units are "nanovolts".
Definition: options.h:864
Units< comms::traits::units::Voltage, comms::traits::units::KilovoltsRatio > UnitsKilovolts
Alias option, specifying field value units are "kilovolts".
Definition: options.h:884
Units< comms::traits::units::Angle, comms::traits::units::DegreesRatio > UnitsDegrees
Alias option, specifying field value units are "degrees".
Definition: options.h:829
Endian< comms::traits::endian::Big > BigEndian
Alias option to Endian specifying Big endian.
Definition: options.h:177
Units< comms::traits::units::Frequency, comms::traits::units::KiloHzRatio > UnitsKilohertz
Alias option, specifying field value units are "kilohertz".
Definition: options.h:814
Units< comms::traits::units::Distance, comms::traits::units::NanometersRatio > UnitsNanometers
Alias option, specifying field value units are "nanometers".
Definition: options.h:744
Units< comms::traits::units::Speed, comms::traits::units::NanometersPerSecondRatio > UnitsNanometersPerSecond
Alias option, specifying field value units are "nanometers per second".
Definition: options.h:774
DefaultOptionalMode< comms::field::OptionalMode::Missing > MissingByDefault
Alias to DefaultOptionalMode.
Definition: options.h:1056
ValidNumValueRangeOverride< TValue, TValue > ValidNumValueOverride
Alias to ValidNumValueRangeOverride.
Definition: options.h:984
Units< comms::traits::units::Voltage, comms::traits::units::VoltsRatio > UnitsVolts
Alias option, specifying field value units are "volts".
Definition: options.h:879
HasCustomRefresh HasDoRefresh
Option that notifies comms::MessageBase about existence of custom refresh functionality in derived cl...
Definition: options.h:1148
Units< comms::traits::units::Current, comms::traits::units::AmpsRatio > UnitsAmps
Alias option, specifying field value units are "amps".
Definition: options.h:854
Units< comms::traits::units::Angle, comms::traits::units::RadiansRatio > UnitsRadians
Alias option, specifying field value units are "radians".
Definition: options.h:834
Units< comms::traits::units::Frequency, comms::traits::units::HzRatio > UnitsHertz
Alias option, specifying field value units are "hertz".
Definition: options.h:809
Units< comms::traits::units::Voltage, comms::traits::units::MillivoltsRatio > UnitsMillivolts
Alias option, specifying field value units are "millivolts".
Definition: options.h:874
EmptySerialization EmptySerialisation
Same as EmptySerialization.
Definition: options.h:1097
Units< comms::traits::units::Current, comms::traits::units::MicroampsRatio > UnitsMicroamps
Alias option, specifying field value units are "microamps".
Definition: options.h:844
MissingByDefault OptionalMissingByDefault
Alias to DefaultOptionalMode<comms::field::OptinalMode::Missing>
Definition: options.h:1066
Units< comms::traits::units::Distance, comms::traits::units::MetersRatio > UnitsMeters
Alias option, specifying field value units are "meters".
Definition: options.h:764
Units< comms::traits::units::Memory, comms::traits::units::KilobytesRatio > UnitsKilobytes
Alias option, specifying field value units are "kilobytes".
Definition: options.h:894
Units< comms::traits::units::Current, comms::traits::units::KiloampsRatio > UnitsKiloamps
Alias option, specifying field value units are "kiloamps".
Definition: options.h:859
Units< comms::traits::units::Voltage, comms::traits::units::MicrovoltsRatio > UnitsMicrovolts
Alias option, specifying field value units are "microvolts".
Definition: options.h:869
Units< comms::traits::units::Memory, comms::traits::units::MegabytesRatio > UnitsMegabytes
Alias option, specifying field value units are "megabytes".
Definition: options.h:899
Units< comms::traits::units::Time, comms::traits::units::MicrosecondsRatio > UnitsMicroseconds
Alias option, specifying field value units are "microseconds".
Definition: options.h:709
Units< comms::traits::units::Time, comms::traits::units::NanosecondsRatio > UnitsNanoseconds
Alias option, specifying field value units are "nanoseconds".
Definition: options.h:704
Units< comms::traits::units::Distance, comms::traits::units::CentimetersRatio > UnitsCentimeters
Alias option, specifying field value units are "centimeters".
Definition: options.h:759
DefaultOptionalMode< comms::field::OptionalMode::Exists > ExistsByDefault
Alias to DefaultOptionalMode.
Definition: options.h:1063
Units< comms::traits::units::Current, comms::traits::units::MilliampsRatio > UnitsMilliamps
Alias option, specifying field value units are "milliamps".
Definition: options.h:849
ValidBigUnsignedNumValueRangeOverride< TValue, TValue > ValidBigUnsignedNumValueOverride
Alias to ValidBigUnsignedNumValueRangeOverride.
Definition: options.h:1026
Units< comms::traits::units::Speed, comms::traits::units::MetersPerSecondRatio > UnitsMetersPerSecond
Alias option, specifying field value units are "meters per second".
Definition: options.h:794
FieldsImpl< std::tuple<> > ZeroFieldsImpl
Alias to FieldsImpl<std::tuple<> >
Definition: options.h:245
Endian< comms::traits::endian::Little > LittleEndian
Alias option to Endian specifying Little endian.
Definition: options.h:181
Units< comms::traits::units::Time, comms::traits::units::SecondsRatio > UnitsSeconds
Alias option, specifying field value units are "seconds".
Definition: options.h:719
Units< comms::traits::units::Memory, comms::traits::units::GigabytesRatio > UnitsGigabytes
Alias option, specifying field value units are "gigabytes".
Definition: options.h:904
comms::option::app::IdInfoInterface IdInfoInterface
Same as comms::option::app::IdInfoInterface.
Definition: options.h:1842
comms::option::def::HasName HasName
Same as comms::option::def::HasName.
Definition: options.h:1786
comms::option::app::NoVirtualDestructor NoVirtualDestructor
Same as comms::option::app::NoVirtualDestructor.
Definition: options.h:1897
comms::option::app::SequenceFixedSizeUseFixedSizeStorage SequenceFixedSizeUseFixedSizeStorage
Same as comms::option::app::SequenceFixedSizeUseFixedSizeStorage.
Definition: options.h:1894
comms::option::def::AssumeFieldsExistence AssumeFieldsExistence
Same as comms::option::def::AssumeFieldsExistence.
Definition: options.h:1484
comms::option::def::ValidNumValueOverride< TValue > ValidNumValueOverride
Same as comms::option::def::ValidNumValueOverride.
Definition: options.h:1714
comms::option::def::ValidBigUnsignedNumValueOverride< TValue > ValidBigUnsignedNumValueOverride
Same as comms::option::def::ValidBigUnsignedNumValueOverride.
Definition: options.h:1736
comms::option::def::NoIdImpl NoIdImpl
Same as comms::option::def::NoIdImpl.
Definition: options.h:1455
comms::option::app::NoReadImpl NoReadImpl
Same as comms::option::app::NoReadImpl.
Definition: options.h:1864
comms::option::def::SequenceSizeForcingEnabled SequenceSizeForcingEnabled
Same as comms::option::def::SequenceSizeForcingEnabled.
Definition: options.h:1534
comms::option::def::ValidBigUnsignedNumValueRangeOverride< TMinValue, TMaxValue > ValidBigUnsignedNumValueRangeOverride
Same as comms::option::def::ValidBigUnsignedNumValueRangeOverride.
Definition: options.h:1725
comms::option::app::ValidCheckInterface ValidCheckInterface
Same as comms::option::app::ValidCheckInterface.
Definition: options.h:1845
comms::option::app::NoRefreshImpl NoRefreshImpl
Same as comms::option::app::NoRefreshImpl.
Definition: options.h:1876
comms::option::def::InvalidByDefault InvalidByDefault
Same as comms::option::def::InvalidByDefault.
Definition: options.h:1815
comms::option::def::ValidRangesClear ValidRangesClear
Same as comms::option::def::ValidRangesClear.
Definition: options.h:1700
comms::option::def::SequenceElemLengthForcingEnabled SequenceElemLengthForcingEnabled
Same as comms::option::def::SequenceElemLengthForcingEnabled.
Definition: options.h:1540
comms::option::def::ChecksumLayerVerifyBeforeRead ChecksumLayerVerifyBeforeRead
Same as comms::option::def::ChecksumLayerVerifyBeforeRead.
Definition: options.h:1763
comms::option::app::NameInterface NameInterface
Same as comms::option::app::NameInterface.
Definition: options.h:1854
comms::option::def::EmptySerialization EmptySerialization
Same as comms::option::def::EmptySerialization.
Definition: options.h:1766
comms::option::app::EmptyOption EmptyOption
Same as comms::option::app::EmptyOption.
Definition: options.h:1831
comms::option::def::SequenceLengthForcingEnabled SequenceLengthForcingEnabled
Same as comms::option::def::SequenceLengthForcingEnabled.
Definition: options.h:1537
comms::option::app::InPlaceAllocation InPlaceAllocation
Same as comms::option::app::InPlaceAllocation.
Definition: options.h:1879
comms::option::app::RefreshInterface RefreshInterface
Same as comms::option::app::RefreshInterface.
Definition: options.h:1851
comms::option::def::HasCustomVersionUpdate HasCustomVersionUpdate
Same as comms::option::def::HasCustomVersionUpdate.
Definition: options.h:1800
comms::option::app::OrigDataView OrigDataView
Same as comms::option::app::OrigDataView.
Definition: options.h:1900
comms::option::def::HasCustomRead HasCustomRead
Same as comms::option::def::HasCustomRead.
Definition: options.h:1780
comms::option::def::ProtocolLayerForceReadUntilDataSplit ProtocolLayerForceReadUntilDataSplit
Same as comms::option::def::ProtocolLayerForceReadUntilDataSplit.
Definition: options.h:1773
comms::option::def::HasDoGetId HasDoGetId
Same as comms::option::def::HasDoGetId.
Definition: options.h:1481
comms::option::app::NoLengthImpl NoLengthImpl
Same as comms::option::app::NoLengthImpl.
Definition: options.h:1873
comms::option::def::FieldType< TMsg > FieldType
Same as comms::option::def::FieldType.
Definition: options.h:1463
comms::option::def::PseudoValue PseudoValue
Same as comms::option::def::PseudoValue.
Definition: options.h:1793
comms::option::app::NoDispatchImpl NoDispatchImpl
Same as comms::option::app::NoDispatchImpl.
Definition: options.h:1861
comms::option::def::IgnoreInvalid IgnoreInvalid
Same as comms::option::def::IgnoreInvalid.
Definition: options.h:1555
comms::option::app::LengthInfoInterface LengthInfoInterface
Same as comms::option::app::LengthInfoInterface.
Definition: options.h:1848
comms::option::def::HasCustomRefresh HasCustomRefresh
Same as comms::option::def::HasCustomRefresh.
Definition: options.h:1783
comms::option::app::NoValidImpl NoValidImpl
Same as comms::option::app::NoValidImpl.
Definition: options.h:1870
comms::option::app::NoWriteImpl NoWriteImpl
Same as comms::option::app::NoWriteImpl.
Definition: options.h:1867
comms::option::def::ProtocolLayerDisallowReadUntilDataSplit ProtocolLayerDisallowReadUntilDataSplit
Same as comms::option::def::ProtocolLayerDisallowReadUntilDataSplit.
Definition: options.h:1777
comms::option::def::ValidNumValueRangeOverride< TMinValue, TMaxValue > ValidNumValueRangeOverride
Same as comms::option::def::ValidNumValueRangeOverride.
Definition: options.h:1705
comms::option::def::VersionStorage VersionStorage
Same as comms::option::def::VersionStorage.
Definition: options.h:1818
Main namespace for all classes / functions of COMMS library.
Set custom storage type for fields like comms::field::String or comms::field::ArrayList.
Definition: options.h:1363
No-op option, doesn't have any effect.
Definition: options.h:1250
Option that forces usage of embedded uninitialised data area instead of dynamic memory allocation.
Definition: options.h:1346
Force a particular way to dispatch message object and/or type.
Definition: options.h:1404
Option used to specify type of the message handler.
Definition: options.h:1288
Option used to add getId() function into Message interface.
Definition: options.h:1266
Option that forces "in place" allocation with placement "new" for initialisation, instead of usage of...
Definition: options.h:1323
Option used to add length() function into Message interface.
Definition: options.h:1274
Force usage of the provide message factory.
Definition: options.h:1430
Force usage of the provide message factory.
Definition: options.h:1422
Option used to add name() function into Message interface.
Definition: options.h:1282
Option used to inhibit default implementation of dispatchImpl() in comms::MessageBase.
Definition: options.h:1293
Option that inhibits implementation of comms::MessageBase::lengthImpl() regardless of other availabil...
Definition: options.h:1313
Option that inhibits implementation of comms::MessageBase::readImpl() regardless of other availabilit...
Definition: options.h:1298
Option that inhibits implementation of comms::MessageBase::refreshImpl() regardless of other availabi...
Definition: options.h:1318
Option that inhibits implementation of comms::MessageBase::validImpl() regardless of other availabili...
Definition: options.h:1308
Force the destructor of comms::Message class to be non-virtual, even if there are other virtual funct...
Definition: options.h:1377
Option that inhibits implementation of comms::MessageBase::writeImpl() regardless of other availabili...
Definition: options.h:1303
Use "view" on original raw data instead of copying it.
Definition: options.h:1399
Option used to specify type of iterator used for reading.
Definition: options.h:1256
Option used to add refresh() function into Message interface.
Definition: options.h:1278
Option that forces usage of fixed size storage for sequences with fixed size.
Definition: options.h:1372
Option used to allow comms::GenericMessage generation inside comms::MsgFactory and/or comms::protocol...
Definition: options.h:1330
Option used to add valid() function into Message interface.
Definition: options.h:1270
Option used to specify type of iterator used for writing.
Definition: options.h:1262
Option that notifies comms::MessageBase about existence of access to fields.
Definition: options.h:257
Option used to specify that serialization length can be contolled by available data length.
Definition: options.h:347
Force comms::protocol::ChecksumLayer and comms::protocol::ChecksumPrefixLayer, to verify checksum pri...
Definition: options.h:1082
Option that specifies custom validation class.
Definition: options.h:662
Option that specifies default initialisation class.
Definition: options.h:616
Force field not to be serialized during read/write operations.
Definition: options.h:1092
Options to specify endian.
Definition: options.h:172
Mark an comms::field::Optional field as existing between specified versions.
Definition: options.h:1177
Option to specify real extending class.
Definition: options.h:1210
Option used to specify some extra fields from transport framing.
Definition: options.h:218
Option that forces field's read operation to fail if invalid value is received.
Definition: options.h:674
Option used to specify actual type of the field.
Definition: options.h:207
Option used to specify fields of the message and force implementation of default read,...
Definition: options.h:234
Option used to specify number of bits that is used for field serialisation when a field is a member o...
Definition: options.h:310
Option used to specify number of bytes that is used for field serialisation.
Definition: options.h:280
Mark field class to have custom implementation of read functionality.
Definition: options.h:1127
Mark message / field class to have custom implementation of refresh functionality.
Definition: options.h:1132
Mark message / field class to have custom implementation of version update functionality.
Definition: options.h:1167
Mark field class to have custom implementation of read functionality.
Definition: options.h:1137
Option that notifies comms::MessageBase about existence of doGetId() member function in derived class...
Definition: options.h:250
Mark message class as providing its name information.
Definition: options.h:1141
Mark complex fields like comms::field::Bundle or comms::field::Variant that their members are or are ...
Definition: options.h:1241
Option that forces field's read operation to ignore read data if invalid value is received.
Definition: options.h:683
Make the field's contents to be invalid by default.
Definition: options.h:1199
Mark an comms::field::Optional field as missing if its contents are invalid (member field has invalid...
Definition: options.h:1226
Mark an comms::field::Optional field as missing if its read operation fails.
Definition: options.h:1221
Option used to specify type of the ID.
Definition: options.h:187
Option used to specify actual type of the message.
Definition: options.h:202
Option used to specify that message doesn't have valid ID.
Definition: options.h:197
Option to specify numeric value serialisation offset.
Definition: options.h:378
Disallow usage of ProtocolLayerForceReadUntilDataSplit option in earlier (outer wrapping) layers.
Definition: options.h:1122
Option to force comms::protocol::ProtocolLayerBase class to split read operation "until" and "from" d...
Definition: options.h:1105
Option to forcefully disable passing the ProtocolLayerForceReadUntilDataSplit option to the layer def...
Definition: options.h:1113
Option for comms::protocol::TransportValueLayer to mark that the handled field is a "pseudo" one,...
Definition: options.h:1152
Option to specify index of member field containing remaining length in bytes.
Definition: options.h:1216
Option to specify scaling ratio.
Definition: options.h:410
Option that forces first element only of comms::field::ArrayList to be prefixed with its serialisatio...
Definition: options.h:487
Option to enable external forcing of the collection element serialisation length.
Definition: options.h:570
Option that forces every element of comms::field::ArrayList to be prefixed with its serialisation len...
Definition: options.h:475
Option used to define exact number of elements in the collection field.
Definition: options.h:579
Option to enable external forcing of the collection's serialisation length duting "read" operation.
Definition: options.h:558
Option that modifies the default behaviour of collection fields to prepend the serialised data with n...
Definition: options.h:465
Option that modifies the default behaviour of collection fields to prepend the serialised data with n...
Definition: options.h:438
Option to enable external forcing of the collection's elements count.
Definition: options.h:544
Option that forces termination of the sequence when predefined value is encountered.
Definition: options.h:507
Option that forces collection fields to append provides suffix every time it is serialised.
Definition: options.h:531
Option used to specify numeric ID of the message.
Definition: options.h:193
Options to specify units of the field.
Definition: options.h:693
Provide range of valid unsigned numeric values.
Definition: options.h:1001
Provide range of valid numeric values.
Definition: options.h:956
Clear accumulated ranges of valid values.
Definition: options.h:961
Option used to specify that field may have variable serialisation length.
Definition: options.h:337
Avoid invocation of built-in reset() member function on destruction of the comms::field::Variant fiel...
Definition: options.h:1232
Option used to specify index of the version field inside extra transport fields tuple provided with c...
Definition: options.h:226
Add storage of version information inside private data members.
Definition: options.h:1204
Provide type to be used for versioning.
Definition: options.h:1159
Replacement to std::conditional.
Definition: type_traits.h:28
This file contains all the classes necessary to properly define message traits.
Replacement to some types from standard type_traits.