22 #include "qgis_core.h"
65 T
lower()
const {
return mLower; }
72 T
upper()
const {
return mUpper; }
95 bool isEmpty()
const {
return mLower > mUpper || ( mUpper == mLower && !( mIncludeLower || mIncludeUpper ) ); }
101 bool isSingleton()
const {
return mLower == mUpper && ( mIncludeLower || mIncludeUpper ); }
109 bool lowerOk = ( mIncludeLower && mLower <= other.mLower )
110 || ( !mIncludeLower && mLower < other.mLower )
111 || ( !mIncludeLower && !other.mIncludeLower && mLower <= other.mLower );
115 bool upperOk = ( mIncludeUpper && mUpper >= other.mUpper )
116 || ( !mIncludeUpper && mUpper > other.mUpper )
117 || ( !mIncludeUpper && !other.mIncludeUpper && mUpper >= other.mUpper );
129 bool lowerOk = ( mIncludeLower && mLower <= element )
130 || ( !mIncludeLower && mLower < element );
134 bool upperOk = ( mIncludeUpper && mUpper >= element )
135 || ( !mIncludeUpper && mUpper > element );
148 if ( ( ( mIncludeLower && mLower <= other.mLower ) || ( !mIncludeLower && mLower < other.mLower ) )
149 && ( ( mIncludeUpper && mUpper >= other.mUpper ) || ( !mIncludeUpper && mUpper > other.mUpper ) ) )
152 if ( ( ( mIncludeLower && mLower <= other.mLower ) || ( !mIncludeLower && mLower < other.mLower ) )
153 && ( ( mIncludeUpper && mUpper >= other.mLower ) || ( !mIncludeUpper && mUpper > other.mLower ) ) )
156 if ( ( ( mIncludeLower && mLower <= other.mUpper ) || ( !mIncludeLower && mLower < other.mUpper ) )
157 && ( ( mIncludeUpper && mUpper >= other.mUpper ) || ( !mIncludeUpper && mUpper > other.mUpper ) ) )
160 if ( ( ( mIncludeLower && mLower >= other.mLower ) || ( !mIncludeLower && mLower > other.mLower ) )
161 && ( ( mIncludeLower && mLower <= other.mUpper ) || ( !mIncludeLower && mLower < other.mUpper ) ) )
164 if ( mLower == other.mLower && mUpper == other.mUpper )
174 bool mIncludeLower =
true;
175 bool mIncludeUpper =
true;
218 template <
typename T>
252 T
end()
const {
return mUpper; }
274 bool isInstant()
const {
return mLower.isValid() && mUpper.isValid() && mLower == mUpper && ( mIncludeLower || mIncludeUpper ); }
283 return !mLower.isValid() && !mUpper.isValid();
293 if ( !mLower.isValid() && !mUpper.isValid() )
296 if ( mLower.isValid() != mUpper.isValid() )
299 if ( mLower > mUpper )
302 if ( mLower == mUpper && !( mIncludeLower || mIncludeUpper ) )
313 if ( !other.mLower.isValid() && mLower.isValid() )
316 if ( mLower.isValid() )
318 bool lowerOk = ( mIncludeLower && mLower <= other.mLower )
319 || ( !mIncludeLower && mLower < other.mLower )
320 || ( !mIncludeLower && !other.mIncludeLower && mLower <= other.mLower );
325 if ( !other.mUpper.isValid() && mUpper.isValid() )
328 if ( mUpper.isValid() )
330 bool upperOk = ( mIncludeUpper && mUpper >= other.mUpper )
331 || ( !mIncludeUpper && mUpper > other.mUpper )
332 || ( !mIncludeUpper && !other.mIncludeUpper && mUpper >= other.mUpper );
345 if ( !element.isValid() )
348 if ( mLower.isValid() )
350 bool lowerOk = ( mIncludeLower && mLower <= element )
351 || ( !mIncludeLower && mLower < element );
356 if ( mUpper.isValid() )
358 bool upperOk = ( mIncludeUpper && mUpper >= element )
359 || ( !mIncludeUpper && mUpper > element );
372 if ( !mUpper.isValid() && ( ( mIncludeLower && mLower <= other.mUpper ) || ( !mIncludeLower && mLower < other.mUpper ) ) )
375 if ( ( ( mIncludeLower && mLower <= other.mLower ) || ( !mIncludeLower && mLower < other.mLower ) )
376 && ( ( mIncludeUpper && mUpper >= other.mUpper ) || ( !mIncludeUpper && mUpper > other.mUpper ) ) )
379 if ( ( ( mIncludeLower && mLower <= other.mLower ) || ( !mIncludeLower && mLower < other.mLower ) )
380 && ( ( mIncludeUpper && mUpper >= other.mLower ) || ( !mIncludeUpper && mUpper > other.mLower ) ) )
383 if ( ( ( mIncludeLower && mLower <= other.mUpper ) || ( !mIncludeLower && mLower < other.mUpper ) )
384 && ( ( mIncludeUpper && mUpper >= other.mUpper ) || ( !mIncludeUpper && mUpper > other.mUpper ) ) )
387 if ( ( ( mIncludeLower && mLower >= other.mLower ) || ( !mIncludeLower && mLower > other.mLower ) )
388 && ( ( mIncludeLower && mLower <= other.mUpper ) || ( !mIncludeLower && mLower < other.mUpper ) ) )
391 if ( mLower == other.mLower && mUpper == other.mUpper )
413 mLower = other.
begin();
414 mUpper = other.
end();
421 bool changed {
false };
424 if ( ! other.
begin().isValid()
425 || (
begin().isValid() && other.
begin() < mLower ) )
427 mLower = other.
begin();
433 mIncludeLower =
true;
438 if ( ! other.
end().isValid()
439 || (
end().isValid() && other.
end() > mUpper ) )
441 mUpper = other.
end();
445 else if ( other.
end() == mUpper && other.
includeEnd() && ! mIncludeUpper )
447 mIncludeUpper =
true;
455 return mLower == other.mLower &&
456 mUpper == other.mUpper &&
463 return ( !
operator==( other ) );
470 bool mIncludeLower =
true;
471 bool mIncludeUpper =
true;