STAR++ v0.2.3
C++ implementation of STAR voting
Loading...
Searching...
No Matches
Star Namespace Reference

The Star namespace is the main namespace through which all functionality of the STAR++ library is accessed. More...

Classes

class  Calculator
 The Calculator class provides the means to determine the result of an election. More...
 
class  Election
 The Election class represents a collection of candidates and ballots. More...
 
class  ElectionResult
 The ElectionResult class holds the outcome of an election. More...
 
class  ExpectedElectionResult
 The ExpectedElectionResult class compares the results of an election to a known outcome. More...
 
class  QualifierResult
 The QualifierResult class holds the outcome of a runoff qualifier. More...
 
struct  Rank
 The Rank struct represents a relative position for a given standing that can be occupied by multiple candidates. More...
 
struct  ReferenceError
 The ReferenceError struct is used to report errors while parsing election/results data in their reference formats. More...
 
class  Seat
 The Seat class contains the outcome for a specific seat in a given election. More...
 

Enumerations

enum class  ReferenceErrorType {
  NoError ,
  CategoryConfig ,
  BallotBox ,
  ExpectedResult ,
  CalcOptions
}
 

Functions

ReferenceError calculatorOptionsFromReferenceInput (Star::Calculator::Options &returnBuffer, const QString &calcOptionsPath)
 
ReferenceError electionsFromReferenceInput (QList< Election > &returnBuffer, const QString &categoryConfigPath, const QString &ballotBoxPath)
 
ReferenceError expectedResultsFromReferenceInput (QList< ExpectedElectionResult > &returnBuffer, const QString &resultSetPath)
 

Detailed Description

All library features are nested within this namespace in a similar vein as std with the C++ Standard Library.

Enumeration Type Documentation

◆ ReferenceErrorType

enum class Star::ReferenceErrorType
strong

This enum describes the type of error that occurred while parsing reference format data.

Enumerator
NoError 

No error occurred.

CategoryConfig 

An error occurred while parsing a reference category config.

BallotBox 

An error occurred while parsing a reference ballot box.

ExpectedResult 

An error occurred while parsing a reference expected result set.

Function Documentation

◆ calculatorOptionsFromReferenceInput()

ReferenceError Star::calculatorOptionsFromReferenceInput ( Star::Calculator::Options & returnBuffer,
const QString & calcOptionsPath )
Parameters
[out]returnBufferA list of calculator options, filled with the provided data.
[in]calcOptionsPathThe path to the calculator option set file.
Returns
An error object containing error details if the operation fails.

◆ electionsFromReferenceInput()

ReferenceError Star::electionsFromReferenceInput ( QList< Election > & returnBuffer,
const QString & categoryConfigPath,
const QString & ballotBoxPath )
Parameters
[out]returnBufferA list of elections, prepared with the provided data.
[in]categoryConfigPathThe path to the category config INI file.
[in]ballotBoxPathThe path to the ballot box CSV file.
Returns
An error object containing error details if the operation fails.

◆ expectedResultsFromReferenceInput()

ReferenceError Star::expectedResultsFromReferenceInput ( QList< ExpectedElectionResult > & returnBuffer,
const QString & resultSetPath )
Parameters
[out]returnBufferA list of expected election results, filled with the provided data.
[in]resultSetPathThe path to the result set JSON file.
Returns
An error object containing error details if the operation fails.