| 219 | }; |
| 220 | |
| 221 | struct EqPredicate : IPredicate, ReferenceCounted<EqPredicate>, FastAllocated<EqPredicate> { |
| 222 | void addref() override { ReferenceCounted<EqPredicate>::addref(); } |
| 223 | void delref() override { ReferenceCounted<EqPredicate>::delref(); } |
| 224 | |
| 225 | TypeCode getTypeCode() const override { return TypeCode::EQ; } |
| 226 | |
| 227 | DataValue value; |
| 228 | |
| 229 | explicit EqPredicate(DataValue const& value) : value(value) {} |
| 230 | |
| 231 | Future<bool> evaluate(Reference<IReadContext> const& context) override; |
| 232 | // EqPredicate can't be simplified, so no simplify() |
| 233 | std::string toString() override; |
| 234 | |
| 235 | void simplify_and(SimplifyAndContext& combinable) override; |
| 236 | |
| 237 | bool range_is_tight() override { return true; } |
| 238 | |
| 239 | void get_range(Optional<DataValue>& min, Optional<DataValue>& max) override { |
| 240 | min = value; |
| 241 | max = value; |
| 242 | } |
| 243 | // Not(Eq) could be translated to Or(Range,Range), but it's not |
| 244 | // obvious that this is always a win without knowing about |
| 245 | // available indexes, so no simplify_not() here. |
| 246 | }; |
| 247 | |
| 248 | struct NotPredicate : IPredicate, ReferenceCounted<NotPredicate>, FastAllocated<NotPredicate> { |
| 249 | void addref() override { ReferenceCounted<NotPredicate>::addref(); } |
nothing calls this directly
no outgoing calls
no test coverage detected