STAR++ v0.2.2
C++ implementation of STAR voting
|
The Election::Ballot class represents a single ballot for a given election. More...
#include <star/election.h>
Public Member Functions | |
QString | preference (const QString &candidateA, const QString &candidateB) const |
int | score (const QString &candidate) const |
const Voter & | voter () const |
Friends | |
class | Election::Builder |
A Ballot is composed of a voter and their votes.
Ballots are not designed to be created directly, but rather through Election::Builder::wBallot().
QString Star::Election::Ballot::preference | ( | const QString & | candidateA, |
const QString & | candidateB | ||
) | const |
Returns the candidate preferred between candidateA and candidateB on the ballot, or a null string if neither were preferred.
int Star::Election::Ballot::score | ( | const QString & | candidate | ) | const |
Returns the score given to candidate on the ballot.
const Election::Voter & Star::Election::Ballot::voter | ( | ) | const |
Returns the voter that the ballot is attributed it.