Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchismanKarmakar committed Feb 17, 2024
1 parent 11dff4f commit 0c11795
Show file tree
Hide file tree
Showing 13 changed files with 963 additions and 332 deletions.
42 changes: 42 additions & 0 deletions include/address.hh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#ifndef ADDRESS
#define ADDRESS

#include <iostream>
#include <cstdlib>
#include <vector>
#include <algorithm>
#include <cmath>
#include <array>
#include <set>
#include <map>
#include <cstring>
#include <queue>
#include <stack>
#include <chrono>
#include <random>
#include <functional>
#include <limits>
#include <fstream>
#include <sstream>
#include <filesystem>

using namespace std;

class Address
{
private:
string line1, line2;
string city;
string state;
string pinCode;
string country;

public:
Address();
void takeInput();
void print();
string addToStr();
void strToAdd(string str);
};

#endif
27 changes: 27 additions & 0 deletions include/employee.hh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#ifndef EMPLOYEE
#define EMPLOYEE
using namespace std;
#include <string>

#include "./person.hh"

// class appointment;
class Employee : public Person
{
private:
string type;
int appointmentsBooked;
// friend class appointment;

public:
Employee();
void fillMap();
void saveMap();
void addPerson();
void printDetails();
void printDetailsFromHistory(string extraDetails = "");
void getDetails(int rec = 0);
void getDetailsFromHistory();
void removePerson();
};
#endif // !DOCTOR
66 changes: 9 additions & 57 deletions include/global.hh
Original file line number Diff line number Diff line change
@@ -1,57 +1,9 @@
#ifndef GLOBAL
#define GLOBAL
#include <iostream>
#include <cstdlib>
#include <vector>
#include <algorithm>
#include <cmath>
#include <array>
#include <set>
#include <map>
#include <cstring>
#include <queue>
#include <stack>
#include <chrono>
#include <random>
#include <functional>
#include <limits>
#include <fstream>
#include <sstream>
#include <filesystem>

using namespace std;

void pause()
{
do
{
cout << "\n";
} while (cin.get() != '\n');
do
{
cout << "Press a key to continue...";
} while (cin.get() != '\n');
}

int power(int n, int exp)
{
int res = 1;
while (exp)
{
if (exp & 1)
res *= n, exp--;
else
n *= n, exp >>= 1;
}
return res;
}

int strToNum(string s)
{
int res = 0;
for (int i = 0; i < s.size(); i++)
res += ((s[s.size() - 1 - i] - '0') * power(10, i));
return res;
}

#endif
#ifndef GLOBAL_HMS
#define GLOBAL_HMS
using namespace std;
#include <string>

extern int yyyymmdd;
int power(int n = 1, int exp = 0);
int strToNum(string s);
#endif // !GLOBAL_HMS
32 changes: 32 additions & 0 deletions include/person.hh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#ifndef PERSON
#define PERSON
using namespace std;
#include <string>

#include "./address.hh"

class Person // abstract class
{
protected:
int id;
string firstName, lastName;
char gender;
int16_t age;
string mobNumber;
Address addr;
string cat;
int category;
// category: 1:doctor; 2:patient; 3:nurse; 4:driver;

public:
Person();
virtual void fillMap() = 0;
virtual void saveMap() = 0;
virtual void addPerson(int16_t minAge = 0, int16_t maxAge = 1000);
virtual void printDetails();
virtual void printDetailsFromHistory();
virtual void getDetails(int rec = 0) = 0;
virtual void getDetailsFromHistory() = 0;
virtual void removePerson() = 0;
};
#endif // !PERSON
21 changes: 21 additions & 0 deletions include/subject.hh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#include <iostream>
#include <cstdlib>
#include <vector>
#include <algorithm>
#include <cmath>
#include <array>
#include <set>
#include <map>
#include <cstring>
#include <queue>
#include <stack>
#include <chrono>
#include <random>
#include <functional>
#include <limits>
#include <fstream>
#include <sstream>
#include <filesystem>

using namespace std;

151 changes: 85 additions & 66 deletions include/table_manage.hh
Original file line number Diff line number Diff line change
@@ -1,67 +1,86 @@
#ifndef TABLE_MANAGE
#define TABLE_MANAGE

#include <iostream>
#include <cstdlib>
#include <vector>
#include <algorithm>
#include <cmath>
#include <array>
#include <set>
#include <map>
#include <cstring>
#include <queue>
#include <stack>
#include <chrono>
#include <random>
#include <functional>
#include <limits>
#include <fstream>
#include <sstream>
#include <filesystem>

using namespace std;

#define pause() \
do \
{ \
cout << "\n"; \
} while (cin.get() != '\n'); \
do \
{ \
cout << "Press a key to continue..."; \
} while (cin.get() != '\n')

// class TimeTable
// {
// public:
// int getDay();
// void setDay(int day);
// void displayRoutine(std::string uname);

// private:
// int day = 0;
// };

class Period
{
public:
void periodConstructor(int periodNo, int startTime, int endTime, std::string facultyId, std::string subId, int day, int totalPeriods)
{
this->periodNo = periodNo;
this->startTime = startTime;
this->endTime = endTime;
this->facultyId = facultyId;
this->subId = subId;
}
void openFileChk(std::string uname);

private:
int periodNo;
int startTime;
int endTime;
std::string facultyId;
std::string subId;
};

#ifndef TABLE_MANAGE
#define TABLE_MANAGE

#include <iostream>
#include <cstdlib>
#include <vector>
#include <algorithm>
#include <cmath>
#include <array>
#include <set>
#include <map>
#include <cstring>
#include <queue>
#include <stack>
#include <chrono>
#include <random>
#include <functional>
#include <limits>
#include <fstream>
#include <sstream>
#include <filesystem>

#include "./employee.hh"
// #include "./patient.hh"
// #include "./nurse.hh"
// #include "./driver.hh"
// #include "./ambulance.hh"
// #include "./appointment.hh"

#define ull unsigned long long

using namespace std;

class classStandard
{
public:
void classStandardCreate(std::string classStandard_fname);

void periodConstructor(ull periodNo)
{
}

void displayRoutine();

classStandard(string classStandard_fname);

private:
ull periodNo;
};

bool classStandardChk(std::string classStandard_fname);

class table_manage
{
private:
//map<id, object>
static map<int, Employee> employeeList;
// static map<int, patient> patientsList;
// static map<int, nurse> nursesList;
// static map<int, driver> driversList;
// static map<int, ambulance> ambulancesList;
// static map<int, appointment> appointmentsList;

static const int employeeLimit;
// static const int nursesLimit;
// static const int driversLimit;
// static const int ambulancesLimit;
// static const int appointmentsLimit;

friend class Employee;
// friend class patient;
// friend class nurse;
// friend class driver;
// friend class ambulance;
// friend class appointment;

public:
static void printEmployees();
// static void printPatients();
// static void printNurses();
// static void printDrivers();
// static void printAmbulances();
// static void printAppointments();
};

#endif
Loading

0 comments on commit 0c11795

Please sign in to comment.