26 #ifndef GEN_CUR2_INCLUDED
27 #define GEN_CUR2_INCLUDED
34 #include "../base/ver.h"
38 #include "../base/str.h"
41 #ifndef CHECK_INCLUDED
42 #include "../base/check.h"
45 #ifndef STACK_INCLUDED
46 #include "../bds/stack.h"
57 static const long GEN_CUR2_MAGIC = 0x4743320AL;
71 gen_cur2_c(
int size,
int c1_start,
int c1_step,
int c1_max,
72 int c2_start,
int c2_step,
int c2_max);
95 "gen_cur2_c::fetch: cursor not open");
96 CHECK(TupleNo <= Size,
97 "gen_cur2_c::fetch: fetch beyond end");
115 if(C1 <= Max1 - Step1)
117 else if(Iter1 < Step1) {
123 "gen_cur2_c::fetch: No more values 1");
130 if(C2 <= Max2 - Step2)
132 else if(Iter2 < Step2) {
138 "gen_cur2_c::fetch: No more values 2");
157 "gen_cur2_c::c1: cursor not open");
159 "gen_cur2_c::c1: fetch must be called first");
160 CHECK(TupleNo <= Size,
161 "gen_cur2_c::c1: fetch beyond end");
175 "gen_cur2_c::c2: cursor not open");
177 "gen_cur2_c::c2: fetch must be called first");
178 CHECK(TupleNo <= Size,
179 "gen_cur2_c::c2: fetch beyond end");
193 "gen_cur2_c::close: cursor not open");
208 if(!stack->push(TupleNo))
214 if(!stack->push(Iter1))
216 if(!stack->push(Iter2))
230 Iter2 = stack->pop();
231 Iter1 = stack->pop();
234 TupleNo = stack->pop();
334 #define GEN_CUR2_NULL (static_cast<gen_cur2_t>(0))
#define CHECK_IMPOSSIBLE(MSG)
Definition: check.h:151
#define CHECK_VALID(EX)
Definition: check.h:85
const char * str_t
Definition: str.h:41
Definition: gen_cur2.h:63
#define STR_NULL
Definition: str.h:52
#define CHECK(EX, MSG)
Definition: check.h:69