OpenWalnut
1.4.0
|
A structure that holds all relevant information about the subject. More...
#include <WPersonalInformation.h>
Public Types | |
enum | Sex { male, female, unknown } |
Enumeration of possible sex types. More... | |
Public Member Functions | |
uint64_t | getSubjectID () const |
Returns the subjectID of the person. | |
void | setSubjectID (uint64_t subjectID) |
Sets the subjectID of the person. | |
std::string | getLastName () const |
Returns the last or family name of the person. | |
void | setLastName (std::string lastName) |
Sets the last or family name of the person if the object is no dummy anymore. | |
std::string | getMiddleName () const |
Returns the middle name of the person. | |
std::string | getFirstName () const |
Returns the first or given name of the person. | |
bool | operator== (WPersonalInformation info) const |
Returns if all members of the current WPersonalInformation are equal to those of info. | |
bool | operator!= (WPersonalInformation info) const |
Returns if not all members of the current WPersonalInformation are equal to those of info. | |
std::string | getCompleteName () const |
Returns the name of the subject. | |
Static Public Member Functions | |
static WPersonalInformation | createDummyInformation () |
Returns an empty dummy WPersonalInformation object. | |
Private Member Functions | |
WPersonalInformation () | |
Private default constructor to force the use of special function for dummy infos. | |
Private Attributes | |
uint64_t | m_subjectID |
Represents a globally unique identifier. | |
std::string | m_subjectCode |
Code for person. | |
std::string | m_lastName |
Last name or family of the person. | |
std::string | m_middleName |
Middle name of the person, if any. | |
std::string | m_firstName |
First name or given name of the person. | |
boost::posix_time::ptime | m_dateOfBirth |
Birthday of the person. | |
std::string | m_streetAndNumber |
street name and number of house in which person lives | |
std::string | m_zipCode |
ZIP code of the city in which person lives. | |
std::string | m_city |
city in which person lives | |
std::string | m_state |
state in which person lives | |
std::string | m_country |
country in which person lives | |
std::string | m_phone |
phone number of person | |
std::string | m_eMail |
e-mail adress of person | |
std::string | m_handicaps |
Description of the handicaps of the person. | |
Sex | m_sex |
The gender of the person. | |
char | m_categoryId |
not documented. | |
std::string | m_handedness |
preference for using right or left hand | |
std::string | m_notes |
Notes. | |
std::string | m_diagnostic |
The diagnosis for the person. | |
std::string | m_medication |
The medication of the person. | |
std::string | m_referringDoctor |
The doctor who reffered the person. | |
Friends | |
class | WPersonalInformationTest |
Only tests are allowed as friends. |
A structure that holds all relevant information about the subject.
Definition at line 38 of file WPersonalInformation.h.
Enumeration of possible sex types.
Definition at line 48 of file WPersonalInformation.h.
WPersonalInformation::WPersonalInformation | ( | ) | [private] |
Private default constructor to force the use of special function for dummy infos.
Definition at line 36 of file WPersonalInformation.cpp.
Referenced by createDummyInformation().
Returns an empty dummy WPersonalInformation object.
Definition at line 31 of file WPersonalInformation.cpp.
References WPersonalInformation().
Referenced by WDataHandlerTest::testAddSubjects(), WSubjectTest::TestConstructorWithInfo(), WPersonalInformationTest::testCreation(), WPersonalInformationTest::testEquality(), WSubjectTest::testGetName(), WPersonalInformationTest::testGetSubjectID(), WPersonalInformationTest::testInequality(), WSubjectTest::testInstantiationWithName(), WDataHandlerTest::testRemoveSubjects(), WPersonalInformationTest::testSetSubjectID(), and WDataHandler::WDataHandler().
std::string WPersonalInformation::getCompleteName | ( | ) | const |
Returns the name of the subject.
This is a concatenation of first, middle and last name.
Definition at line 77 of file WPersonalInformation.cpp.
References getFirstName(), getLastName(), and getMiddleName().
Referenced by WSubject::getName().
std::string WPersonalInformation::getFirstName | ( | ) | const |
Returns the first or given name of the person.
Definition at line 93 of file WPersonalInformation.cpp.
References m_firstName.
Referenced by getCompleteName().
std::string WPersonalInformation::getLastName | ( | ) | const |
Returns the last or family name of the person.
Definition at line 72 of file WPersonalInformation.cpp.
References m_lastName.
Referenced by getCompleteName(), and WSubjectTest::testGetName().
std::string WPersonalInformation::getMiddleName | ( | ) | const |
Returns the middle name of the person.
Definition at line 88 of file WPersonalInformation.cpp.
References m_middleName.
Referenced by getCompleteName().
uint64_t WPersonalInformation::getSubjectID | ( | ) | const |
Returns the subjectID of the person.
This is zero for dummy information.
Definition at line 61 of file WPersonalInformation.cpp.
References m_subjectID.
Referenced by WPersonalInformationTest::testGetSubjectID().
bool WPersonalInformation::operator!= | ( | WPersonalInformation | info | ) | const |
Returns if not all members of the current WPersonalInformation are equal to those of info.
info | the WPersonalInformation to compare with |
Definition at line 123 of file WPersonalInformation.cpp.
bool WPersonalInformation::operator== | ( | WPersonalInformation | info | ) | const |
Returns if all members of the current WPersonalInformation are equal to those of info.
info | the WPersonalInformation to compare with |
Definition at line 98 of file WPersonalInformation.cpp.
References m_categoryId, m_city, m_country, m_dateOfBirth, m_diagnostic, m_eMail, m_firstName, m_handedness, m_handicaps, m_lastName, m_medication, m_middleName, m_notes, m_phone, m_referringDoctor, m_sex, m_state, m_streetAndNumber, m_subjectCode, m_subjectID, and m_zipCode.
void WPersonalInformation::setLastName | ( | std::string | lastName | ) |
Sets the last or family name of the person if the object is no dummy anymore.
lastName | the new last name |
Definition at line 82 of file WPersonalInformation.cpp.
References m_lastName, and m_subjectID.
Referenced by WDataHandlerTest::testAddSubjects(), WSubjectTest::testGetName(), and WDataHandlerTest::testRemoveSubjects().
void WPersonalInformation::setSubjectID | ( | uint64_t | subjectID | ) |
Sets the subjectID of the person.
This must be non-zero as changed information is not considered dummy anymore.
subjectID | New globally unique identifier |
Definition at line 66 of file WPersonalInformation.cpp.
References m_subjectID.
Referenced by WDataHandlerTest::testAddSubjects(), WSubjectTest::testGetName(), WDataHandlerTest::testRemoveSubjects(), and WPersonalInformationTest::testSetSubjectID().
friend class WPersonalInformationTest [friend] |
Only tests are allowed as friends.
Definition at line 43 of file WPersonalInformation.h.
char WPersonalInformation::m_categoryId [private] |
std::string WPersonalInformation::m_city [private] |
city in which person lives
Definition at line 142 of file WPersonalInformation.h.
Referenced by operator==().
std::string WPersonalInformation::m_country [private] |
country in which person lives
Definition at line 144 of file WPersonalInformation.h.
Referenced by operator==().
boost::posix_time::ptime WPersonalInformation::m_dateOfBirth [private] |
Birthday of the person.
Definition at line 139 of file WPersonalInformation.h.
Referenced by operator==().
std::string WPersonalInformation::m_diagnostic [private] |
The diagnosis for the person.
Definition at line 153 of file WPersonalInformation.h.
Referenced by operator==().
std::string WPersonalInformation::m_eMail [private] |
e-mail adress of person
Definition at line 146 of file WPersonalInformation.h.
Referenced by operator==().
std::string WPersonalInformation::m_firstName [private] |
First name or given name of the person.
Definition at line 138 of file WPersonalInformation.h.
Referenced by getFirstName(), and operator==().
std::string WPersonalInformation::m_handedness [private] |
preference for using right or left hand
Definition at line 151 of file WPersonalInformation.h.
Referenced by operator==().
std::string WPersonalInformation::m_handicaps [private] |
Description of the handicaps of the person.
Definition at line 147 of file WPersonalInformation.h.
Referenced by operator==().
std::string WPersonalInformation::m_lastName [private] |
Last name or family of the person.
Definition at line 136 of file WPersonalInformation.h.
Referenced by getLastName(), operator==(), setLastName(), WPersonalInformationTest::testEquality(), and WPersonalInformationTest::testInequality().
std::string WPersonalInformation::m_medication [private] |
The medication of the person.
Definition at line 154 of file WPersonalInformation.h.
Referenced by operator==().
std::string WPersonalInformation::m_middleName [private] |
Middle name of the person, if any.
Definition at line 137 of file WPersonalInformation.h.
Referenced by getMiddleName(), and operator==().
std::string WPersonalInformation::m_notes [private] |
std::string WPersonalInformation::m_phone [private] |
phone number of person
Definition at line 145 of file WPersonalInformation.h.
Referenced by operator==().
std::string WPersonalInformation::m_referringDoctor [private] |
The doctor who reffered the person.
Definition at line 155 of file WPersonalInformation.h.
Referenced by operator==().
Sex WPersonalInformation::m_sex [private] |
The gender of the person.
Definition at line 148 of file WPersonalInformation.h.
Referenced by operator==().
std::string WPersonalInformation::m_state [private] |
state in which person lives
Definition at line 143 of file WPersonalInformation.h.
Referenced by operator==().
std::string WPersonalInformation::m_streetAndNumber [private] |
street name and number of house in which person lives
Definition at line 140 of file WPersonalInformation.h.
Referenced by operator==().
std::string WPersonalInformation::m_subjectCode [private] |
uint64_t WPersonalInformation::m_subjectID [private] |
Represents a globally unique identifier.
Definition at line 134 of file WPersonalInformation.h.
Referenced by getSubjectID(), operator==(), setLastName(), setSubjectID(), WPersonalInformationTest::testEquality(), WPersonalInformationTest::testGetSubjectID(), WPersonalInformationTest::testInequality(), and WPersonalInformationTest::testSetSubjectID().
std::string WPersonalInformation::m_zipCode [private] |
ZIP code of the city in which person lives.
Definition at line 141 of file WPersonalInformation.h.
Referenced by operator==().