ELEC351 SUBMISSION - Same as on the DLE

/media/uploads/Luka_Danilovic/elec_315_prototype_assembly.jpg

Committer:
Luka_Danilovic
Date:
Wed Jan 10 09:49:43 2018 +0000
Revision:
0:c66224a27cf8
ELEC351 SUBMISSION - SAme as on the DLE

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Luka_Danilovic 0:c66224a27cf8 1 #ifndef __dateAndTime__ //Inclusion safeguards
Luka_Danilovic 0:c66224a27cf8 2 #define __dateAndTime__
Luka_Danilovic 0:c66224a27cf8 3
Luka_Danilovic 0:c66224a27cf8 4
Luka_Danilovic 0:c66224a27cf8 5 typedef struct __attribute__ ((packed)) { // Store one after another
Luka_Danilovic 0:c66224a27cf8 6
Luka_Danilovic 0:c66224a27cf8 7 int day, mnt, yr; // Current Date
Luka_Danilovic 0:c66224a27cf8 8 int sec, min, hr; // Current Time
Luka_Danilovic 0:c66224a27cf8 9
Luka_Danilovic 0:c66224a27cf8 10 } TDS_DT; // Type Def Struct _ Date Time
Luka_Danilovic 0:c66224a27cf8 11
Luka_Danilovic 0:c66224a27cf8 12
Luka_Danilovic 0:c66224a27cf8 13 class C_DT // Class _ Date Time
Luka_Danilovic 0:c66224a27cf8 14 {
Luka_Danilovic 0:c66224a27cf8 15
Luka_Danilovic 0:c66224a27cf8 16 // Constructorless class - constructor not needed
Luka_Danilovic 0:c66224a27cf8 17
Luka_Danilovic 0:c66224a27cf8 18 private:
Luka_Danilovic 0:c66224a27cf8 19 TDS_DT date_time; // TDS_DT format of storing Date & Time
Luka_Danilovic 0:c66224a27cf8 20
Luka_Danilovic 0:c66224a27cf8 21 public:
Luka_Danilovic 0:c66224a27cf8 22 TDS_DT getDT(); // Get Date & Time
Luka_Danilovic 0:c66224a27cf8 23 void setD(int, int, int); // set Date
Luka_Danilovic 0:c66224a27cf8 24 void setT(int, int, int); // Set Time
Luka_Danilovic 0:c66224a27cf8 25
Luka_Danilovic 0:c66224a27cf8 26 };
Luka_Danilovic 0:c66224a27cf8 27
Luka_Danilovic 0:c66224a27cf8 28 #endif