From ee0058e67dafa47b986fac7b171e2dced5495773 Mon Sep 17 00:00:00 2001 From: Theodoros Katzalis <thodkatz@gmail.com> Date: Sun, 17 Mar 2019 17:13:53 +0200 Subject: [PATCH] Added documentation for the constructors --- inc/Helpers/TimeAndDate.hpp | 36 +++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/inc/Helpers/TimeAndDate.hpp b/inc/Helpers/TimeAndDate.hpp index 44e0c7c7..39281373 100644 --- a/inc/Helpers/TimeAndDate.hpp +++ b/inc/Helpers/TimeAndDate.hpp @@ -2,9 +2,13 @@ #define ECSS_SERVICES_TIMEANDDATE_HPP #include <cstdint> +#include "macros.hpp" /** * A class that represents the time and date. + * + * @note + * This class represents UTC date */ class TimeAndDate { public: @@ -15,8 +19,22 @@ public: uint8_t minute; uint8_t second; - TimeAndDate(); + /** + * Assign the instances with the Unix epoch 1/1/1970 00:00:00 + */ + TimeAndDate(); // + /** + * @param year the year as it used in Gregorian calendar (the well known civil calendar). For + * example 2019 + * @param month the month as it used in Gregorian calendar. There isn't 0 month so we are + * start counting from 1! + * @param day the day as it used in Gregorian calendar. There isn't 0 day so we are start + * counting from 1! + * @param hour UTC (Coordinated Universal Time) hour in 24 format + * @param minute UTC minutes + * @param second UTC seconds + */ TimeAndDate(uint16_t year, uint8_t month, uint8_t day, uint8_t hour, uint8_t minute, uint8_t second); @@ -36,6 +54,14 @@ public: */ bool operator>(const TimeAndDate &Date); + /** + * Compare two timestamps. + * + * @param Date the date that will be compared with the pointer `this` + * @return true if the pointer `this` is equal to \p Date + */ + bool operator==(const TimeAndDate &Date); + /** * Compare two timestamps. * @@ -51,14 +77,6 @@ public: * @return true if the pointer `this` is greater than or equal to \p Date */ bool operator>=(const TimeAndDate &Date); - - /** - * Compare two timestamps. - * - * @param Date the date that will be compared with the pointer `this` - * @return true if the pointer `this` is equal to \p Date - */ - bool operator==(const TimeAndDate &Date); }; #endif //ECSS_SERVICES_TIMEANDDATE_HPP -- GitLab