BAM
Abstract Machine for Bottom-Up Evaluation with the Push Method
cur_2.h
Go to the documentation of this file.
1 // ============================================================================
2 // Project: Deductive Database
3 // Filename: cur_2.h
4 // Purpose: Cursor for list of rows with two int columns
5 // Last Change: 01.08.2017
6 // Language: C++
7 // EMail: brass@informatik.uni-halle.de
8 // WWW: http://www.informatik.uni-halle.de/~brass/
9 // Address: Feldschloesschen 15, D-06120 Halle (Saale), GERMANY
10 // Copyright: (c) 2015-2017 by Stefan Brass
11 // License: See file "LICENSE" for copying conditions.
12 // Note: There is no warranty at all - this code may contain bugs.
13 // ============================================================================
14 
15 
22 //=============================================================================
23 // Include File Frame:
24 //=============================================================================
25 
26 #ifndef CUR_2_INCLUDED
27 #define CUR_2_INCLUDED
28 
29 //=============================================================================
30 // Used Types and Macros:
31 //=============================================================================
32 
33 #ifndef VER_INCLUDED
34 #include "../base/ver.h"
35 #endif
36 
37 #ifndef STR_INCLUDED
38 #include "../base/str.h"
39 #endif
40 
41 #ifndef CHECK_INCLUDED
42 #include "../base/check.h"
43 #endif
44 
45 #ifndef ROW_2_INCLUDED
46 #include "../rel/row_2.h"
47 #endif
48 
49 #ifndef LIST_2_INCLUDED
50 #include "../rel/list_2.h"
51 #endif
52 
53 #ifndef CUR_LIST_INCLUDED
54 #include "../rel/cur_list.h"
55 #endif
56 
57 
58 //=============================================================================
59 // Cursor over List of Rows with two int columns:
60 //=============================================================================
61 
62 class cur_2_c: public cur_list_c<row_2_c> {
63 
64  public:
65 
66 //-----------------------------------------------------------------------------
67 // Constructor, Destructor:
68 //-----------------------------------------------------------------------------
69 
70  // Constructor:
71  cur_2_c(const list_2_c *list);
72 
73  // Destructor:
74  ~cur_2_c();
75 
76 //-----------------------------------------------------------------------------
77 // Copy-constructor and assignment operator are not supported for this class:
78 //-----------------------------------------------------------------------------
79 
80  private:
81 
82  cur_2_c(const cur_2_c& obj); // Not implemented
83  cur_2_c& operator=(const cur_2_c& obj); // Not implemented
84 
85 
86 //=============================================================================
87 // (Object) Methods:
88 //=============================================================================
89 
90  public:
91 
92 //-----------------------------------------------------------------------------
93 // c1: Return value for column 1 of current row in cursor.
94 //-----------------------------------------------------------------------------
95 
96  inline int c1() {
97  return cur_list_c<row_2_c>::row()->c1();
98  }
99 
100 //-----------------------------------------------------------------------------
101 // c2: Return value for column 2 of current row in cursor.
102 //-----------------------------------------------------------------------------
103 
104  inline int c2() {
105  return cur_list_c<row_2_c>::row()->c2();
106  }
107 
108 //=============================================================================
109 // End of Class Template:
110 //=============================================================================
111 
112 };
113 
114 
115 //-----------------------------------------------------------------------------
116 // Define pointer type:
117 //-----------------------------------------------------------------------------
118 
119 typedef cur_2_c *cur_2_t;
120 
121 //-----------------------------------------------------------------------------
122 // Define null pointer:
123 //-----------------------------------------------------------------------------
124 
125 #define CUR_2_NULL (static_cast<cur_2_t>(0))
126 
127 
128 //=============================================================================
129 // End of Include File:
130 //=============================================================================
131 
132 #endif
133 
Definition: list_2.h:58
Definition: cur_list.h:68
Definition: cur_2.h:62