Go to the source code of this file.
◆ mWellDahObjInsertAtDah
| #define mWellDahObjInsertAtDah |
( |
|
dh, |
|
|
|
v, |
|
|
|
vals, |
|
|
|
ascvalonly |
|
) |
| |
Value:{\
if (
mIsUdf(v) )
return false;\
const bool ascendingvalonly = (ascvalonly); \
if ( dah_.isEmpty() || dh >= dah_[dah_.size()-1] )\
{\
if ( !dah_.isEmpty() && ascendingvalonly && v <= vals[dah_.size()-1] )\
return false;\
dah_ += dh; vals += val;\
return true;\
}\
if ( dh < dah_[0] )\
{\
if ( ascendingvalonly && v >= vals[0] )\
return false;\
dah_.insert( 0, dh ); vals.insert( 0, v );\
return true; \
}\
const
int insertidx =
indexOf( dh );\
if ( insertidx<0 ) return false;\
if ( ascendingvalonly && (v <= vals[insertidx] || v >= vals[insertidx+1]) )\
return false;\
dah_.insert( insertidx+1, dh ); vals.insert( insertidx+1, v );\
}