Тема: C++ priority queue
Добрий день, можете пояснити як написати клас priority_queue так щоб він працював
#include <iostream>
#include <queue>
#include <set>
using namespace std;
class Osoba
{
private:
int name;
int surname;
int middlename;
int date;
int day;
int month;
int year;
public:
void messege()
{
cout << "data about OSOBA"<< endl;
}
void setInfo(int Info_name, int Info_surname, int Info_middlename)
{
name = Info_name;
surname = Info_surname;
middlename = Info_middlename;
}
void getInfo()
{
cout << "Info: " << name << "." << surname << "." << middlename << endl;
}
void setDate(int date_day, int date_month, int date_year)
{
day = date_day;
month = date_month;
year = date_year;
}
void getDate()
{
cout << "Date: " << day << "." << month << "." << year << endl;
}
};
class worker
{
private:
int experience;
int hours;
int payforhour;
int payroll;
public:
void messege()
{
cout << "data about worker"<< endl;
}
void setPayinfo(int Payinfo_experience, int Payinfo_hours, int Payinfo_payforhour, int Payinfo_payroll)
{
experience = Payinfo_experience;
hours = Payinfo_hours;
payforhour = Payinfo_payforhour;
payroll = Payinfo_payroll;
}
void getPayinfo()
{
cout << "Payinfo: " << experience << "." << hours << "." << payforhour << "." << payroll << endl;
}
};
void print(priority_queue<set<worker> > priorityQueue)
{
while (!priorityQueue.empty()) {
set<worker> st = priorityQueue.top();
cout << "[ ";
for (auto element : st)
cout << element << ' ';
cout << ']';
cout << '\n';
priorityQueue.pop();
}
}
int main(int argc, char* argv[])
{
setlocale(LC_ALL, "rus");
priority_queue<set<int> > priorityQueue;
set<worker> set1;
set1.insert(2);
set1.insert(8);
set1.insert(50);
set1.insert(40);
priorityQueue.push(set1);
int experience, hours, payforhour, payroll;
int name, surname, middlename, day, month, year;
cout << "Введите данные про особу"<< endl;
cout << "Имя"<< endl;
cout << "Фамилия"<< endl;
cout << "Отчество"<< endl;
cout << "Введите данные про день рождения"<< endl;
cout << "день"<< endl;
cout << "месяц"<< endl;
cout << "год"<< endl;
cout << "Опыт"<< endl;
cout << "Часы роботы"<< endl;
cout << "Зарплата за час"<< endl;
cout << "табельный оклад"<< endl;
worker objworker;
Osoba objOsoba;
objOsoba.messege();
objOsoba.setInfo(name, surname, middlename);
objOsoba.getInfo();
objOsoba.setDate(day, month, year);
objOsoba.getDate();
objworker.messege();
objworker.setPayinfo(experience, hours, payforhour, payroll);
objworker.getPayinfo();
return 0;
};