1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
|
/** Clarification
-Voter::str is a type alias for std::string
-Voter::votes is a type alias for std::queue<unsigned>
**/
#include "Voter.h"
//Read-only
Voter::str Voter::name()const
{return _name;}
Voter::str Voter::address()const
{return _address;}
Gender_t Voter::gender()const
{return _gender;}
bool Voter::alreadyvoted()const
{return _already_voted;}
bool Voter::disabled()const
{return _disabled;}
unsigned Voter::getPrecinct()const
{return _precinct;}
Voter::votes Voter::getVotes()const
{return _votes;}
PolParty_t Voter::politicalaffiliation()const
{return _party;}
//Interactions
//void Voter::vote(const Ballot& ballot){
//}
//Constructor
Voter::Voter(
str newname,
//Follows format:
// housenum streetname streettype, city, state(full)
str newaddress,
Gender_t newgender,
bool newstatus,
PolPart_t newparty
):
_name(newname),
_street(newaddress.substr(0, newaddress.find(','))),
_city(newaddress.substr(
newaddress.find(',') + 1,
newaddress.find_last_of(',')
)),
_state(newaddress.substr(newaddress.find_last_of(',') + 1)),
_gender(newgender),
_already_voted(false),
_disabled(newstatus),
_party(newparty)
{}
|