Пример #1
0
void IndexedIdentifierRange::add(SPDomainItem item)
{
    if (!item->isValid())
        return;

    SPIndexedIdentifier ii = item.staticCast<IndexedIdentifier>();
    _start = ii;
    _count = ii->_count;

    return;
}
Пример #2
0
void NumericItemRange::add(SPDomainItem item)
{
    if ( item.isNull() || !item->isValid() || item->valueType() != itNUMERICITEM)
        return;

    SPNumericItem nitem = item.staticCast<NumericItem>();
    for(auto iter = _items.rbegin(); iter != _items.rend(); ++iter) {
        if ( nitem->range() > (*iter)->range()) {
            if ( nitem->raw() == iUNDEF)
                nitem->_raw = _items.size();
            _items.insert(iter.base(),1, nitem );
            return;
        }
    }
    if ( _items.size() == 0) { // no overlapping items allowed; so the only case that is legal here is the first
        nitem->_raw = 0;
        _items.push_back(nitem);
    }
}