当前位置: 首页>>代码示例>>C++>>正文


C++ SAFE_POINT函数代码示例

本文整理汇总了C++中SAFE_POINT函数的典型用法代码示例。如果您正苦于以下问题:C++ SAFE_POINT函数的具体用法?C++ SAFE_POINT怎么用?C++ SAFE_POINT使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了SAFE_POINT函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: SAFE_POINT

char MaIterator::operator *() {
    SAFE_POINT(isInRange(position), "Out of boundaries", U2Msa::INVALID_CHAR);
    const QPoint maPoint = getMaPoint();
    SAFE_POINT(0 <= maPoint.x() && maPoint.x() < ma->getLength() &&
               0 <= maPoint.y() && maPoint.y() < ma->getNumRows(), "Out of boundaries", U2Msa::INVALID_CHAR);
    return ma->charAt(maPoint.y(), maPoint.x());
}
开发者ID:ggrekhov,项目名称:ugene,代码行数:7,代码来源:MaIterator.cpp

示例2: SAFE_POINT

QWidget * PcrOptionsPanelSavableTab::getPrimerEditWidgetById(const QString &childId) const {
    const QStringList ids = childId.split(WIDGET_ID_SEPARATOR);
    SAFE_POINT(2 == ids.size(), "Invalid widget ID", NULL);
    QWidget *primerGroup = wrappedWidget->findChild<QWidget *>(ids.first());
    SAFE_POINT(NULL != primerGroup, "Invalid parent widget", NULL);
    return primerGroup->findChild<QWidget *>(ids.last());
}
开发者ID:ugeneunipro,项目名称:ugene,代码行数:7,代码来源:PcrOptionsPanelSavableTab.cpp

示例3: SAFE_POINT

inline bool ReadShortReadsSubTask::add(int &CMAX, int &W, int &q, int &readNum, SearchQuery *query, GenomeAlignerTask *parent) {
    SAFE_POINT(NULL != dataBunch, "No dataBunch", false);
    SAFE_POINT(NULL != query, "No query", false);

    W = query->length();
    if (!alignContext.absMismatches) {
        CMAX = (W * alignContext.ptMismatches) / MAX_PERCENTAGE;
    }
    q = W / (CMAX + 1);
    CHECK_EXT(0 != q,, false);

    const char* querySeq = query->constData();
    SAFE_POINT(NULL != querySeq, "No querySeq", false);

    int win = query->length() < GenomeAlignerTask::MIN_SHORT_READ_LENGTH ?
        GenomeAlignerTask::calculateWindowSize(alignContext.absMismatches,
            alignContext.nMismatches, alignContext.ptMismatches, query->length(), query->length()) :
        GenomeAlignerTask::calculateWindowSize(alignContext.absMismatches,
            alignContext.nMismatches, alignContext.ptMismatches, alignContext.minReadLength, alignContext.maxReadLength);

    for (int i = 0; i < W - q + 1; i+=q) {
        const char *seq = querySeq + i;
        BMType bv = parent->index->getBitValue(seq, qMin(GenomeAlignerIndex::charsInMask, W - i));

        dataBunch->bitValuesV.append(bv);
        dataBunch->readNumbersV.append(readNum);
        dataBunch->positionsAtReadV.append(i);
        dataBunch->windowSizes.append(win);
    }
    readNum++;
    dataBunch->queries.append(query);

    return true;
}
开发者ID:ggrekhov,项目名称:ugene,代码行数:34,代码来源:ReadShortReadsSubTask.cpp

示例4: SAFE_POINT

bool ActorCfgFilterProxyModel::filterAcceptsRow(int sourceRow, const QModelIndex & /*sourceParent*/) const {
    ActorCfgModel *srcModel = qobject_cast<ActorCfgModel *>(sourceModel());
    SAFE_POINT(NULL != srcModel, "Invalid actor configuration model", true);

    Attribute *attr = srcModel->getAttributeByRow(sourceRow);
    SAFE_POINT(NULL != attr, "Invalid actor attribute", true);

    return srcModel->isVisible(attr);
}
开发者ID:ggrekhov,项目名称:ugene,代码行数:9,代码来源:ActorCfgFilterProxyModel.cpp

示例5: SAFE_POINT

GUITests GUITestService::postActions() {

    UGUITestBase* tb = AppContext::getGUITestBase();
    SAFE_POINT(NULL != tb,"",GUITests());

    GUITests additionalChecks = tb->takeTests(UGUITestBase::PostAdditionalActions);
    SAFE_POINT(additionalChecks.size()>0,"",GUITests());

    return additionalChecks;
}
开发者ID:ggrekhov,项目名称:ugene,代码行数:10,代码来源:GUITestService.cpp

示例6: SAFE_POINT

QWidget* RefSeqCommonWidgetFactory::createWidget(GObjectView *objView) {
    SAFE_POINT(NULL != objView, QString("NULL object view!"), NULL);

    MSAEditor* msa = qobject_cast<MSAEditor*>(objView);
    SAFE_POINT(NULL != msa, QString("Not MSAEditor!"), NULL);

    RefSeqCommonWidget *widget = new RefSeqCommonWidget(msa);

    return widget;
}
开发者ID:m-angelov,项目名称:ugene,代码行数:10,代码来源:RefSeqCommonWidget.cpp

示例7: close

bool TestDbiProvider::init(const QString& dbiFileName, bool _useConnectionPool){
    if(initialized){
        close();
        initialized = false;
    }

    TestRunnerSettings* trs = AppContext::getAppSettings()->getTestRunnerSettings();
    QString originalFile = trs->getVar("COMMON_DATA_DIR") + "/" + dbiFileName;

    QString tmpFile = QDir::temp().absoluteFilePath(QFileInfo(originalFile).fileName());

    if(QFile::exists(tmpFile)) {
        QFile::remove(tmpFile);
    }

    bool _create = false;
    if (QFile::exists(originalFile)) {
        SAFE_POINT(QFile::copy(originalFile, tmpFile), "db file not copied", false);
    }else{
        _create = true;
    }

    dbUrl = tmpFile;
    useConnectionPool = _useConnectionPool;

    U2DbiFactory *factory = AppContext::getDbiRegistry()->getDbiFactoryById(SQLITE_DBI_ID);
    SAFE_POINT(factory!=NULL, "No dbi factory", false);
    U2OpStatusImpl opStatus;

    if(useConnectionPool){
        U2DbiRef ref;
        ref.dbiFactoryId = factory->getId();
        ref.dbiId = dbUrl;
        dbi = AppContext::getDbiRegistry()->getGlobalDbiPool()->openDbi(ref, _create, opStatus);
        CHECK_OP(opStatus, false);
    }else{
        dbi = factory->createDbi();
        SAFE_POINT(NULL != dbi, "dbi not created", false);
        QHash<QString, QString> properties;
        if(_create){
           properties[U2DbiOptions::U2_DBI_OPTION_CREATE] = U2DbiOptions::U2_DBI_VALUE_ON;
        }
        properties["url"] = dbUrl;
        QVariantMap persistentData;
        dbi->init(properties, persistentData, opStatus);
        SAFE_POINT_OP(opStatus, false);
    }
    U2ObjectDbi* objDbi = dbi->getObjectDbi();
    SAFE_POINT(NULL != objDbi,  "object dbi not loaded", false);

    initialized = true;
    return true;
}
开发者ID:ugeneunipro,项目名称:ugene,代码行数:53,代码来源:DbiTest.cpp

示例8: SAFE_POINT

QWidget* AssemblyNavigationWidgetFactory::createWidget(GObjectView* objView) {
    SAFE_POINT(NULL != objView,
        QString("Internal error: unable to create widget for group '%1', object view is NULL.").arg(GROUP_ID),
        NULL);

    AssemblyBrowser* assemblyBrowser = qobject_cast<AssemblyBrowser*>(objView);
    SAFE_POINT(NULL != assemblyBrowser,
        QString("Internal error: unable to cast object view to Assembly Browser for group '%1'.").arg(GROUP_ID),
        NULL);

    AssemblyNavigationWidget* widget = new AssemblyNavigationWidget(assemblyBrowser, assemblyBrowser->getMainWidget());
    return widget;
}
开发者ID:m-angelov,项目名称:ugene,代码行数:13,代码来源:AssemblyNavigationWidget.cpp

示例9: SAFE_POINT

QWidget * MSAExportConsensusFactoryTab::createWidget(GObjectView* objView) {
    SAFE_POINT(NULL != objView,
        QString("Internal error: unable to create widget for group '%1', object view is NULL.").arg(GROUP_ID),
        NULL);

    MSAEditor* msa = qobject_cast<MSAEditor*>(objView);
    SAFE_POINT(NULL != msa,
        QString("Internal error: unable to cast object view to MSAEditor for group '%1'.").arg(GROUP_ID),
        NULL);

    MSAExportConsensusTab *widget = new MSAExportConsensusTab(msa);
    return widget;
}
开发者ID:m-angelov,项目名称:ugene,代码行数:13,代码来源:MSAExportConsensusTabFactory.cpp

示例10: SAFE_POINT

QWidget * SeqStatisticsWidgetFactory::createWidget(GObjectView* objView) {
    SAFE_POINT(NULL != objView,
        QString("Internal error: unable to create widget for group '%1', object view is NULL.").arg(GROUP_ID),
        NULL);

    MSAEditor* msa = qobject_cast<MSAEditor*>(objView);
    SAFE_POINT(NULL != msa,
        QString("Internal error: unable to cast object view to MSAEditor for group '%1'.").arg(GROUP_ID),
        NULL);

    SeqStatisticsWidget *SeqStatisticsWidgetWidget = new SeqStatisticsWidget(msa);
    return SeqStatisticsWidgetWidget;
}
开发者ID:neuroidss,项目名称:ugene,代码行数:13,代码来源:SeqStatisticsWidgetFactory.cpp

示例11: SAFE_POINT

