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


C++ CHECK_OP函数代码示例

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


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

示例1: getFileToFileInfo

/**
 * Finds the destination file by @srcUrl and @role.
 * Checks hash for both destination and source files.
 * If hashes are ok then returns the destination file.
 */
static QString getFileToFileInfo(const QString &srcUrl, const QString &role, WorkflowProcess &process) {
    AppFileStorage *fileStorage = AppContext::getAppFileStorage();

    if (NULL != fileStorage) {
        U2OpStatus2Log os;
        QString dstUrl = fileStorage->getFileInfo(srcUrl, role, process, os);
        CHECK_OP(os, "");

        if (!dstUrl.isEmpty() && QFile::exists(dstUrl)) {
            QString srcHash = fileStorage->getFileInfo(srcUrl, StorageRoles::HASH, process, os);
            CHECK_OP(os, "");

            QString dstHash = fileStorage->getFileInfo(dstUrl, StorageRoles::HASH, process, os);
            CHECK_OP(os, "");

            if ((getCommonHashForFile(dstUrl) == dstHash) &&
                (getCommonHashForFile(srcUrl) == srcHash)) {
                FileInfo fToFInfo(srcUrl, role, dstUrl);
                fileStorage->addFileOwner(fToFInfo, process, os);
                CHECK_OP(os, "");

                return dstUrl;
            }
        }
    }

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

示例2: q

QList<U2ObjectRelation> MysqlObjectRelationsDbi::getObjectRelations( const U2DataId &object,
    U2OpStatus &os )
{
    QList<U2ObjectRelation> result;

    static const QString queryString = "SELECT o.type, o.name, o_r.object, o_r.reference, o_r.role FROM ObjectRelation AS o_r "
        "INNER JOIN Object AS o ON o.id = o_r.reference WHERE o_r.object = :object";
    U2SqlQuery q( queryString, db, os );
    CHECK_OP(os, result);
    q.bindDataId( ":object", object );
    while ( q.step( ) ) {
        U2ObjectRelation relation;
        const U2DataType objectType = U2DbiUtils::toType( object );
        const U2DataType referenceType = q.getInt32( 0 );
        relation.referencedType = U2ObjectTypeUtils::toGObjectType( referenceType );
        relation.referencedName = q.getString( 1 );
        relation.id = q.getDataId( 2, objectType );
        relation.referencedObject = q.getDataId( 3, referenceType );
        relation.relationRole = static_cast<GObjectRelationRole>( q.getInt32( 4 ) );
        result << relation;
        CHECK_OP(os, result);
    }

    return result;
}
开发者ID:ggrekhov,项目名称:ugene,代码行数:25,代码来源:MysqlObjectRelationsDbi.cpp

示例3: CHECK_OP

 int LMDBEngine::Del(const Slice& key, const Options& options)
 {
     LMDBContext& holder = m_ctx_local.GetValue();
     MDB_txn *txn = holder.readonly_txn;
     if (NULL == txn || holder.batch_write == 0)
     {
         MDB_val k;
         k.mv_data = const_cast<char*>(key.data());
         k.mv_size = key.size();
         CHECK_OP(mdb_txn_begin(m_env, NULL, 0, &txn));
         CHECK_OP(mdb_del(txn, m_dbi, &k, NULL));
         CHECK_OP(mdb_txn_commit(txn));
         return 0;
     }
     DelOperation* op = new DelOperation;
     op->key.assign((const char*) key.data(), key.size());
     m_write_queue.Push(op);
     if (holder.batch_write == 0)
     {
         CheckPointOperation* ck = new CheckPointOperation(holder.cond);
         m_write_queue.Push(ck);
         NotifyBackgroundThread();
         ck->Wait();
         DELETE(ck);
         return 0;
     }
     return 0;
 }
开发者ID:Abioy,项目名称:ardb,代码行数:28,代码来源:lmdb_engine.cpp

示例4: CHECK_OP

Task::ReportResult GTest_DNAcompareSequencesInTwoObjects::report() {
    Document* doc = getContext<Document>(this, docContextName);
    if (doc == NULL) {
        stateInfo.setError(QString("document not found %1").arg(docContextName));
        return ReportResult_Finished;
    }
    Document* doc2 = getContext<Document>(this, secondDocContextName);
    if (doc2 == NULL) {
        stateInfo.setError(QString("document not found %1").arg(secondDocContextName));
        return ReportResult_Finished;
    }

    const QList<GObject*>& objs = doc->getObjects();
    const QList<GObject*>& objs2 = doc2->getObjects();
    GObject*obj=NULL;
    GObject*obj2=NULL;
    U2SequenceObject * mySequence;
    U2SequenceObject * mySequence2;

    for(int i=0;(i!=objs.size())&&(i!=objs2.size());i++){
        obj = objs.at(i);
        obj2 = objs2.at(i);

        if((obj->getGObjectType()== GObjectTypes::SEQUENCE)&&(obj2->getGObjectType()== GObjectTypes::SEQUENCE)){
            mySequence = qobject_cast<U2SequenceObject*>(obj);
            if(mySequence==NULL){
                stateInfo.setError(QString("can't cast to sequence from: %1 in position %2").arg(obj->getGObjectName()).arg(i));
                return ReportResult_Finished;
            }
            mySequence2 = qobject_cast<U2SequenceObject*>(obj2);
            if(mySequence2==NULL){
                stateInfo.setError(QString("can't cast to sequence from: %1 in position %2").arg(obj2->getGObjectName()).arg(i));
                return ReportResult_Finished;
            }
            if(mySequence->getWholeSequenceData(stateInfo) != mySequence2->getWholeSequenceData(stateInfo)){
                CHECK_OP(stateInfo, ReportResult_Finished);
                stateInfo.setError(QString("Sequences of object in position %1 not matched").arg(i));
                return ReportResult_Finished;
            }
            CHECK_OP(stateInfo, ReportResult_Finished);
        }

    }

    if (objs.size() != objs2.size()) {
        QString error("Number of objects in doc mismatches: [%1=%2] vs [%3=%4]");
        error = error.arg(docContextName).arg(objs.size())
            .arg(secondDocContextName).arg(objs2.size());
        if (obj) {
            error += QString("\nLast good object: %1").arg(obj->getGObjectName());
        }
        stateInfo.setError(error);
    }

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

示例5: CHECK_OP

void CProtoGearPrice::GetGearArrField(VT_PROTO_FIELD &vtField, const GearPriceAckItem &ackItem)
{
	static BOOL arOptional[] = {
		FALSE, FALSE, FALSE,
		FALSE, FALSE, FALSE,
	};
	static EProtoFildType arFieldType[] = {
		ProtoFild_Int32, ProtoFild_Int32, ProtoFild_Int64, 
		ProtoFild_Int32, ProtoFild_Int32, ProtoFild_Int64, 
	};
	static LPCSTR arFieldKey[] = {
		"BuyPrice",	  "BuyOrder",	"BuyVol", 
		"SellPrice",  "SellOrder",	"SellVol", 
	};

	GearPriceAckItem &item = const_cast<GearPriceAckItem &>(ackItem);
	void *arPtr[] = {
		&item.nBuyPrice,	&item.nBuyOrder,	&item.nBuyVolume,
		&item.nSellPrice,	&item.nSellOrder,	&item.nSellVolume,
	};

	CHECK_OP(_countof(arOptional) == _countof(arFieldType), NOOP);
	CHECK_OP(_countof(arOptional) == _countof(arFieldKey), NOOP);
	CHECK_OP(_countof(arOptional) == _countof(arPtr), NOOP);

	vtField.clear();
	PROTO_FIELD field;
	for ( int n = 0; n < _countof(arOptional); n++ )
	{
		field.bOptional = arOptional[n];
		field.eFieldType = arFieldType[n];
		field.strFieldKey = arFieldKey[n];
		switch (field.eFieldType)
		{
		case ProtoFild_Int32:
			field.pInt32 = (int*)arPtr[n];
			break;
		case ProtoFild_Int64:
			field.pInt64 = (INT64*)arPtr[n];
			break;
		case ProtoFild_StringA:
			field.pStrA = (std::string*)arPtr[n];
			break;
		case ProtoFild_StringW:
			field.pStrW = (std::wstring*)arPtr[n];
			break;
		default:
			CHECK_OP(FALSE, NOOP);
			break;
		}

		vtField.push_back(field);
	}	
}
开发者ID:FallorWong,项目名称:FTPlugin,代码行数:54,代码来源:ProtoGearPrice.cpp

示例6: CHECK_OP

//tomodify 7
void CProtoQueryHKOrder::GetProtoBodyField_Req(VT_PROTO_FIELD &vtField, const ProtoReqBodyType &reqData)
{
	static BOOL arOptional[] = {
		TRUE, FALSE, 
	};
	static EProtoFildType arFieldType[] = {
		ProtoFild_Int32, ProtoFild_Int32, 
	};
	static LPCSTR arFieldKey[] = {
		"EnvType",	"Cookie",
	};

	ProtoReqBodyType &body = const_cast<ProtoReqBodyType &>(reqData);
	void *arPtr[] = {
		&body.nEnvType, &body.nCookie, 
	};

	CHECK_OP(_countof(arOptional) == _countof(arFieldType), NOOP);
	CHECK_OP(_countof(arOptional) == _countof(arFieldKey), NOOP);
	CHECK_OP(_countof(arOptional) == _countof(arPtr), NOOP);

	vtField.clear();
	PROTO_FIELD field;
	for ( int n = 0; n < _countof(arOptional); n++ )
	{
		field.bOptional = arOptional[n];
		field.eFieldType = arFieldType[n];
		field.strFieldKey = arFieldKey[n];
		switch (field.eFieldType)
		{
		case ProtoFild_Int32:
			field.pInt32 = (int*)arPtr[n];
			break;
		case ProtoFild_Int64:
			field.pInt64 = (INT64*)arPtr[n];
			break;
		case ProtoFild_StringA:
			field.pStrA = (std::string*)arPtr[n];
			break;
		case ProtoFild_StringW:
			field.pStrW = (std::wstring*)arPtr[n];
			break;
		default:
			CHECK_OP(FALSE, NOOP);
			break;
		}

		vtField.push_back(field);
	}	
}
开发者ID:FallorWong,项目名称:FTPlugin,代码行数:51,代码来源:ProtoQueryHKOrder.cpp

示例7: mdb_cursor_get

 void LMDBIterator::Next()
 {
     int rc;
     rc = mdb_cursor_get(m_cursor, &m_key, &m_value, MDB_NEXT);
     CHECK_OP(rc);
     m_valid = rc == 0;
 }
开发者ID:Abioy,项目名称:ardb,代码行数:7,代码来源:lmdb_engine.cpp

示例8: t

QList<U2MsaRow> MysqlMsaDbi::getRows(const U2DataId& msaId, U2OpStatus& os) {
    QList<U2MsaRow> res;
    MysqlTransaction t(db, os);
    Q_UNUSED(t);

    static const QString rowString = "SELECT rowId, sequence, gstart, gend, length FROM MsaRow WHERE msa = :msa ORDER BY pos";
    U2SqlQuery rowQuery(rowString, db, os);
    rowQuery.bindDataId(":msa", msaId);

    static const QString gapString = "SELECT gapStart, gapEnd FROM MsaRowGap WHERE msa = :msa AND rowId = :rowId ORDER BY gapStart";

    while (rowQuery.step()) {
        U2MsaRow row;
        row.rowId = rowQuery.getInt64(0);
        row.sequenceId = rowQuery.getDataId(1, U2Type::Sequence);
        row.gstart = rowQuery.getInt64(2);
        row.gend = rowQuery.getInt64(3);
        row.length = rowQuery.getInt64(4);

        U2SqlQuery gapQuery(gapString, db, os);
        gapQuery.bindDataId(":msa", msaId);
        gapQuery.bindInt64(":rowId", row.rowId);
        while (gapQuery.step()) {
            U2MsaGap gap;
            gap.offset = gapQuery.getInt64(0);
            gap.gap = gapQuery.getInt64(1) - gap.offset;
            row.gaps.append(gap);
        }
        CHECK_OP(os, res);

        res.append(row);
    }

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

示例9: mdb_txn_begin

 int LMDBEngine::Get(const Slice& key, std::string* value, const Options& options)
 {
     MDB_val k, v;
     k.mv_data = const_cast<char*>(key.data());
     k.mv_size = key.size();
     int rc;
     LMDBContext& holder = m_ctx_local.GetValue();
     MDB_txn *txn = holder.readonly_txn;
     if (NULL == holder.readonly_txn)
     {
         rc = mdb_txn_begin(m_env, NULL, MDB_RDONLY, &txn);
         if (rc != 0)
         {
             ERROR_LOG("Failed to create txn for get for reason:%s", mdb_strerror(rc));
             return -1;
         }
     }
     rc = mdb_get(txn, m_dbi, &k, &v);
     if (NULL == holder.readonly_txn)
     {
         CHECK_OP(mdb_txn_commit(txn));
     }
     if (0 == rc && NULL != value && NULL != v.mv_data)
     {
         value->assign((const char*) v.mv_data, v.mv_size);
     }
     return rc;
 }
开发者ID:Abioy,项目名称:ardb,代码行数:28,代码来源:lmdb_engine.cpp

示例10: CHECK_RET

void CPluginChangeOrder_US::SetTradeReqData(int nCmdID, const Json::Value &jsnVal, SOCKET sock)
{
	CHECK_RET(nCmdID == PROTO_ID_QUOTE && sock != INVALID_SOCKET, NORET);
	CHECK_RET(m_pTradeOp && m_pTradeServer, NORET);

	CProtoQuote proto;
	CProtoQuote::ProtoReqDataType	req;
	proto.SetProtoData_Req(&req);
	if ( !proto.ParseJson_Req(jsnVal) )
	{
		CHECK_OP(false, NORET);
		return;
	}

	CHECK_RET(req.head.nProtoID == nCmdID && req.body.nCookie, NORET);
	ChangeOrderReqBody &body = req.body;		

	StockDataReq *pReq = new StockDataReq;
	CHECK_RET(pReq, NORET);
	pReq->sock = sock;
	pReq->dwReqTick = ::GetTickCount();
	pReq->req = req; 
	pReq->bWaitDelaySvrID = true; 

	DoTryProcessTradeOpt(pReq); 
}
开发者ID:FallorWong,项目名称:FTPlugin,代码行数:26,代码来源:PluginChangeOrder_US.cpp

示例11: DBI_TYPE_CHECK

U2VariantTrack MysqlVariantDbi::getVariantTrack(const U2DataId& variantTrackId, U2OpStatus& os) {
    U2VariantTrack res;
    DBI_TYPE_CHECK(variantTrackId, U2Type::VariantTrack, os, res);
    MysqlTransaction t(db, os);
    Q_UNUSED(t);

    dbi->getMysqlObjectDbi()->getObject(res, variantTrackId, os);
    CHECK_OP(os, res);

    static const QString queryString = "SELECT sequence, sequenceName, trackType, fileHeader FROM VariantTrack WHERE object = :object";
    U2SqlQuery q(queryString, db, os);
    q.bindDataId(":object", variantTrackId);

    if (q.step()) {
        res.sequence = q.getDataId(0, U2Type::Sequence);
        res.sequenceName = q.getString(1);
        int trackType = q.getInt32(2);
        CHECK_EXT(TrackType_FIRST <= trackType && trackType <= TrackType_LAST,
                  os.setError(U2DbiL10n::tr("Invalid variant track type: %1").arg(trackType)), res);
        res.trackType = static_cast<VariantTrackType>(trackType);
        res.fileHeader = q.getString(3);
        q.ensureDone();
    }

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

示例12: CHECK_OP

QList<Task*> AceImporterTask::onSubTaskFinished(Task* subTask) {
    QList<Task*> res;
    CHECK_OP(stateInfo, res);

    if (isSqliteDbTransit && convertTask == subTask) {
        initCloneObjectTasks();
        res << cloneTasks;
    }

    else if (isSqliteDbTransit && cloneTasks.contains(subTask)) {
        cloneTasks.removeOne(subTask);
        if (cloneTasks.isEmpty()) {
            initLoadDocumentTask();
            CHECK(NULL != loadDocTask, res);
            res << loadDocTask;
        }
    }

    else if (!isSqliteDbTransit && convertTask == subTask) {
        initLoadDocumentTask();
        CHECK(NULL != loadDocTask, res);
        res << loadDocTask;
    }

    if (loadDocTask == subTask) {
        resultDocument = loadDocTask->takeDocument();
    }

    return res;
}
开发者ID:ugeneunipro,项目名称:ugene,代码行数:30,代码来源:AceImporter.cpp

示例13: propagateSubtaskError

Task::ReportResult PairwiseAlignmentHirschbergTask::report() {
    propagateSubtaskError();
    CHECK_OP(stateInfo, ReportResult_Finished);

    assert(kalignSubTask->inputMA.getNumRows() == kalignSubTask->resultMA.getNumRows());

    return ReportResult_Finished;
}
开发者ID:ugeneunipro,项目名称:ugene-old,代码行数:8,代码来源:PairwiseAlignmentHirschbergTask.cpp

示例14: CHECK_OP

Task::ReportResult GTest_CalculateTreeFromAligment::report()
{
    if (task == NULL) {
        return ReportResult_Finished;
    }

    if (!task->hasError()) {
        PhyTree tree = task->getResult();
        U2DbiRef dbiRef = AppContext::getDbiRegistry()->getSessionTmpDbiRef(stateInfo);
        CHECK_OP(stateInfo, ReportResult_Finished);
        PhyTreeObject *obj = PhyTreeObject::createInstance(tree, treeObjContextName, dbiRef, stateInfo);
        CHECK_OP(stateInfo, ReportResult_Finished);
        addContext(treeObjContextName,obj);
    }

    return ReportResult_Finished;
}
开发者ID:ugeneunipro,项目名称:ugene,代码行数:17,代码来源:PhyTreeObjectTests.cpp

示例15: CHECK

QList<Task *> FindORFsToAnnotationsTask::onSubTaskFinished(Task *subTask) {
    CHECK(subTask == fTask, QList<Task *>());

    const QList<ORFFindResult> results = fTask->popResults();
    QList<SharedAnnotationData> annotationList;
    foreach (const ORFFindResult &res, results) {
        CHECK_OP(stateInfo, QList<Task *>());
        annotationList << res.toAnnotation(ORFAlgorithmSettings::ANNOTATION_GROUP_NAME);
    }
开发者ID:ugeneunipro,项目名称:ugene-old,代码行数:9,代码来源:ORFMarkerTask.cpp


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