本文整理汇总了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());
}
示例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());
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}