Add user and profession entity
This commit is contained in:
parent
170a24670d
commit
f41052337c
7 changed files with 222 additions and 10 deletions
32
iFacility/objects/profession.cpp
Normal file
32
iFacility/objects/profession.cpp
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
#include "profession.h"
|
||||
|
||||
QString Profession::title() const {
|
||||
return mTitle;
|
||||
}
|
||||
|
||||
PID Profession::pID() const {
|
||||
return mPID;
|
||||
}
|
||||
|
||||
Profession Profession::createProfession(const QString &title) {
|
||||
Profession p;
|
||||
|
||||
p.mPID = QUuid::createUuid();
|
||||
p.mTitle = title;
|
||||
|
||||
return p;
|
||||
}
|
||||
|
||||
bool operator==(const Profession &l, const Profession &r) {
|
||||
return l.mPID == r.mPID;
|
||||
}
|
||||
|
||||
QDataStream& operator<<(QDataStream &stream, const Profession &prof) {
|
||||
stream << prof.mPID << prof.mTitle;
|
||||
return stream;
|
||||
}
|
||||
|
||||
QDataStream& operator>>(QDataStream &stream, Profession &prof) {
|
||||
stream >> prof.mPID >> prof.mTitle;
|
||||
return stream;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue