Connect++
0.4.0
A fast, readable connection prover for first-order logic.
Loading...
Searching...
No Matches
Interval.hpp
1
/*
2
3
Copyright © 2023-24 Sean Holden. All rights reserved.
4
5
*/
6
/*
7
8
This file is part of Connect++.
9
10
Connect++ is free software: you can redistribute it and/or modify it
11
under the terms of the GNU General Public License as published by the
12
Free Software Foundation, either version 3 of the License, or (at your
13
option) any later version.
14
15
Connect++ is distributed in the hope that it will be useful, but WITHOUT
16
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
18
more details.
19
20
You should have received a copy of the GNU General Public License along
21
with Connect++. If not, see <https://www.gnu.org/licenses/>.
22
23
*/
24
25
#ifndef INTERVAL_HPP
26
#define INTERVAL_HPP
27
35
class
Interval
{
36
private
:
37
size_t
count;
38
size_t
limit;
39
public
:
40
Interval
() =
delete
;
41
45
Interval
(
size_t
l) : count(0), limit(0) {
46
if
(l >= 0)
47
limit = l;
48
}
49
54
bool
tick
() {
55
count++;
56
if
(count > limit) {
57
count = 0;
58
return
true
;
59
}
60
return
false
;
61
}
62
};
63
64
#endif
Interval
Simple class to help you count intervals.
Definition
Interval.hpp:35
Interval::tick
bool tick()
Definition
Interval.hpp:54
Interval::Interval
Interval(size_t l)
Definition
Interval.hpp:45
source
utilities
Interval.hpp
Generated by
1.10.0