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


C++ ERR_POST函数代码示例

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


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

示例1: OpenDOMNAME

/*Open DomNamedb */
bool OpenDOMNAME(string name, bool create)
{
	if(name.empty())
	{
		ERR_POST("[OpenDOMNAME]: No table name given");
		return false;
	}
	/*Init codeBase if not init yet*/
	if(!IsCodeBaseInit() && !InitCodeBase()){
		ERR_POST(Fatal<<"[OpenDOMNAME]:Cannot initiate CodeBase for RPSDB&DOMNAME");
		return false;
	}

	if(create){
		domnamedb.create(codeBase, name.c_str(), f4domname, t4domname);
		ERR_POST(Info<<"[OpenDOMNAME]: Creating new DomName table");
	}
	else {
		domnamedb.open(codeBase, name.c_str());
	}
	if(!domnamedb.isValid()){
		ERR_POST("[OpenDOMNAME]:failed to open "<<name);
		return false;
	}
	pf4dnaccession.init(domnamedb,"ACCESSION");
        pf4dnname.init(domnamedb,"NAME");
        pf4dnpdbid.init(domnamedb,"PDBID");
        pf4dnasn1.init(domnamedb,"ASN1");

	tagdnaccession.init(domnamedb,"ACCESSION");
        tagdnname.init(domnamedb,"NAME");
        tagdnpdbid.init(domnamedb,"PDBID");
	return true;
}
开发者ID:iandonaldson,项目名称:slri,代码行数:35,代码来源:rpsdb_cb.cpp

示例2: ERR_POST

void 
CMSPeak::ReadAndProcess(const CMSSpectrum& Spectrum,
                        const CMSSearchSettings& Settings)
{
	if(Read(Spectrum, Settings) != 0) {
	    ERR_POST(Error << "omssa: unable to read spectrum into CMSPeak");
	    return;
	}
    SetName().clear();
	if(Spectrum.CanGetIds()) SetName() = Spectrum.GetIds();
	if(Spectrum.CanGetNumber())
	    SetNumber() = Spectrum.GetNumber();
		
	SetPeakLists()[eMSPeakListOriginal]->Sort(eMSPeakListSortMZ);
	SetComputedCharge(Settings.GetChargehandling(), Spectrum);
	InitHitList(Settings.GetMinhit());
	CullAll(Settings);

    // this used to look at the filtered list.  changed to look at original
    // to simplify the code.
	if(GetPeakLists()[eMSPeakListOriginal]->GetNum() < Settings.GetMinspectra())
	    {
	    ERR_POST(Info << "omssa: not enough peaks in spectra");
	    SetError(eMSHitError_notenuffpeaks);
	}

}
开发者ID:jackgopack4,项目名称:pico-blast,代码行数:27,代码来源:mspeak.cpp

示例3: ERR_POST

void
CBlastScopeSource::x_InitBlastDatabaseDataLoader(CRef<CSeqDB> db_handle)
{
    if ( !m_Config.m_UseBlastDbs ) {
        return;
    }

    if (db_handle.Empty()) {
        ERR_POST(Warning << "No BLAST database handle provided");
    } else {
        try {

            m_BlastDbLoaderName = CBlastDbDataLoader::RegisterInObjectManager
                    (*m_ObjMgr, db_handle, m_Config.m_UseFixedSizeSlices,
                     CObjectManager::eNonDefault).GetLoader()->GetName();
            _ASSERT( !m_BlastDbLoaderName.empty() );
            _TRACE("Registered BLAST DB data loader '" << m_BlastDbLoaderName 
                   << "' as non-default");

        } catch (const exception& e) {

            // in case of error when initializing the BLAST database, just
            // ignore the exception as the remote BLAST database data loader
            // will be the fallback (just issue a warning)
            ERR_POST(Warning << "Error initializing local BLAST database data "
                             << "loader: '" << e.what() << "'");
            const CBlastDbDataLoader::EDbType dbtype = 
                db_handle->GetSequenceType() == CSeqDB::eProtein
                ? CBlastDbDataLoader::eProtein
                : CBlastDbDataLoader::eNucleotide;
            try {
                m_BlastDbLoaderName =
                    CRemoteBlastDbDataLoader::RegisterInObjectManager
                        (*m_ObjMgr, db_handle->GetDBNameList(), dbtype,
                         m_Config.m_UseFixedSizeSlices,
                         CObjectManager::eNonDefault,
                         CObjectManager::kPriority_NotSet)
                         .GetLoader()->GetName();
                _ASSERT( !m_BlastDbLoaderName.empty() );
                _TRACE("Registered BLAST DB data loader '" << m_BlastDbLoaderName 
                       << "' as non-default");
            } catch (const CSeqDBException& e) {
                ERR_POST(Warning << "Error initializing remote BLAST database "
                              << "data loader: " << e.GetMsg());
            }
        }
    }
}
开发者ID:DmitrySigaev,项目名称:ncbi,代码行数:48,代码来源:blast_scope_src.cpp

