From dc72fa938d593083b8fb60ff38ea7f9b6d754711 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 14 Dec 2020 11:10:22 +0100 Subject: [PATCH 1/2] type update --- globalfunctions/Type.cpp | 1 - globalfunctions/Type.h | 13 ++++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/globalfunctions/Type.cpp b/globalfunctions/Type.cpp index ae595b81..fa6d2f28 100644 --- a/globalfunctions/Type.cpp +++ b/globalfunctions/Type.cpp @@ -1,4 +1,3 @@ -#include "../serialize/SerializeAdapter.h" #include "Type.h" #include "../serialize/SerializeAdapter.h" diff --git a/globalfunctions/Type.h b/globalfunctions/Type.h index be499ffc..d28f56ac 100644 --- a/globalfunctions/Type.h +++ b/globalfunctions/Type.h @@ -1,9 +1,12 @@ -#ifndef TYPE_H_ -#define TYPE_H_ +#ifndef FSFW_GLOBALFUNCTIONS_TYPE_H_ +#define FSFW_GLOBALFUNCTIONS_TYPE_H_ #include "../returnvalues/HasReturnvaluesIF.h" #include "../serialize/SerializeIF.h" +/** + * @brief Type definition for CCSDS or ECSS. + */ class Type: public SerializeIF { public: enum ActualType_t { @@ -56,6 +59,10 @@ struct PodTypeConversion { static const Type::ActualType_t type = Type::UNKNOWN_TYPE; }; template<> +struct PodTypeConversion { + static const Type::ActualType_t type = Type::UINT8_T; +}; +template<> struct PodTypeConversion { static const Type::ActualType_t type = Type::UINT8_T; }; @@ -88,4 +95,4 @@ struct PodTypeConversion { static const Type::ActualType_t type = Type::DOUBLE; }; -#endif /* TYPE_H_ */ +#endif /* FSFW_GLOBALFUNCTIONS_TYPE_H_ */ From f733a85a9c51a8612084f947485c33161d75346f Mon Sep 17 00:00:00 2001 From: "Robin.Mueller" Date: Tue, 15 Dec 2020 14:41:33 +0100 Subject: [PATCH 2/2] type update --- globalfunctions/Type.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/globalfunctions/Type.h b/globalfunctions/Type.h index d28f56ac..fa894e3e 100644 --- a/globalfunctions/Type.h +++ b/globalfunctions/Type.h @@ -3,6 +3,7 @@ #include "../returnvalues/HasReturnvaluesIF.h" #include "../serialize/SerializeIF.h" +#include /** * @brief Type definition for CCSDS or ECSS. @@ -56,13 +57,14 @@ private: template struct PodTypeConversion { + static_assert(not std::is_same::value, + "Do not use boolean for the PoolEntry type, use uint8_t " + "instead! The ECSS standard defines a boolean as a one bit " + "field. Therefore it is preferred to store a boolean as an " + "uint8_t"); static const Type::ActualType_t type = Type::UNKNOWN_TYPE; }; template<> -struct PodTypeConversion { - static const Type::ActualType_t type = Type::UINT8_T; -}; -template<> struct PodTypeConversion { static const Type::ActualType_t type = Type::UINT8_T; };