-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCandidateWithID.h
43 lines (36 loc) · 1.04 KB
/
CandidateWithID.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#pragma once
#include "Candidate.h"
namespace pec
{
/**
* \class CandidateWithID
* \brief Adds a set of user-defined booleand IDs to the class Candidate
*
* The ID flags are accessed by index, up to 8 flags are supported. If a flag is set to true, the
* candidate is supposed to be "good" in what concerns the corresponding ID.
*/
class CandidateWithID: public Candidate
{
public:
/// Constructor with no parameters
CandidateWithID() noexcept;
public:
/// Resets the object to a state right after the default initialisation
virtual void Reset() override;
/**
* \brief Sets or unsets an ID bit
*
* Throws an exception if the index exceeds the maximal allowed number of flags.
*/
void SetBit(unsigned index, bool value = true);
/**
* \brief Tests an ID bit
*
* Throws an exception if the index exceeds the maximal allowed number of flags.
*/
bool TestBit(unsigned index) const;
private:
/// Variable to hold ID flags
UChar_t id;
};
} // end of namespace pec