示例4: checksum

// If the client identification - client_node and/or client_session - breaks
// the length limit then it should be 'normalized'. Basically it is shortening
// the values in a special way embedding the MD5 checksum.
// See CXX-2617
string  CNSClientId::x_NormalizeNodeOrSession(const string &  val,
                                              const string &  key)
{
    if (val.size() < kMaxWorkerNodeIdSize)
        return val;

    // The limit is broken. Let's calculate the value MD5
    CChecksum   checksum(CChecksum::eMD5);
    string      checksum_as_string;

    checksum.AddLine(val);
    checksum_as_string = checksum.GetHexSum();


    string      normalized;
    if (checksum_as_string.size() >= kMaxWorkerNodeIdSize - 2) {
        // Very defensive: if kMaxWorkerNodeIdSize is defined a way too small
        normalized = checksum_as_string.substr(0, kMaxWorkerNodeIdSize - 1);
    } else {
        size_t      outer_lenght = ((kMaxWorkerNodeIdSize - 1) - // available
                                    2 -                          // separators
                                    checksum_as_string.size())   // md5
                                   / 2;
        normalized = val.substr(0, outer_lenght) + "/" +
                     checksum_as_string + "/" +
                     val.substr(val.size() - outer_lenght, outer_lenght);
    }

    ERR_POST("Client identification parameter " << key <<
             " exceeds the max allowed length of " <<
             kMaxWorkerNodeIdSize - 1 << " bytes. It will be replaced with " <<
            normalized);
    return normalized;
}
开发者ID:svn2github,项目名称:ncbi_tk,代码行数:38,代码来源:ns_clients.cpp

示例5: SetTolerance

int CMSPeak::Read(const CMSSpectrum& Spectrum,
                  const CMSSearchSettings& Settings)
{
    try {
        SetTolerance(Settings.GetMsmstol());
        SetPrecursorTol(Settings.GetPeptol());
        //  note that there are two scales -- input scale and computational scale
        //  Precursormz = MSSCALE * (Spectrum.GetPrecursormz()/(double)MSSCALE);  
        // for now, we assume one scale
        Precursormz = Spectrum.GetPrecursormz();  

        const CMSSpectrum::TMz& Mz = Spectrum.GetMz();
        const CMSSpectrum::TAbundance& Abundance = Spectrum.GetAbundance();
        SetPeakLists()[eMSPeakListOriginal]->CreateLists(Mz.size());

        int i;
        for (i = 0; i < SetPeakLists()[eMSPeakListOriginal]->GetNum(); i++) {
            // for now, we assume one scale
            SetPeakLists()[eMSPeakListOriginal]->GetMZI()[i].SetMZ() = Mz[i];
            SetPeakLists()[eMSPeakListOriginal]->GetMZI()[i].SetIntensity() = Abundance[i];
        }
        SetPeakLists()[eMSPeakListOriginal]->Sort(eMSPeakListSortMZ);
    }
    catch (NCBI_NS_STD::exception& e) {
        ERR_POST(Info << "Exception in CMSPeak::Read: " << e.what());
        throw;
    }

    return 0;
}
开发者ID:jackgopack4,项目名称:pico-blast,代码行数:30,代码来源:mspeak.cpp

示例6: GetAtomInfo

 const AtomInfo * GetAtomInfo(int aID) const
 {
     AtomInfoMap::const_iterator info=atomInfos.find(aID);
     if (info != atomInfos.end()) return (*info).second;
     ERR_POST(ncbi::Warning << "Residue #" << id << ": can't find atom #" << aID);
     return NULL;
 }
开发者ID:jackgopack4,项目名称:pico-blast,代码行数:7,代码来源:residue.hpp

示例7: SetSum

void CMSHit::RecordMatchesScan(CLadder& Ladder,
                               int& iHitInfo,
                               CMSPeak *Peaks,
                               EMSPeakListTypes Which,
                               int NOffset,
                               int COffset)
{
    try {
        SetSum() += Ladder.GetSum();
        SetM() += Ladder.GetM();
        
        // examine hits array
        int i;
        for(i = 0; i < Ladder.size(); i++) {
            // if hit, add to hitlist
            if(Ladder.GetHit()[i] > 0) {
                SetHitInfo(iHitInfo).SetCharge() = (char) Ladder.GetCharge();
                SetHitInfo(iHitInfo).SetIonSeries() = (char) Ladder.GetType();
//                if(kIonDirection[Ladder.GetType()] == 1) SetHitInfo(iHitInfo).SetNumber() = (short) i + NOffset;
//                else SetHitInfo(iHitInfo).SetNumber() = (short) i + COffset;
                SetHitInfo(iHitInfo).SetNumber() = Ladder.GetLadderNumber()[i];
                SetHitInfo(iHitInfo).SetIntensity() = Ladder.GetIntensity()[i];
                //  for poisson test
                SetHitInfo(iHitInfo).SetMZ() = Ladder[i];
                SetHitInfo(iHitInfo).SetDelta() = Ladder.GetDelta()[i];
                //
                iHitInfo++;
            }
        }
    } catch (NCBI_NS_STD::exception& e) {
	ERR_POST(Info << "Exception caught in CMSHit::RecordMatchesScan: " << e.what());
	throw;
    }

}
开发者ID:jackgopack4,项目名称:pico-blast,代码行数:35,代码来源:mspeak.cpp

示例8: ERR_POST

bool SeqTreeAPI::makeTree()
{
	if (m_triedTreeMaking) //if already tried, don't try again
		return m_seqTree != 0;
	if (m_seqTree != 0)
	{
		delete m_seqTree;
		m_seqTree = 0;
		m_seqTree = new SeqTree;
	}
	if (!m_loadOnly)
	{
		if (m_ma.getFirstCD() == 0)
			m_ma.setAlignment(*m_family);
		if(!m_ma.isBlockAligned())
		{
			ERR_POST("Sequence tree is not made for " <<m_ma.getFirstCD()->GetAccession()
				<<" because it does not have a consistent block alognment.");
		}
		else
		{
			if ((m_treeOptions.distMethod == eScoreBlastFoot) || (m_treeOptions.distMethod == eScoreBlastFull))
				m_treeOptions.distMethod = eScoreAligned;
			m_seqTree = TreeFactory::makeTree(&m_ma, m_treeOptions);
		}
		if (m_seqTree)
			m_seqTree->fixRowName(m_ma, SeqTree::eGI);
	}
	m_triedTreeMaking = true;
	return m_seqTree != 0;
}
开发者ID:jackgopack4,项目名称:pico-blast,代码行数:31,代码来源:cuSeqTreeAPI.cpp

示例9: if

 double operator [] (unsigned int i) const
 {
     if (i == 0) return x;
     else if (i == 1) return y;
     else if (i == 2) return z;
     else ERR_POST(ncbi::Error << "Vector operator [] access out of range : " << i);
     return 0.0;
 }
开发者ID:jackgopack4,项目名称:pico-blast,代码行数:8,代码来源:vector_math.hpp

