You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
proiectPOO/Zi.cpp

36 lines
823 B

//
// Created by ioachim on 18.05.2025.
//
#include "Zi.h"
ZiuaDeAzi* ZiuaDeAzi::instance = nullptr;
ZiuaDeAzi* ZiuaDeAzi::getInstance() {
if (instance == nullptr) {
//std::lock_guard<std::mutex> lock(mtx);
//if (instance == nullptr) {
instance = new ZiuaDeAzi();
//}
}
return instance;
}
bool Zi::verifExpirare() const {
ZiuaDeAzi* x = ZiuaDeAzi::getInstance();
Zi currentDate = x->getZiuaDeAzi();
return currentDate.year > year || (currentDate.year == year && currentDate.month > month) || (currentDate.year == year && currentDate.month == month && currentDate.day > day);
}
Zi::Zi(int day, int month, int year) : day(day), month(month), year(year) {}
void ZiuaDeAzi::setZiuaDeAzi(Zi _z) {
z = _z;
}
Zi ZiuaDeAzi::getZiuaDeAzi() {
return z;
}