refactor: change memory management and fix related code

- Switched shared_ptr to raw pointers
- Added cleanup logic in DataStore
- Fixed Factory object creation
- Updated function signatures to match changes
- Small refactors and formatting fixes
This commit is contained in:
2026-04-17 09:33:37 +05:30
parent 703cea447e
commit 133785dd3f
18 changed files with 154 additions and 144 deletions
@@ -4,7 +4,6 @@
* Author: Trenser
* Created: 01-Apr-2026
*/
#pragma once
#include<string>
#include<map>
@@ -21,8 +20,8 @@ namespace util
bool isPhoneNumberValid(const std::string&);
bool isEmailValid(const std::string&);
bool isPasswordValid(const std::string&);
bool hasActiveEmployeeOfType(Enums::EmployeeType, const std::map<std::string, std::shared_ptr<Employee>>&);
bool isEmailDuplicate(const std::string&, const std::map<std::string, std::shared_ptr<Employee>>&);
bool isPhoneDuplicate(const std::string&, const std::map<std::string, std::shared_ptr<Employee>>&);
bool isPhoneDuplicate(const std::string&, const std::vector<std::shared_ptr<const Employee>>&);
bool hasActiveEmployeeOfType(Enums::EmployeeType, const std::map<std::string, Employee*>&);
bool isEmailDuplicate(const std::string&, const std::map<std::string, Employee*>&);
bool isPhoneDuplicate(const std::string&, const std::map<std::string, Employee*>&);
bool isPhoneDuplicate(const std::string&, const std::vector<const Employee*>&);
}