示例10: ERR_POST

 double operator [] (unsigned int i) const
 {
     if (i > 15) {
         ERR_POST(ncbi::Error << "Matrix operator [] access out of range : " << i);
         return 0.0;
     }
     return m[i];
 }
开发者ID:jackgopack4,项目名称:pico-blast,代码行数:8,代码来源:vector_math.hpp

示例11: SetHTTPStatus

int CNetCacheBlobFetchApp::OnException(std::exception& e, CNcbiOstream& os)
{
    union {
        CArgException* arg_exception;
        CNetCacheException* nc_exception;
    };

    string status_str;
    string message;

    if ((arg_exception = dynamic_cast<CArgException*>(&e)) != NULL) {
        status_str = "400 Bad Request";
        message = arg_exception->GetMsg();
        SetHTTPStatus(CRequestStatus::e400_BadRequest);
    } else if ((nc_exception = dynamic_cast<CNetCacheException*>(&e)) != NULL) {
        switch (nc_exception->GetErrCode()) {
        case CNetCacheException::eAccessDenied:
            status_str = "403 Forbidden";
            message = nc_exception->GetMsg();
            SetHTTPStatus(CRequestStatus::e403_Forbidden);
            break;
        case CNetCacheException::eBlobNotFound:
            status_str = "404 Not Found";
            message = nc_exception->GetMsg();
            SetHTTPStatus(CRequestStatus::e404_NotFound);
            break;
        default:
            return CCgiApplication::OnException(e, os);
        }
    } else
        return CCgiApplication::OnException(e, os);

    // Don't try to write to a broken output
    if (!os.good()) {
        return -1;
    }

    try {
        // HTTP header
        os << "Status: " << status_str << HTTP_EOL <<
                "Content-Type: text/plain" HTTP_EOL HTTP_EOL <<
                "ERROR:  " << status_str << " " HTTP_EOL HTTP_EOL <<
                message << HTTP_EOL;

        // Check for problems in sending the response
        if (!os.good()) {
            ERR_POST("CNetCacheBlobFetchApp::OnException() "
                    "failed to send error page back to the client");
            return -1;
        }
    }
    catch (exception& e) {
        NCBI_REPORT_EXCEPTION("(CGI) CNetCacheBlobFetchApp::OnException", e);
    }

    return 0;
}
开发者ID:DmitrySigaev,项目名称:ncbi,代码行数:57,代码来源:ncfetch.cpp

示例12: ID

bool CStdAnnotTypes::LoadTypes(const string& iniFile)
{
    static const string ID("id");

    bool result = false;
    int id;
    int accessFlags = (IRegistry::fCaseFlags | IRegistry::fInternalSpaces);
    int readFlags = (IRegistry::fCaseFlags | IRegistry::fInternalSpaces);
    string value;
    list<string> categories, names;

    //  Use CMemoryRegistry simply to leverage registry file format parser.
    CMemoryRegistry dummyRegistry;
    auto_ptr<CNcbiIfstream> iniIn(new CNcbiIfstream(iniFile.c_str(), IOS_BASE::in | IOS_BASE::binary));
    if (*iniIn) {

        result = true;
        ERR_POST(ncbi::Trace << "loading predefined annotation types " << iniFile);

        dummyRegistry.Read(*iniIn, readFlags);
        dummyRegistry.EnumerateSections(&categories, accessFlags);

        //  Loop over all type categories
        ITERATE (list<string>, cit, categories) {
            if (*cit == kEmptyStr) continue;

            //  reject 'id' if it equals m_invalidType; otherwise allow negative values
            id = dummyRegistry.GetInt(*cit, ID, m_invalidType, accessFlags, CMemoryRegistry::eReturn);
            if (id != m_invalidType) {
                TTypeNamesPair& typeNamesPair = m_stdAnnotTypeData[id];
                TTypeNames& values = typeNamesPair.second;
                typeNamesPair.first = *cit;

                //  Get all named fields for this section.
                dummyRegistry.EnumerateEntries(*cit, &names, accessFlags);

                //  Add value for each non-id named field; sort alphabetically on completion.
                ITERATE (list<string>, eit, names) {
                    if (*eit == ID || *eit == kEmptyStr) continue;
                    value = dummyRegistry.GetString(*cit, *eit, kEmptyStr, accessFlags);
                    NStr::TruncateSpacesInPlace(value);
                    if (value != kEmptyStr) {
                        values.push_back(value);
                    }
                }

                sort(values.begin(), values.end());

                /*cout << "\nTesting sort for " << *cit << endl;
                ITERATE (vector<string>, vit, values) {
                    cout << *vit << endl;
                }*/

            }
        }
    }
开发者ID:jackgopack4,项目名称:pico-blast,代码行数:56,代码来源:cuStdAnnotTypes.cpp

示例13: OpenRPSDB

/*Open RPSDB table*/
bool OpenRPSDB(const char* tableName, bool create )
{
	if(tableName==NULL)
	{
		ERR_POST("[OpenRPSDB]: No table name given");
		return false;
	}

	if(!IsCodeBaseInit() && !InitCodeBase()){
		ERR_POST(Fatal<<"[OpenRPSDB]:Cannot initiate CodeBase for RPSDB&DOMNAME");
		return false;
	}

	if (create)
        {
                rpsdb.create(codeBase, tableName, f4rpsdb, t4rpsdb);
        }
	else{
		rpsdb.open(codeBase, tableName);
	}
	if(!rpsdb.isValid()){
		ERR_POST("[OpenRPSDB]: failed to open "<<tableName);
		return false;
	}
        pf4rpsgi.init(rpsdb,"GI");
        pf4rpsdomid.init(rpsdb,"DOMID");
	pf4rpsfrom.init(rpsdb,"FROM");
        pf4rpsalignlen.init(rpsdb,"ALIGN_LEN");
        pf4rpsevalue.init(rpsdb,"EVALUE");
        pf4rpsmisN.init(rpsdb,"MISSING_N");
        pf4rpsmisC.init(rpsdb,"MISSING_C");
        pf4rpsnumdom.init(rpsdb,"NUMDOM");
	pf4rpscddid.init(rpsdb,"CDDID");
	tagrpscddid.init(rpsdb, "CDDID");
	pf4rpsbitscore.init(rpsdb,"BITSCORE");
	pf4rpsscore.init(rpsdb,"SCORE");
	tagrpsgi.init(rpsdb,"GI");
        tagrpsdomid.init(rpsdb, "DOMID");
        tagrpslen.init(rpsdb,"ALIGN_LEN");
        tagrpsnumdom.init(rpsdb, "NUMDOM");

        return true;
}
开发者ID:iandonaldson,项目名称:slri,代码行数:44,代码来源:rpsdb_cb.cpp

示例14: ERR_POST

bool CCSRATestApp::TestApp_Exit(void)
{
    if ( m_ErrorCount ) {
        ERR_POST("Errors found: "<<m_ErrorCount);
    }
    else {
        LOG_POST("Done.");
    }
    return !m_ErrorCount;
}
开发者ID:svn2github,项目名称:ncbi_tk,代码行数:10,代码来源:test_csra_loader_mt.cpp

示例15: SearchDOMNAME

/* search domname for domain label by accession */
string SearchDOMNAME(string accession)
{
	int rc=-20;
	if(accession.empty())
	{
		ERR_POST("[SearchDOMNAME]: empty string");
		return NULL;
	}
	domnamedb.select(tagdnaccession);
	domnamedb.top();
	rc=domnamedb.seek(accession.c_str());
	if(rc!=r4success){
		ERR_POST(Info<<"[SearchDOMNAME]: no record found for "<<accession);
		return NULL;
	}
	Str4large strfield;
	strfield.assign(pf4dnname);
	strfield.trim();
	string s=strfield.str();
	return s;
}
开发者ID:iandonaldson,项目名称:slri,代码行数:22,代码来源:rpsdb_cb.cpp


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