11 #ifndef _RD_NULLQUERYALGEBRA_H
12 #define _RD_NULLQUERYALGEBRA_H
19 void mergeBothNullQ(T *&returnQuery, T *&otherNullQ,
21 bool negatedQ = returnQuery->getNegation();
22 bool negatedOtherQ = otherNullQ->getNegation();
26 if (!negatedQ && negatedOtherQ) {
27 returnQuery->setNegation(
true);
31 if (negatedQ && !negatedOtherQ) {
32 returnQuery->setNegation(
false);
35 if (!negatedQ && !negatedOtherQ) {
36 returnQuery->setNegation(
true);
37 }
else if (negatedQ + negatedOtherQ == 1) {
38 returnQuery->setNegation(
false);
44 void mergeNullQFirst(T *&returnQuery, T *&otherQ,
46 bool negatedQ = returnQuery->getNegation();
50 std::swap(returnQuery, otherQ);
54 std::swap(returnQuery, otherQ);
57 std::swap(returnQuery, otherQ);
59 returnQuery->setNegation(!returnQuery->getNegation());
73 "bad combination op");
75 if (isQueryNull && isOtherQNull) {
76 mergeBothNullQ(returnQuery, otherQuery, how);
77 }
else if (isQueryNull) {
78 mergeNullQFirst(returnQuery, otherQuery, how);
79 }
else if (isOtherQNull) {
80 std::swap(returnQuery,otherQuery);
81 mergeNullQFirst(returnQuery, otherQuery, how);