forked from NikitaS4/UI_lab
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathICompact.h
77 lines (57 loc) · 2.28 KB
/
ICompact.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#ifndef ICOMPACT_H
#define ICOMPACT_H
class IVector;
#include "ILogger.h"
#include<stddef.h>
class ICompact
{
public:
class iterator;
/*factories*/
static ICompact* createCompact(IVector const* const begin, IVector const* const end, ILogger*logger);
/*static operations*/
static ICompact* intersection(ICompact const* const left, ICompact const* const right, ILogger*logger);
//union
static ICompact* add(ICompact const* const left, ICompact const* const right, ILogger*logger);
//methods kill closed!!!
//static ICompact* Difference(ICompact const* const left, ICompact const* const right, ILogger*logger);
//static ICompact* SymDifference(ICompact const* const left, ICompact const* const right, ILogger*logger);
static ICompact* makeConvex(ICompact const* const left, ICompact const* const right, ILogger*logger);
/* returns a step, end, begin with which you can iterate over all domains of compact*/
virtual IVector* getBegin() const = 0;
virtual IVector* getEnd() const = 0;
virtual iterator* end(IVector const* const step = 0) = 0;
virtual iterator* begin(IVector const* const step = 0) = 0;
virtual RESULT_CODE isContains(IVector const* const vec, bool& result) const = 0;
virtual RESULT_CODE isSubSet(ICompact const* const other,bool& result) const = 0;
virtual RESULT_CODE isIntersects(ICompact const* const other, bool& result) const = 0;
virtual size_t getDim() const = 0;
virtual ICompact* clone() const = 0;
/*dtor*/
virtual ~ICompact() = 0;
class iterator
{
public:
//adds step to current value in iterator
//+step
virtual RESULT_CODE doStep() = 0;
virtual IVector* getPoint() const = 0;
//change order of step
virtual RESULT_CODE setDirection(IVector const* const dir) = 0;
/*dtor*/
virtual ~iterator() = default;
protected:
iterator() = default;
private:
/*non default copyable*/
iterator(const iterator& other) = delete;
void operator=( const iterator& other) = delete;
};
protected:
ICompact() = default;
private:
/*non default copyable*/
ICompact(const ICompact& other) = delete;
void operator=( const ICompact& other) = delete;
};
#endif // ICOMPACT_H