STAR++ v0.2.2
C++ implementation of STAR voting
Loading...
Searching...
No Matches
electionresult.h
1#ifndef ELECTIONRESULT_H
2#define ELECTIONRESULT_H
3
4// Shared Library Support
5#include "star/star_base_export.h"
6
7// Project Includes
8#include "star/election.h"
9#include "star/seat.h"
10
11namespace Star
12{
13
14class STAR_BASE_EXPORT ElectionResult
15{
16//-Instance Variables--------------------------------------------------------------------------------------------------
17private:
18 const Election* mElection;
19 QList<Seat> mSeats;
20
21//-Constructor---------------------------------------------------------------------------------------------------------
22public:
24 ElectionResult(const Election* election, const QList<Seat>& seats);
25
26//-Instance Functions-------------------------------------------------------------------------------------------------
27public:
28 bool isNull() const;
29 bool isComplete() const;
30
31 const Seat& seatAt(qsizetype i) const;
32 QList<Seat> seats() const;
33 QStringList winners() const;
34 QSet<QString> unresolvedCandidates() const;
35 Seat unresolvedSeat() const;
36 qsizetype seatCount() const;
37 qsizetype filledSeatCount() const;
38 qsizetype unfilledSeatCount() const;
39 const Election* election() const;
40
41 bool operator==(const ElectionResult& other) const;
42 bool operator!=(const ElectionResult& other) const;
43};
44
45}
46
47#endif // ELECTIONRESULT_H
The Election class represents a collection of candidates and ballots.
Definition election.h:19
The ElectionResult class holds the outcome of an election.
Definition electionresult.h:15
The Seat class contains the outcome for a specific seat in a given election.
Definition seat.h:17
The Star namespace is the main namespace through which all functionality of the STAR++ library is acc...
Definition calculator.cpp:21