wavelength 1.0.0
Loading...
Searching...
No Matches
slotgrid.h
Go to the documentation of this file.
1#pragma once
2
3#include <vector>
4
10class SlotGrid {
11public:
19 explicit SlotGrid(int nSections);
20
29 void SetPattern(int nPattern, int nSection);
30
39 bool HasPattern(int nSection) const;
40
49 int GetPattern(int nSection) const;
50
58 int GetNumSections() const;
59
67 int GetNumFree() const;
68
69private:
70 std::vector<int> mPatterns;
71 int mNumFree;
72};
void SetPattern(int nPattern, int nSection)
Set the pattern a section repeats, and count the sections that repeat none.
bool HasPattern(int nSection) const
Report whether a section repeats a pattern.
SlotGrid(int nSections)
Construct a grid in which no section repeats a pattern.
int GetNumFree() const
Report the number of sections that repeat no pattern.
int GetNumSections() const
Report the number of sections.
int GetPattern(int nSection) const
Report the pattern a section repeats.