piecePairTable.h Source File

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
piecePairTable.h
Go to the documentation of this file.
1 /* piecePairTable.h
2 */
3 #ifndef EVAL_PPAIR_PIECEPAIRTABLE_H
4 #define EVAL_PPAIR_PIECEPAIRTABLE_H
5
6 #include "osl/eval/ppair/piecePairIndex.h"
7
8 namespace osl
9 {
10 namespace eval
11 {
12 namespace ppair
13 {
20 template <class T>
21 class PiecePairTable : public PiecePairIndex
22 {
23 public:
24 typedef T value_type;
25 protected:
30 mutable CArray<value_type, maxPairIndex> values;
31 PiecePairTable() { values.fill(); }
32 ~PiecePairTable() {}
33 public:
34 int value(unsigned int i) const
35 {
36 return values[i];
37 }
38 value_type& valueOf(unsigned int i1, unsigned int i2)
39 {
40 const unsigned int index = indexOf(i1,i2);
41 return values[index];
42 }
43 value_type& valueOf(Piece p1, Piece p2)
44 {
45 const unsigned int index = indexOf(p1,p2);
46 return values[index];
47 }
48 int valueOf(unsigned int i1, unsigned int i2) const
49 {
50 const unsigned int index = indexOf(i1,i2);
51 return values[index];
52 }
53 int valueOf(Piece p1, Piece p2) const
54 {
55 const unsigned int index = indexOf(p1,p2);
56 return values[index];
57 }
58
59 };
60
61 } // namespace ppair
62 } // namespace eval
63 } // namespace osl
64
65
66 #endif /* EVAL_PPAIR_PIECEPAIRTABLE_H */
67 // ;;; Local Variables:
68 // ;;; mode:c++
69 // ;;; c-basic-offset:2
70 // ;;; End: