STAR++ v0.2.2
C++ implementation of STAR voting
Loading...
Searching...
No Matches
Star::Election::Ballot Class Reference

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 Votervoter () const
 

Friends

class Election::Builder
 

Detailed Description

A Ballot is composed of a voter and their votes.

Ballots are not designed to be created directly, but rather through Election::Builder::wBallot().

See also
Election::Vote and Election::Voter.

Member Function Documentation

◆ preference()

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.

◆ score()

int Star::Election::Ballot::score ( const QString &  candidate) const

Returns the score given to candidate on the ballot.

◆ voter()

const Election::Voter & Star::Election::Ballot::voter ( ) const

Returns the voter that the ballot is attributed it.


The documentation for this class was generated from the following files: