STAR++ v0.2.2
C++ implementation of STAR voting
Loading...
Searching...
No Matches
expectedelectionresult.h
1#ifndef EXPECTEDELECTIONRESULT_H
2#define EXPECTEDELECTIONRESULT_H
3
4// Shared Library Support
5#include "star/star_base_export.h"
6
7// Qt Includes
8#include <QStringList>
9
10// Project Includes
11#include "star/electionresult.h"
12
13namespace Star
14{
15
16class STAR_BASE_EXPORT ExpectedElectionResult
17{
18//-Inner Classes----------------------------------------------------------------------------------------------------
19public:
20 class Builder;
21
22//-Instance Variables--------------------------------------------------------------------------------------------------
23private:
24 QList<Seat> mSeats;
25
26//-Constructor---------------------------------------------------------------------------------------------------------
27public:
29
30//-Instance Functions-------------------------------------------------------------------------------------------------
31public:
32 bool isNull() const;
33 bool sameOutcomeAs(const ElectionResult& result);
34
35 qsizetype seatCount() const;
36 QList<Seat> seats() const;
37
38 bool operator==(const ElectionResult& result) const;
39};
40
41class STAR_BASE_EXPORT ExpectedElectionResult::Builder
42{
43//-Instance Variables--------------------------------------------------------------------------------------------------
44private:
45 ExpectedElectionResult mConstruct;
46
47//-Constructor---------------------------------------------------------------------------------------------------------
48public:
49 Builder();
50
51//-Instance Functions-------------------------------------------------------------------------------------------------
52public:
53 Builder& wSeat(const Seat& seat);
54 Builder& wWinner(const QString& winner);
55
57};
58
59}
60
61#endif // EXPECTEDELECTIONRESULT_H
The ElectionResult class holds the outcome of an election.
Definition electionresult.h:15
The ExpectedElectionResult::Builder class is a utility through expected election result sets can be c...
Definition expectedelectionresult.h:42
The ExpectedElectionResult class compares the results of an election to a known outcome.
Definition expectedelectionresult.h:17
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