1 // (c) bernhard schupp 1997 - 1998
2 #ifndef KEY_H_INCLUDED
3 #define KEY_H_INCLUDED
4 
5 namespace ALUGrid
6 {
7 
8   template < class A > class Key3
9   {
10   protected :
11     A _a, _b, _c ;
12   public :
13     Key3 () ;
14     Key3 (const A &,const A &,const A &) ;
15     Key3 (const Key3 < A > &) ;
16     const Key3 < A > & operator = (const Key3 < A > &) ;
17     bool operator < (const Key3 < A > &) const ;
18   } ;
19 
20   template < class A > class Key4
21   {
22     protected :
23       A _a, _b, _c, _d ;
24     public :
25       Key4 () ;
26       Key4 (const A &, const A &, const A &, const A &) ;
27       Key4 (const Key4 < A > &) ;
28       const Key4 < A > & operator = (const Key4 < A > &) ;
29       bool operator < (const Key4 < A > &) const ;
30   } ;
31 
Key3()32   template < class A > inline Key3 < A > :: Key3 () : _a (-1), _b (-1), _c (-1) {
33     return ;
34   }
35 
Key3(const A & a,const A & b,const A & c)36   template < class A > inline Key3 < A > :: Key3 (const A & a, const A & b, const A & c) : _a (a), _b (b), _c (c) {
37     return ;
38   }
39 
Key3(const Key3<A> & k)40   template < class A > inline Key3 < A > :: Key3 (const Key3 < A > & k) : _a (k._a), _b (k._b), _c (k._c) {
41     return ;
42   }
43 
44   template < class A > inline const Key3 < A > & Key3 < A > :: operator = (const Key3 < A > & k) {
45     _a = k._a ;
46     _b = k._b ;
47     _c = k._c ;
48     return * this ;
49   }
50 
51   template < class A > inline bool Key3 < A > :: operator < (const Key3 < A > & k) const {
52     return _a < k._a ? true : (_a == k._a ? (_b < k._b ? true : (_b == k._b ? (_c < k._c ? true : false) : false)) : false) ;
53   }
54 
Key4()55   template < class A > inline Key4 < A > :: Key4 () : _a (), _b (), _c (), _d () {
56     return ;
57   }
58 
Key4(const A & a,const A & b,const A & c,const A & d)59   template < class A > inline Key4 < A > :: Key4 (const A & a, const A & b, const A & c, const A & d) : _a(a), _b (b), _c (c), _d (d) {
60     return ;
61   }
62 
Key4(const Key4<A> & k)63   template < class A > inline Key4 < A > :: Key4 (const Key4 < A > & k) : _a (k._a), _b (k._b), _c(k._c), _d (k._d) {
64     return ;
65   }
66 
67   template < class A > inline const Key4 < A > & Key4 < A > :: operator = (const Key4 < A > & k) {
68     _a = k._a ;
69     _b = k._b ;
70     _c = k._c ;
71     _d = k._d ;
72     return * this ;
73   }
74 
75   template < class A > inline bool Key4 < A >  :: operator < (const Key4 < A > & k) const {
76     return _a < k._a ? true : (_a == k._a ? (_b < k._b ? true : (_b == k._b ? (_c < k._c ? true :
77     (_c == k._c ? (_d < k._d ? true : false) : false)) : false)) : false) ;
78   }
79 
80 } // namespace ALUGrid
81 
82 #endif // #ifndef KEY_H_INCLUDED
83