Skip to content
Snippets Groups Projects
Commit ee0058e6 authored by Theodoros Katzalis's avatar Theodoros Katzalis
Browse files

Added documentation for the constructors

parent 951541e3
No related branches found
No related tags found
No related merge requests found
...@@ -2,9 +2,13 @@ ...@@ -2,9 +2,13 @@
#define ECSS_SERVICES_TIMEANDDATE_HPP #define ECSS_SERVICES_TIMEANDDATE_HPP
#include <cstdint> #include <cstdint>
#include "macros.hpp"
/** /**
* A class that represents the time and date. * A class that represents the time and date.
*
* @note
* This class represents UTC date
*/ */
class TimeAndDate { class TimeAndDate {
public: public:
...@@ -15,8 +19,22 @@ public: ...@@ -15,8 +19,22 @@ public:
uint8_t minute; uint8_t minute;
uint8_t second; 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 TimeAndDate(uint16_t year, uint8_t month, uint8_t day, uint8_t hour, uint8_t minute, uint8_t
second); second);
...@@ -36,6 +54,14 @@ public: ...@@ -36,6 +54,14 @@ public:
*/ */
bool operator>(const TimeAndDate &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);
/** /**
* Compare two timestamps. * Compare two timestamps.
* *
...@@ -51,14 +77,6 @@ public: ...@@ -51,14 +77,6 @@ public:
* @return true if the pointer `this` is greater than or equal to \p Date * @return true if the pointer `this` is greater than or equal to \p Date
*/ */
bool operator>=(const TimeAndDate &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 #endif //ECSS_SERVICES_TIMEANDDATE_HPP
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment