• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ GetArgs函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: packet

/* 
   Extract the exit code out of a PP_FINISH packet (used in SysMan)
*/
int
getExitCode(int nbytes, GlobalTaskId *sender_idp) {
  int exitCode=0;

  if (nbytes==4) {               // Notification from a task doing pvm_exit
    GetArgs(sender_idp,1);       // Presumably this must be MainPE Id
    exitCode = -1;
  } else if (nbytes==8) {        // Doing a controlled shutdown
    GetArgs(&exitCode,1);        // HACK: controlled shutdown == 2 values
    GetArgs(&exitCode,1);
  } else {
    exitCode = -2;               // everything else
  }
  return exitCode;
}
开发者ID:Ericson2314,项目名称:lighthouse,代码行数:18,代码来源:LLComms.c


示例2: GetArgs

bool CTestCacheApp::TestApp_Init(void)
{
    NcbiCout << NcbiEndl
             << "Testing cache with "
             << NStr::IntToString(s_NumThreads)
             << " threads..."
             << NcbiEndl;

    const CArgs& args = GetArgs();
    m_CacheSize = args["cache_size"].AsInt8();
    m_ElementDataSize = args["element_size"].AsInt8();
    if (args["size_type"].AsString() == "ubyte") {
        m_UCharCache.reset(new TUCharCache((unsigned char)(m_CacheSize)));
    }
    else if (args["size_type"].AsString() == "uint") {
        m_UIntCache.reset(new TUIntCache((unsigned int)(m_CacheSize)));
    }
    else if (args["size_type"].AsString() == "uint8") {
        m_UInt8Cache.reset(new TUInt8Cache(m_CacheSize));
    }
    else if (args["size_type"].AsString() == "byte") {
        m_IntCache.reset(new TIntCache((signed char)(m_CacheSize)));
    }
    return true;
}
开发者ID:svn2github,项目名称:ncbi_tk,代码行数:25,代码来源:test_cache_mt.cpp


示例3: GetArgs

void
CSeqDBPerfApp::x_InitApplicationData()
{
    CStopWatch sw;
    sw.Start();
    const CArgs& args = GetArgs();
    const CSeqDB::ESeqType kSeqType = ParseMoleculeTypeString(args["dbtype"].AsString());
    const string& kDbName(args["db"].AsString());
    m_BlastDb.Reset(new CSeqDBExpert(kDbName, kSeqType));
    m_DbIsProtein = static_cast<bool>(m_BlastDb->GetSequenceType() == CSeqDB::eProtein);

    int kNumThreads = 1;
#if (defined(_OPENMP) && defined(NCBI_THREADS))
    kNumThreads = args["num_threads"].AsInteger();
#endif
    m_DbHandles.reserve(kNumThreads);
    m_DbHandles.push_back(m_BlastDb);
    if (kNumThreads > 1) {
        for (int i = 1; i < kNumThreads; i++) {
            m_BlastDb.Reset(new CSeqDBExpert(kDbName, kSeqType));
            m_DbHandles.push_back(m_BlastDb);
        }
    }
    m_MemoryUsage.assign(kNumThreads, SMemUsage());

    sw.Stop();
    cout << "Initialization time: " << sw.AsSmartString() << endl;
}
开发者ID:swuecho,项目名称:igblast,代码行数:28,代码来源:seqdb_perf.cpp


示例4: GetArgs

int CTestDateApp::Run(void)
{
    const CArgs& args = GetArgs();
    CDate      date;
    CDate_std& std  = date.SetStd();
    std.SetYear(args["Y"].AsInteger());
    if (args["M"]) {
        std.SetMonth(args["M"].AsInteger());
    }
    if (args["D"]) {
        std.SetDay(args["D"].AsInteger());
    }
    if (args["S"]) {
        std.SetSeason(args["S"].AsString());
    }
    // ...

    string s;
    date.GetDate(&s);
    NcbiCout << '\"' << s << '\"' << NcbiEndl;
    s.erase();
    date.GetDate(&s, args["f"].AsString());
    NcbiCout << '\"' << s << '\"' << NcbiEndl;
    s.erase();
    date.GetDate(&s, "%Y-%M-%D");
    NcbiCout << '\"' << s << '\"' << NcbiEndl;

    return 0;
}
开发者ID:svn2github,项目名称:ncbi_tk,代码行数:29,代码来源:test_date.cpp


示例5: Optimize

void SubExpressionTap::Optimize(Block *block){
	blocks.push(block);
	SubExpressionBlock *exprList = block->GetExprBlock();
	const int size = block->body.size();
	for(int i = 0; i < size; i++){
		Node *expr = block->body[i + temp_counter];
		if(expr->isCycle())
			continue;
		if(Block* b = dynamic_cast<Block*>(expr)){
			Optimize(b);
			continue;
		}
		if(FuncCallNode *cNode = dynamic_cast<FuncCallNode*>(expr)){
			for(Node *arg : cNode->args)
				GetArgs(*exprList, arg);
			continue;			
		}
		if(IfStatement *$if = dynamic_cast<IfStatement*>(expr)){
			Optimize(dynamic_cast<Block*>($if->if_branch));
			if($if->else_branch)
				Optimize(dynamic_cast<Block*>($if->else_branch));
			continue;
		}
		if(ReturnStatement *retNode = dynamic_cast<ReturnStatement*>(expr))
			expr = retNode->value;
		if(!expr->isExpression())
			continue;
		Node *t = OptimizeExpression(expr);
		if(t != expr){
			block->body[i + temp_counter] = t;		
		}
	}
	ReplaceFirstOccur();
	blocks.pop();
}
开发者ID:Alex-ttt,项目名称:C-Compoiler,代码行数:35,代码来源:sub_expressions.cpp


示例6: Main

Int2 Main (void)

{
    Char buf[256] = { '\0' };  /* Used below for name and version. */
    Int2 status = 0;    /* return value of function. */

    StringCpy(buf, "bl2seq ");
    StringNCat(buf, BlastGetVersionNumber(), sizeof(buf)-StringLen(buf)-1);
    if (! GetArgs (buf, NUMARG, myargs)) {
        return (1);
    }

    UseLocalAsnloadDataAndErrMsg ();

    if (! SeqEntryLoad())
                return 1;

    ErrSetMessageLevel(SEV_WARNING);

    if (myargs[ARG_FORCE_OLD].intvalue != 0)
        status = Main_old();
    else
        status = Main_new();

    FreeArgs(NUMARG, myargs);

    return status;
}
开发者ID:hsptools,项目名称:hsp-wrap,代码行数:28,代码来源:bl2seq.c


示例7: Nlm_Main

Int2 Nlm_Main(void) {
    Boolean use_new_engine=FALSE;
    char buf[256] = { '\0' };

    StringCpy(buf, "mgblast ");
    StringNCat(buf, BlastGetVersionNumber(), sizeof(buf)-StringLen(buf)-1);
    if (! GetArgs (buf, NUMARG, myargs))
       return (1);

    UseLocalAsnloadDataAndErrMsg ();

    if (! SeqEntryLoad())
        return 1;

    ErrSetMessageLevel(SEV_WARNING);
    /*
    if (myargs[ARG_FORCE_OLD].intvalue == 0 &&
                  myargs[ARG_OUTTYPE].intvalue > 1 &&
                      myargs[ARG_GILIST].strvalue == NULL)
          use_new_engine = readdb_use_new_blast(myargs[ARG_DB].strvalue);
    if (myargs[ARG_MASKEDQUERY].strvalue)
        use_new_engine = FALSE;
    */
    
    /*if (use_new_engine)
        return Main_new();
    else */
        return Main_old();
}
开发者ID:gpertea,项目名称:gsrc,代码行数:29,代码来源:mgblast.c


示例8: wxLogError

void dlgFunction::OnChangeArg(wxCommandEvent &ev)
{
	if (GetSelectedDirection() == wxT("VARIADIC") &&
	        !cbDatatype->GetValue().EndsWith(wxT("[]")))
	{
		wxLogError(_("Only array types can be VARIADIC."));
		return;
	}

	int row = lstArguments->GetSelection();

	if (row >= 0)
	{
		lstArguments->SetItem(row, 0, cbDatatype->GetValue());
		lstArguments->SetItem(row, 1, GetSelectedDirection());
		lstArguments->SetItem(row, 2, txtArgName->GetValue());
		if (isBackendMinVer84)
			lstArguments->SetItem(row, 3, txtArgDefVal->GetValue());

		if (!function)
			argOids.Item(row) = typOids.Item(cbDatatype->GetGuessedSelection());
		txtArguments->SetValue(GetArgs());
	}
	OnChangeArgName(ev);
	CheckChange();
}
开发者ID:xiul,项目名称:pgadmin3,代码行数:26,代码来源:dlgFunction.cpp


示例9: GetArgs

void CTest::RunInternalTest(void)
{
    const CArgs& args = GetArgs();
    string test = args["fmt"].AsString();

    // Set a random starting point
    unsigned int seed = (unsigned int)time(0);
    //LOG_POST("Random seed = " << seed);
    srand(seed);

    // Preparing test data
    m_BufLen = 10*100*1024;  // 10MB
    AutoArray<char> src_buf_arr(m_BufLen);
    m_Buf = src_buf_arr.get();
    assert(m_Buf);
    for (size_t i=0; i<m_BufLen; i++) {
        m_Buf[i] = (char)(rand() % 255);
    }
    // Prepare source tree
    CreateSourceTree();

    // Run tests
    if (test == "all"  ||  test == "zip") {
        _TRACE("-------------- Zip ---------------\n");
        RunInternalTestFormat(CArchive::eZip);
    }

    // Cleanup
    CDir(GetDir("test_archive_in")).Remove();
    CDir(GetDir("test_archive_out")).Remove();

}
开发者ID:svn2github,项目名称:ncbi_tk,代码行数:32,代码来源:test_compress_archive.cpp


示例10: QScrollArea

void MainWindow::OpenImage(const QString &fileName)
{
	QScrollArea* area = new QScrollArea();
	ImageWidget* img = new ImageWidget();

	// Nur les- und schreibbare Bildformate werden unterstützt
	if (img->OpenImage(fileName)) {
		QString shortFileName = ParseFileName(fileName);
		shortFileName = shortFileName.mid(0, shortFileName.lastIndexOf('.'));

		// Bild in die ScrollArea laden
		area->setWidget(img);
		area->setStyleSheet("background: qlineargradient(x1: 0, y0: 1, x2:1, y2: 0, stop: 0.96 #383838, stop: 0.99 #2e2e2e);");

		// neuen Tab hinzufügen
		int index = ui->imagetab->addTab(area, shortFileName);
		ui->imagetab->setTabToolTip(index, shortFileName);
		ui->imagetab->setCurrentIndex(index);

		// schließlich Signalhandler setzen
		connect(this, SIGNAL(Arguments(QHash<QString,QString>)), img, SLOT(Arguments(QHash<QString,QString>)));
		connect(this, SIGNAL(Operation(IOperation*,QHash<QString,QString>)), img, SLOT(Operation(IOperation*,QHash<QString,QString>)));
		connect(this, SIGNAL(Operation(IOperation*,QHash<QString,QString>,OperationType)), img, SLOT(Operation(IOperation*,QHash<QString,QString>,OperationType)));
		emit Operation(mOperation, GetArgs());
	}
开发者ID:LariscusObscurus,项目名称:ITP3_ImageProcessing,代码行数:25,代码来源:mainwindow.cpp


示例11: LowLevelTest

int CBAMTestApp::Run(void)
{
#ifdef CALL
    return LowLevelTest();
#endif

    // Get arguments
    const CArgs& args = GetArgs();

    string path;

    vector<string> dirs;
    if ( args["dir"] ) {
        dirs.push_back(args["dir"].AsString());
    }
    else {
        vector<string> reps;
        reps.push_back(string(NCBI_GetTestDataPath())+"/traces02");
        reps.push_back(string(NCBI_GetTestDataPath())+"/traces04");
        ITERATE ( vector<string>, it, reps ) {
            dirs.push_back(CFile::MakePath(*it, BAM_DIR1));
            dirs.push_back(CFile::MakePath(*it, BAM_DIR2));
            dirs.push_back(CFile::MakePath(*it, BAM_DIR3));
            dirs.push_back(CFile::MakePath(*it, BAM_DIR4));
            dirs.push_back(CFile::MakePath(*it, BAM_DIR5));
        }
    }
开发者ID:svn2github,项目名称:ncbi_tk,代码行数:27,代码来源:bam_test.cpp


示例12: GetArgs

int CTestApplication::Run(void)
{
    //export CONN_DEBUG_PRINTOUT=data
    //CORE_SetLOG(LOG_cxx2c());
    //SetDiagTrace(eDT_Enable);
    //SetDiagPostLevel(eDiag_Info);
    //SetDiagPostFlag(eDPF_All);

    //test_id1_calls();

    const CArgs& args = GetArgs();
    int count = args["count"].AsInteger();
    Int8 gi_from = args["gi_from"].AsInt8();
    Int8 gi_to = args["gi_to"].AsInt8();

    CRef<CObjectManager> om = CObjectManager::GetInstance();
    for ( int i = 0; i < 100; ++i ) {
        CGBDataLoader::RegisterInObjectManager(*om, new CId1Reader);
    }
    for ( int pass = 0; pass < count; ++pass ) {
        CRef<CReadDispatcher> dispatcher(new CReadDispatcher);
        CRef<CReader> reader(new CId1Reader);
        dispatcher->InsertReader(0, reader);
        for ( Int8 gi = gi_from; gi <= gi_to; gi++ ) {
            NcbiCout << "gi: " << gi << ": " << NcbiEndl;
            CSeq_id_Handle seq_id = CSeq_id_Handle::GetGiHandle(gi);
            CStandaloneRequestResult request(seq_id);
            dispatcher->LoadSeq_idSeq_ids(request, seq_id);
            CLoadLockSeqIds seq_ids(request, seq_id);
            NcbiCout << "  ids:";
            CFixedSeq_ids ids2 = seq_ids.GetSeq_ids();
            ITERATE ( CFixedSeq_ids, i, ids2 ) {
                NcbiCout << " " << i->AsString();
            }
            NcbiCout << NcbiEndl;
            
            CLoadLockBlobIds blob_ids(request, seq_id, 0);
            dispatcher->LoadSeq_idBlob_ids(request, seq_id, 0);
            CFixedBlob_ids ids = blob_ids.GetBlob_ids();
            ITERATE ( CFixedBlob_ids, i, ids ) {
                const CBlob_Info& blob_info = *i;
                CConstRef<CBlob_id> blob_id = blob_info.GetBlob_id();
                NcbiCout << "  " << blob_id->ToString() << NcbiEndl;

                if ( !blob_id->IsMainBlob() ) {
                    continue;
                }
                CLoadLockBlob blob(request, *blob_id);
                dispatcher->LoadBlob(request, *blob_id);
                if ( !blob.IsLoadedBlob() ) {
                    NcbiCout << "blob is not available" << NcbiEndl;
                    continue;
                }
                NcbiCout << "    loaded" << NcbiEndl;
            }
        }
    }
    return 0;
}
开发者ID:svn2github,项目名称:ncbi_tk,代码行数:59,代码来源:test_reader_id1.cpp


示例13: main

int main(int Argc, char ** Argv)

{  

   GetArgs(Argc,Argv);
   ProcessData();
   PrintResults();
}
开发者ID:ZhiyingLi,项目名称:ecs40spring2016,代码行数:8,代码来源:Ins.c


示例14: OnRemoveArg

void dlgFunction::OnRemoveArg(wxCommandEvent &ev)
{
	unsigned int sel = lstArguments->GetSelection();
	argOids.RemoveAt(sel);
	lstArguments->DeleteItem(sel);
	btnRemove->Disable();
	txtArguments->SetValue(GetArgs());
	OnChangeArgName(ev);
}
开发者ID:xiul,项目名称:pgadmin3,代码行数:9,代码来源:dlgFunction.cpp


示例15: printf

TStrV TEnv::GetIfArgPrefixStrV(
    const TStr& PrefixStr, TStrV& DfValV, const TStr& DNm) const {
    TStrV ArgValV;
    if (Env.GetArgs()<=MnArgs) {
        // 'usage' argument message
        if (!SilentP) {
            printf("   %s%s (default:", PrefixStr.CStr(), DNm.CStr());
            for (int DfValN=0; DfValN<DfValV.Len(); DfValN++) {
                if (DfValN>0) {
                    printf(", ");
                }
                printf("'%s'", DfValV[DfValN].CStr());
            }
            printf(")\n");
        }
        return ArgValV;
    } else {
        // argument & value message
        TStr ArgValVChA;
        for (int ArgN=0; ArgN<GetArgs(); ArgN++) {
            // get argument string
            TStr ArgStr=GetArg(ArgN);
            if (ArgStr.StartsWith(PrefixStr)) {
                // extract & add argument value
                ArgStr.DelStr(PrefixStr);
                ArgValV.Add(ArgStr);
                // add to message string
                if (ArgValV.Len()>1) {
                    ArgValVChA+=", ";
                }
                ArgValVChA+=ArgValV.Last();
            }
        }
        if (ArgValV.Empty()) {
            ArgValV=DfValV;
        }
        // output argument values
        TChA MsgChA;
        MsgChA+="  "+DNm;
        MsgChA+=" (";
        MsgChA+=PrefixStr;
        MsgChA+=")=";
        for (int ArgValN=0; ArgValN<ArgValV.Len(); ArgValN++) {
            if (ArgValN>0) {
                MsgChA+=", ";
            }
            MsgChA+="'";
            MsgChA+=ArgValV[ArgValN];
            MsgChA+="'";
        }
        if (!SilentP) {
            TNotify::OnStatus(Notify, MsgChA);
        }
        return ArgValV;
    }
}
开发者ID:josthkko,项目名称:qminer,代码行数:56,代码来源:env.cpp


示例16: while

int TEnv::GetPrefixArgN(const TStr& PrefixStr) const {
    int ArgN=0;
    while (ArgN < GetArgs()) {
        if (GetArg(ArgN).StartsWith(PrefixStr)) {
            return ArgN;
        }
        ArgN++;
    }
    return -1;
}
开发者ID:josthkko,项目名称:qminer,代码行数:10,代码来源:env.cpp


示例17: GetCmLn

TStr TEnv::GetCmLn(const int& FromArgN) const {
    TChA CmLnChA;
    for (int ArgN=FromArgN; ArgN<GetArgs(); ArgN++) {
        if (ArgN>FromArgN) {
            CmLnChA+=' ';
        }
        CmLnChA+=GetArg(ArgN);
    }
    return CmLnChA;
}
开发者ID:josthkko,项目名称:qminer,代码行数:10,代码来源:env.cpp


示例18: IsChangedValue

bool SubExpressionTap::GetArgs(SubExpressionBlock &expBlock, Node *node) {
	if(!node)
		return false;
	Values value = node->value();
	if(BinaryOpNode *bNode = dynamic_cast<BinaryOpNode*>(node)){
		if(IdentifierNode *l_id = dynamic_cast<IdentifierNode*>(bNode->left))
				l_id->assignCounter = IsChangedValue(value) ? ++l_id->var->assignCounter : l_id->var->assignCounter;			
		if(IdentifierNode *r_id = dynamic_cast<IdentifierNode*>(bNode->right)){
			r_id->assignCounter = r_id->var->assignCounter;
		}

		if(!((bNode->left->isIdent() || bNode->left->isSimple()) &&	(bNode->right->isIdent() || bNode->right->isSimple()))){
			if(!IsModified(bNode->left) || !IsModified(bNode->right))
				return false;
				
			bool ok1 = GetArgs(expBlock, bNode->left),
				ok2 = GetArgs(expBlock, bNode->right);
			if(!ok1 || !ok2 || !IsModified(node))
				return false;
			expBlock.Add(node);
		} else {
			expBlock.Add(node);
		if(!IsModified(node))
			return false;
		}
	} else
		if(UnaryOpNode *uNode = dynamic_cast<UnaryOpNode*>(node)){
			if(IdentifierNode *id = dynamic_cast<IdentifierNode*>(uNode->operand)){
				if(IsChangedValue(value))
					id->assignCounter = ++id->var->assignCounter;
				else 
					id->assignCounter = id->var->assignCounter;
			}
			if(!(uNode->operand->isSimple() || uNode->operand->isIdent())){
				if(!GetArgs(expBlock, uNode->operand) || !IsModified(node))
					return false;
				expBlock.Add(node);
			}
			else
				expBlock.Add(uNode->value(), uNode->operand);
		}
	return true;
}
开发者ID:Alex-ttt,项目名称:C-Compoiler,代码行数:43,代码来源:sub_expressions.cpp


示例19: fasta_os

//  --------------------------------------------------------------------------
bool CAsn2FastaApp::HandleSeqEntry(CSeq_entry_Handle& seh)
//  --------------------------------------------------------------------------
{
    CFilteringFastaOstream fasta_os( *m_Os, x_GetFilterIncludes(GetArgs()));
    fasta_os.SetAllFlags(
        CFastaOstream::fNoDupCheck |
        CFastaOstream::fKeepGTSigns |
        CFastaOstream::fNoExpensiveOps);
    if( GetArgs()["show-mods"] ) {
        fasta_os.SetFlag(CFastaOstream::fShowModifiers);
    }
    if (m_DeflineOnly) {
        for (CBioseq_CI bioseq_it(seh);  bioseq_it;  ++bioseq_it) {
            fasta_os.WriteTitle(*bioseq_it);
        }
    } else {
        fasta_os.Write(seh);
    }
    return true;
}
开发者ID:jackgopack4,项目名称:pico-blast,代码行数:21,代码来源:asn2fasta.cpp


示例20: cmd

int CTest::Run(void)
{
    string cmd(GetArgs().GetCommand());
    if (cmd == "test") {
        RunInternalTest();
        _TRACE("\nTEST execution completed successfully!\n");
        return 0;
    }
    _TROUBLE;
    return 0;
}
开发者ID:svn2github,项目名称:ncbi_tk,代码行数:11,代码来源:test_compress_archive.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GetAspectRatio函数代码示例发布时间:2022-05-30
下一篇:
C++ GetArg函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap