-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathPartSpec.h
52 lines (44 loc) · 1003 Bytes
/
PartSpec.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
44
45
46
47
48
49
50
51
52
#pragma once
#include <boost/scoped_array.hpp>
#include <boost/logic/tribool.hpp>
#include <mU/Kernel.h>
namespace mU
{
class LevelSpec
{
private:
int min_level;
int max_level;
int min_depth;
int max_depth;
static int get_int(Var e, Var spec);
void init(Var spec);
public:
LevelSpec(int level = 1);
LevelSpec(Var spec);
bool filter(size_t level, size_t depth) const;
};
class SequenceSpec
{
private:
// TODO: precompile the sequence spec rather than during the initialization of LevelIterator
boost::scoped_array<var> spec_;
size_t spec_length_;
public:
SequenceSpec(Var spec, size_t start);
size_t spec_length() const { return spec_length_; }
class LevelIterator
{
private:
sint min_;
sint max_;
sint step_;
sint current_;
public:
LevelIterator(const SequenceSpec &spec, size_t dim, size_t level);
bool has_next() const;
size_t next();
};
friend class LevelIterator;
};
}