Example #1
0
void Extension::updateSelector(Selector &s) const {
  if (isAll()) {
    replaceInSelector(s);
    
  } else if (s.match(target)) {
    s.appendSelector(extension);
  }
}
Any ArticulatedModel::Instruction::Identifier::toAny() const {
    if (isAll()) {
        return Any(Any::ARRAY, "all");
    } else if (isRoot()) {
        return Any(Any::ARRAY, "root");
    } else if (id.initialized()) {
        return Any(int(id));
    } else {
        return Any(name);
    }
}
Example #3
0
 ~CLookupJoinActivityMaster()
 {
     if (!container.queryLocal() && !isAll())
     {
         container.queryJob().freeMPTag(broadcast2MpTag);
         container.queryJob().freeMPTag(broadcast3MpTag);
         container.queryJob().freeMPTag(lhsDistributeTag);
         container.queryJob().freeMPTag(rhsDistributeTag);
         // NB: if mpTag is allocated, the activity base class frees
     }
 }
Example #4
0
/** Combines the current QDjangoWhere with the \a other QDjangoWhere using
 *  a logical OR.
 *
 * \param other
 */
QDjangoWhere QDjangoWhere::operator||(const QDjangoWhere &other) const
{
    if (isAll() || other.isNone())
        return *this;
    else if (isNone() || other.isAll())
        return other;

    QDjangoWhere result;
    result.m_combine = OrCombine;
    result.m_children << *this << other;
    return result;
}
Example #5
0
 void serializeSlaveData(MemoryBuffer &dst, unsigned slave)
 {
     if (!container.queryLocal())
     {
         serializeMPtag(dst, mpTag);
         if (!isAll())
         {
             serializeMPtag(dst, broadcast2MpTag);
             serializeMPtag(dst, broadcast3MpTag);
             serializeMPtag(dst, lhsDistributeTag);
             serializeMPtag(dst, rhsDistributeTag);
         }
     }
 }
Example #6
0
 CLookupJoinActivityMaster(CMasterGraphElement * info) : CMasterActivity(info)
 {
     if (container.queryLocal())
         broadcast2MpTag = broadcast3MpTag, lhsDistributeTag = rhsDistributeTag = TAG_NULL;
     else
     {
         mpTag = container.queryJob().allocateMPTag(); // NB: base takes ownership and free's
         if (!isAll())
         {
             broadcast2MpTag = container.queryJob().allocateMPTag();
             broadcast3MpTag = container.queryJob().allocateMPTag();
             lhsDistributeTag = container.queryJob().allocateMPTag();
             rhsDistributeTag = container.queryJob().allocateMPTag();
         }
     }
 }
Example #7
0
/** Combines the current QDjangoWhere with the \a other QDjangoWhere using
 *  a logical OR.
 *
 * \param other
 */
QDjangoWhere QDjangoWhere::operator||(const QDjangoWhere &other) const
{
    if (isAll() || other.isNone())
        return *this;
    else if (isNone() || other.isAll())
        return other;

    if (d->combine == QDjangoWherePrivate::OrCombine) {
        QDjangoWhere result = *this;
        result.d->children << other;
        return result;
    }

    QDjangoWhere result;
    result.d->combine = QDjangoWherePrivate::OrCombine;
    result.d->children << *this << other;
    return result;
}
Example #8
0
Link* prim(Link *input, int p) {
    bool first = true, cn = false;
    int minW, num = 0, lnum = 0;
    vector<int> points;
    Link
            *start = input->copyList()->getFirst(),
            *start_t,
            *end,
            *end_t;
    points.push_back(start->getX());
    while (!isAll(points, p)) {
        minW = start->maxW();
        start_t = start;
        while (start_t != NULL) {
            if
                (
                    (
                        (
                            count(points.begin(), points.end(), start_t->getX())
                            +
                            count(points.begin(), points.end(), start_t->getY())
                        )
                        == 1
                    )
                    &&
                    (
                        minW >= start_t->getW()
                    )
                ) {
                minW = start_t->getW();
                num = start_t->getN();
            }
            start_t = start_t->getNext();
        }
        if (lnum == num) {
            for(int i = 1; i <= p; i++) {
                if(!count(points.begin(), points.end(), i)) {
                    points.push_back(i);
                    cn = true;
                    break;
                }
            }
        }
        if (cn) {
            cn = false;
            continue;
        }
        lnum = num;
        if (first) {
            end = new Link(start->findForNum(num));
            end_t = end;
            end_t->setNext(NULL);
            end_t->setPrev(NULL);
            first = false;
        } else {
            end_t->addNewLink(start->findForNum(num));
            end_t = end_t->getNext();
        }
        if (!count(points.begin(), points.end(), end_t->getX())) {
            points.push_back(end_t->getX());
        }
        if (!count(points.begin(), points.end(), end_t->getY())) {
            points.push_back(end_t->getY());
        }
    }
    return end;
}
Example #9
0
bool cli::framework::DisplayOptions::isDefault() const
{

	return !isAll() && getDisplay().size() == 0;
}