Files
Training-Team2-Zenvy-Jan26/Trenser.Zenvy/Trenser.Zenvy/models/Team.h
T
joelthomastrenser 133785dd3f 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
2026-04-17 09:36:34 +05:30

40 lines
1.3 KiB
C++

/*
File: Team.h
* Description : Models a team entity that maintains team identity, leadership, employee list, and size limitations.
* Author : Trenser
* Created : 31-Mar-2026
*/
#pragma once
#include <string>
#include <map>
#include "Employee.h"
using employeeMap = std::map<std::string, Employee*>;
class Team
{
private:
static int m_uid;
std::string m_id;
std::string m_name;
Employee* m_lead;
employeeMap m_employees;
int m_maximumNumberOfEmployees;
public:
Team() : m_id("TM" + std::to_string(++m_uid)), m_name(""), m_lead(nullptr), m_maximumNumberOfEmployees(0) {}
Team(
const std::string& name,
Employee* lead,
int maximumNumberOfEmployees)
: m_id("TM" + std::to_string(++m_uid)), m_name(name), m_lead(lead), m_maximumNumberOfEmployees(maximumNumberOfEmployees) {
}
const std::string& getTeamId() const;
const std::string& getTeamName() const;
Employee* getTeamLead() const;
const employeeMap& getEmployeesInTeam() const;
int getMaximumNumberOfEmployeesInTeam() const;
void setTeamId(const std::string& id);
void setTeamName(const std::string& name);
void setTeamLead(Employee* lead);
void setEmployeesInTeam(const employeeMap& employees);
void setMaximumNumberOfEmployeesInTeam(int maximumNumberOfEmployees);
};