Skip to content

Commit 0d375f6

Browse files
committed
relmodel: Add method sqltype::consistent().
This allows modelling type compatibility beyond equality.
1 parent 86c07c9 commit 0d375f6

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

relmodel.cc

+6-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,9 @@ sqltype * sqltype::get(string n)
88
return typemap[n];
99
else
1010
return typemap[n] = new sqltype(n);
11-
};
11+
}
12+
13+
bool sqltype::consistent(struct sqltype *rvalue)
14+
{
15+
return this == rvalue;
16+
}

relmodel.hh

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ struct sqltype {
2121
static map<string, struct sqltype*> typemap;
2222
static struct sqltype *get(string s);
2323
sqltype(string n) : name(n) { }
24+
virtual bool consistent(struct sqltype *rvalue);
2425
};
2526

2627
struct column {

0 commit comments

Comments
 (0)