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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
|
#ifndef Already_Included_Dynamic_Array
#define Already_Included_Dynamic_Array
namespace omega {
template <class T> class Dynamic_Array2;
template <class T> class Dynamic_Array3;
template <class T> class Dynamic_Array4;
template <class T, int d> class Dynamic_Array
{
public:
Dynamic_Array(Dynamic_Array<T,d> &D);
~Dynamic_Array();
protected:
Dynamic_Array();
bool partial;
int *bounds;
T *elements;
void do_constr();
void do_destruct();
};
template <class T> class Dynamic_Array1 : public Dynamic_Array<T,1>
{
public:
Dynamic_Array1(const char *s0 = 0);
Dynamic_Array1(int d0);
void resize(int d0);
T& operator[](int d);
friend class Dynamic_Array2<T>;
private:
void do_construct(int d0);
};
template <class T> class Dynamic_Array2 : public Dynamic_Array<T,2>
{
public:
Dynamic_Array2(const char *s0 = 0, const char *s1 = 0);
Dynamic_Array2(int d0, int d1);
void resize(int d0, int d1);
Dynamic_Array1<T> operator[](int d);
friend class Dynamic_Array3<T>;
private:
void do_construct(int d0, int d1);
};
template <class T> class Dynamic_Array3 : public Dynamic_Array<T,3>
{
public:
Dynamic_Array3(const char *s0 = 0, const char *s1 = 0, const char *s2 = 0);
Dynamic_Array3(int d0, int d1, int d2);
void resize(int d0, int d1, int d2);
Dynamic_Array2<T> operator[](int d);
friend class Dynamic_Array4<T>;
private:
void do_construct(int d0, int d1, int d2);
};
template <class T> class Dynamic_Array4 : public Dynamic_Array<T,4>
{
public:
Dynamic_Array4(const char *s0 = 0, const char *s1 = 0, const char *s2 = 0, const char *s3 = 0);
Dynamic_Array4(int d0, int d1, int d2, int d3);
void resize(int d0, int d1, int d2, int d3);
Dynamic_Array3<T> operator[](int d);
private:
void do_construct(int d0, int d1, int d2, int d3);
};
} // namespace
#if ! defined DONT_INCLUDE_TEMPLATE_CODE
#include <basic/Dynamic_Array.c>
#endif
#define instantiate_Dynamic_Array1(T) template class Dynamic_Array1<T>; \
template class Dynamic_Array<T,1>;
#define instantiate_Dynamic_Array2(T) template class Dynamic_Array2<T>; \
template class Dynamic_Array<T,2>; \
instantiate_Dynamic_Array1(T);
#define instantiate_Dynamic_Array3(T) template class Dynamic_Array3<T>; \
template class Dynamic_Array<T,3>; \
instantiate_Dynamic_Array2(T);
#define instantiate_Dynamic_Array4(T) template class Dynamic_Array4<T>; \
template class Dynamic_Array<T,4>; \
instantiate_Dynamic_Array3(T);
#endif
|