QWidget * FindPatternWidgetFactory::createWidget(GObjectView* objView) {
    SAFE_POINT(NULL != objView,
        QString("Internal error: unable to create widget for group '%1', object view is NULL.").arg(GROUP_ID),
        NULL);

    AnnotatedDNAView* annotatedDnaView = qobject_cast<AnnotatedDNAView*>(objView);
    SAFE_POINT(NULL != annotatedDnaView,
        QString("Internal error: unable to cast object view to AnnotatedDNAView for group '%1'.").arg(GROUP_ID),
        NULL);

    FindPatternWidget* widget = new FindPatternWidget(annotatedDnaView);
    widget->setObjectName("FindPatternWidget");
    return widget;
}
开发者ID:m-angelov,项目名称:ugene,代码行数:14,代码来源:FindPatternWidgetFactory.cpp

示例12: SAFE_POINT

QWidget* MSATreeOptionsWidgetFactory::createWidget(GObjectView* objView) {
    SAFE_POINT(NULL != objView,
        QString("Internal error: unable to create widget for group '%1', object view is NULL.").arg(GROUP_ID),
        NULL);

    MSAEditor* msa = qobject_cast<MSAEditor*>(objView);
    SAFE_POINT(NULL != msa,
        QString("Internal error: unable to cast object view to MSAEditor for group '%1'.").arg(GROUP_ID),
        NULL);

    SAFE_POINT(NULL != viewSettings, "Invalid tree view settings", NULL);
    TreeOptionsWidget *treeOpWidget = new TreeOptionsWidget(msa, *viewSettings);
    connect(treeOpWidget, SIGNAL(saveViewSettings(const TreeOpWidgetViewSettings&)), SLOT(sl_onWidgetViewSaved(const TreeOpWidgetViewSettings&)));
    return treeOpWidget;
}
开发者ID:m-angelov,项目名称:ugene,代码行数:15,代码来源:TreeOptionsWidgetFactory.cpp

示例13: SAFE_POINT

GroupOptionsWidget* OptionsPanelWidget::createOptionsWidget(const QString& groupId,
                                                            const QString& title,
                                                            const QString& documentationPage,
                                                            QWidget* _widget, QList<QWidget*> commonWidgets)
{
    SAFE_POINT(NULL != _widget, "NULL main widget!",  NULL);
    QWidget *innerWidgets = new QWidget;
    QVBoxLayout *layout = new QVBoxLayout;
    layout->setContentsMargins(0, 0, 0, 0);
    layout->setMargin(0);

    foreach (QWidget *commonWidget, commonWidgets) {
        SAFE_POINT(NULL != commonWidget, "NULL common widget!",  NULL);
        layout->addWidget(commonWidget);
    }
开发者ID:m-angelov,项目名称:ugene,代码行数:15,代码来源:OptionsPanelWidget.cpp

示例14: getCoreStart

qint64 MultipleSequenceAlignmentRowData::getCoreLength() const {
    int coreStart = getCoreStart();
    int coreEnd = getCoreEnd();
    int length = coreEnd - coreStart;
    SAFE_POINT(length >= 0, QString("Internal error in MultipleSequenceAlignmentRowData: coreEnd is %1, coreStart is %2!").arg(coreEnd).arg(coreStart), length);
    return length;
}
开发者ID:ugeneunipro,项目名称:ugene,代码行数:7,代码来源:MultipleSequenceAlignmentRow.cpp

示例15: if

GObjectType U2ObjectTypeUtils::toGObjectType( const U2DataType &dbType ) {
    GObjectType result = GObjectTypes::UNKNOWN;
    if ( U2Type::Sequence == dbType ) {
        result = GObjectTypes::SEQUENCE;
    } else if ( U2Type::AnnotationTable == dbType ) {
        result = GObjectTypes::ANNOTATION_TABLE;
    } else if ( U2Type::PhyTree == dbType ) {
        result = GObjectTypes::PHYLOGENETIC_TREE;
    } else if ( U2Type::Chromatogram == dbType ) {
        result = GObjectTypes::CHROMATOGRAM;
    } else if ( U2Type::BioStruct3D == dbType ) {
        result = GObjectTypes::BIOSTRUCTURE_3D;
    } else if ( U2Type::Assembly == dbType ) {
        result = GObjectTypes::ASSEMBLY;
    } else if ( U2Type::Mca == dbType ) {
        result = GObjectTypes::MULTIPLE_CHROMATOGRAM_ALIGNMENT;
    } else if ( U2Type::Msa == dbType ) {
        result = GObjectTypes::MULTIPLE_SEQUENCE_ALIGNMENT;
    } else if ( U2Type::VariantTrack == dbType ) {
        result = GObjectTypes::VARIANT_TRACK;
    } else if ( U2Type::Text == dbType ) {
        result = GObjectTypes::TEXT;
    }

    SAFE_POINT( GObjectTypes::UNKNOWN != result, "Unsupported object relation type detected!",
        result );
    return result;
}
开发者ID:ggrekhov,项目名称:ugene,代码行数:28,代码来源:U2ObjectTypeUtils.cpp


注:本文中的SAFE_POINT函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。