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

C++ LOCAL函数代码示例

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

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



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

示例1: collection_check1_aux

    template<typename T> void collection_check1_aux (T* table, size_t nb)
    {
        /** We create a collection. */
        Collection<T>* c = new CollectionFile<T> ("foo");
        LOCAL(c);

        /** We insert some items. */
        for (size_t i=0; i<nb; i++)  { c->insert (table[i]); }

        /** We have to flush to be sure all items are in the collection. */
        c->flush();

        /** We check we have the correct number of items. */
        CPPUNIT_ASSERT (c->getNbItems() == (int)nb);

        /** We iterate the collection. */
        Iterator<T>* it = c->iterator();
        LOCAL(it);

        /** We check we get the correct items. */
        size_t i=0;
        for (it->first(); !it->isDone(); it->next())  {  CPPUNIT_ASSERT (it->item() == table[i++]);  }

        /** We delete physically the collection. */
        //c->remove ();
    }
开发者ID:cdeltel,项目名称:gatb-core-mirrored,代码行数:26,代码来源:TestCollection.cpp


示例2: QVBoxLayout

void QToDoContent::initUI()
{
    QVBoxLayout *vlay = new QVBoxLayout(this);
    QWidget *centerWidget = new QWidget(this);
    QGridLayout *grid = new QGridLayout(centerWidget);

    vlay->setContentsMargins(0,0,0,0);
    grid->setContentsMargins(0,0,0,0);
    grid->setSpacing(5);
    m_tree = new QTreeView(centerWidget);
    m_tree->setGeometry(QRect(0,0,400,300));
    m_tree->setMaximumWidth(200);
    m_edit = new QTextEdit(centerWidget);
    m_okBtn = new QPureColorButton(centerWidget);
    m_cancelBtn = new QPureColorButton(centerWidget);
    m_okBtn->setMaximumHeight(40);
    m_cancelBtn->setMaximumHeight(40);
    connect(m_okBtn,SIGNAL(clicked()),this,SLOT(ok_clicked()));
    connect(m_cancelBtn,SIGNAL(clicked()),this,SLOT(close()));
    m_okBtn->setButtonText(LOCAL("确认选择"));
    m_cancelBtn->setButtonText(LOCAL("取消"));
    m_okBtn->setMaximumWidth(80);
    m_cancelBtn->setMaximumWidth(80);
    m_model = new QStandardItemModel(this);
    m_model->setColumnCount(2);
    m_tree->setModel(m_model);
    m_tree->setColumnWidth(0,600);

    grid->addWidget(m_tree,0,0,3,1,Qt::AlignLeft);
    grid->addWidget(m_edit,0,1,2,8);
    grid->addWidget(m_okBtn,2,6,1,1);
    grid->addWidget(m_cancelBtn,2,7,1,1);

    vlay->addWidget(centerWidget);
}
开发者ID:xiaojianwu,项目名称:QtDeskTop,代码行数:35,代码来源:qtodocontent.cpp


示例3: QDialog

SearchDlg::SearchDlg(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::SearchDlg)
{
    ui->setupUi(this);
    Qt::WindowFlags flags=Qt::Dialog;
    flags |=Qt::WindowMinimizeButtonHint |Qt::WindowMaximizeButtonHint;
    setWindowFlags(flags);
    this->setWindowTitle(LOCAL("查找用户"));
    itemModel_ = new QStandardItemModel(0,4,this);
    itemModel_->setHeaderData(0,Qt::Horizontal,LOCAL("财政通行证账号"));
    itemModel_->setHeaderData(1,Qt::Horizontal,LOCAL("姓名"));
    itemModel_->setHeaderData(2,Qt::Horizontal,LOCAL("用户名"));
    itemModel_->setHeaderData(3,Qt::Horizontal,tr("Email"));
    ui->treeView->setColumnWidth(0,250);
    ui->treeView->setColumnWidth(1,100);
    ui->treeView->setColumnWidth(2,100);
    ui->treeView->setColumnWidth(3,200);
    ui->treeView->setModel(itemModel_);
    ui->pushButton_AddContact->setEnabled(false);
    //flag_search = 0;
    connect(ui->treeView,SIGNAL(clicked(QModelIndex)),this,SLOT(treeClick(QModelIndex)));
    connect(ui->pushButton_find,SIGNAL(clicked()),this,SLOT(btnSearchClick()));
    connect(ui->pushButton_AddContact,SIGNAL(clicked()),this,SLOT(addContactClick()));
    //connect(ui->radioButton_id, SIGNAL(clicked(bool)), this, SLOT(slotchangeID()));
    //connect(ui->radioButton_name, SIGNAL(clicked(bool)), this, SLOT(slotchangeName()));
    bool check;
    check= connect(Listwindow::Instance(),SIGNAL(handleSearch(QString)),this,SLOT(handleSearch(QString)));
    check = connect(this, SIGNAL(addnewfreind(QString)), Listwindow::Instance(), SLOT(slotaddnew(QString)));
    Q_ASSERT(check);
    type_ = AddContact;
}
开发者ID:ycsoft,项目名称:QtQQ,代码行数:32,代码来源:searchdlg.cpp


示例4: astserial

uint32_t
astserial(int serial, uint32_t op)
{
	uint32_t	r;
	uint32_t*	v;

	switch (serial)
	{
	case AST_SERIAL_ENVIRON:
		v = &LOCAL(env_serial);
		break;
	case AST_SERIAL_LOCALE:
		v = &LOCAL(locale.serial);
		break;
	case AST_SERIAL_RESTART:
		v = &GLOBAL(restart);
		break;
	default:
		return 0;
	}
	r = asoget32(v);
	switch (op)
	{
	case AST_SERIAL_get:
		switch (r)
		{
		case AST_SERIAL_except:
			asocas32(v, r, AST_SERIAL_always);
			break;
		}
		break;
	case AST_SERIAL_inc:
		switch (r)
		{
		case AST_SERIAL_always:
			break;
		case AST_SERIAL_except:
			asocas32(v, r, AST_SERIAL_always);
			r = asoget32(v);
			break;
		case AST_SERIAL_max:
			if (asocas32(v, r, 1) == r)
			{
				r = asoget32(v);
				break;
			}
			/*FALLTHROUGH*/
		default:
			r = asoinc32(v) + 1;
			break;
		}
		break;
	case AST_SERIAL_always:
	case AST_SERIAL_except:
		asocas32(v, r, op);
		break;
	}
	return r;
}
开发者ID:nathanmkaya,项目名称:ksh-arch,代码行数:59,代码来源:intercept.c


示例5: CollectLocalVar_VisitAssignNode

static kbool_t CollectLocalVar_VisitAssignNode(KVISITOR_PARAM)
{
	kUntypedNode *left = kUntypedNode_At(node, 1);
	kUntypedNode *right = kUntypedNode_At(node, 2);
	if(kUntypedNode_node(left) == KNode_Local) {
		LOCAL(left->typeAttr, left->index);
		KLIB VisitNode(kctx, builder, right, thunk);
	} else{
		LOCAL(KType_Object, (khalfword_t)left->index);
		KLIB VisitNode(kctx, builder, right, thunk);
	}
	return true;
}
开发者ID:masakiishii,项目名称:konoha.js,代码行数:13,代码来源:MiniVM.c


示例6: main

int main (int argc, char* argv[])
{
    /** We create a command line parser. */
    OptionsParser parser ("bankgen");

    const char* OUTPUT_PREFIX = "-out";
    const char* SEQ_LEN       = "-seq-len";
    const char* READ_LEN      = "-read-len";
    const char* OVERLAP_LEN   = "-overlap-len";
    const char* COVERAGE      = "-coverage";

    parser.push_back (new OptionOneParam (OUTPUT_PREFIX,  "output prefix",               true));
    parser.push_back (new OptionOneParam (SEQ_LEN,        "sequence length",             false,  "1000000"));
    parser.push_back (new OptionOneParam (READ_LEN,       "read length",                 false,  "150" ));
    parser.push_back (new OptionOneParam (OVERLAP_LEN,    "overlap between two reads",   false,  "50" ));
    parser.push_back (new OptionOneParam (COVERAGE,       "coverage",                    false,  "3" ));

    try
    {
        /** We parse the user options. */
        IProperties* options = parser.parse (argc, argv);

        /** We create the random sequence. */
        IBank* randomBank = new BankRandom (1, options->getInt(SEQ_LEN));
        LOCAL (randomBank);

        /** We create the reads bank. */
        IBank* readsBank = new BankSplitter (
            randomBank,
            options->getInt(READ_LEN),
            options->getInt(OVERLAP_LEN),
            options->getInt(COVERAGE)
        );
        LOCAL (readsBank);

        /** We save the random bank. */
        SaveAsFasta (randomBank, options->getStr(OUTPUT_PREFIX) + "_sequence.fa");

        /** We save the reads bank. */
        SaveAsFasta (readsBank, options->getStr(OUTPUT_PREFIX) + "_reads.fa");
    }
    catch (OptionFailure& e)
    {
        e.getParser().displayErrors (stdout);
        e.getParser().displayHelp   (stdout);
        return EXIT_FAILURE;
    }

    return EXIT_SUCCESS;
}
开发者ID:GATB,项目名称:gatb-core,代码行数:50,代码来源:bankgen.cpp


示例7: qDebug

void QHttpDownLoad::finished()
{
    qDebug()<<"Download Finished";

    if ( !m_error )
    {
        QMessageBox::information(NULL,LOCAL("已完成"),LOCAL("文件下载完毕"),0);
    }else
    {
        QMessageBox::information(NULL,LOCAL("错误"),LOCAL("文件下载出错"),0);
    }
    m_file->close();
    delete m_file;

}
开发者ID:xiaojianwu,项目名称:QtDeskTop,代码行数:15,代码来源:qhttpdownload.cpp


示例8: main

int main (int argc, char* argv[])
{
    if (argc < 2)
    {
        std::cerr << "you must provide a bank." << std::endl;
        return EXIT_FAILURE;
    }

    // We define a try/catch block in case some method fails
    try
    {
        // We declare an input Bank and use it locally
        IBank* inputBank = Bank::open (argv[1]);
        LOCAL (inputBank);

        // We create a sequence iterator for the bank with progress information
        ProgressIterator<Sequence> iter (*inputBank, "Iterating sequences");

        // We loop over sequences.
        for (iter.first(); !iter.isDone(); iter.next())
        {
            // Note that we do nothing inside the sequence iterating loop
        }
    }
    catch (Exception& e)
    {
        std::cerr << "EXCEPTION: " << e.getMessage() << std::endl;
    }
}
开发者ID:GATB,项目名称:gatb-core,代码行数:29,代码来源:bank5.cpp


示例9: qDebug

void QJSCore::PicAcq()
{
    qDebug()<<LOCAL("采集图像。。。。。。");
    byte head[2] = PIC_ACQ;
    Cmd::Command &cmd = m_dev->createCommand(head,NULL,0);
    m_dev->sendCmd(cmd);
}
开发者ID:ycsoft,项目名称:JFC-Debuger,代码行数:7,代码来源:qjscore.cpp


示例10: main

int main (int argc, char* argv[])
{
    // We get a command line parser for graphs available options.
    IOptionsParser* parser = Graph::getOptionsParser();
    LOCAL (parser);

    // We use a try/catch block in case we have some command line parsing issue.
    try
    {
        // We parse the user options.
        parser->parse (argc, argv);

        // We create the graph with the provided options.
        Graph graph = Graph::create (parser->getProperties());

        // We dump some information about the graph.
        std::cout << graph.getInfo() << std::endl;
    }
    catch (OptionFailure& e)
    {
        return e.displayErrors (std::cout);
    }
    catch (Exception& e)
    {
        std::cerr << "EXCEPTION: " << e.getMessage() << std::endl;
    }

    return EXIT_SUCCESS;
}
开发者ID:GATB,项目名称:gatb-core,代码行数:29,代码来源:debruijn1.cpp


示例11: main

int main (int argc, char* argv[])
{
    // We get the file name from the user arguments
    const char* filename = argc >= 2 ? argv[1] : "";

    // We get information about the bank.
    u_int64_t nbSequences=0, dataSize=0, seqMaxSize=0, seqMinSize=~0;

    // We declare a Bank instance.
    IBank* bank = Bank::open (filename);
    LOCAL (bank);

    // IN A NEAR FUTURE, WE WILL HAVE STL LIKE ITERATORS.
#if 0
    for (BankFasta::iterator it = bank->begin(); it != bank->end(); ++it)
    {
        Sequence& seq = *it;

        Data& data = seq.getData();

        nbSequences ++;
        if (data.size() > seqMaxSize)  { seqMaxSize = data.size(); }
        if (data.size() < seqMinSize)  { seqMinSize = data.size(); }
        dataSize += data.size ();
    }
#endif

    std::cout << "data size         : " << dataSize     << std::endl;
    std::cout << "sequence number   : " << nbSequences  << std::endl;
    std::cout << "sequence max size : " << seqMaxSize   << std::endl;
    std::cout << "sequence min size : " << seqMinSize   << std::endl;
}
开发者ID:pombredanne,项目名称:gatb-core,代码行数:32,代码来源:bank15.cpp


示例12: LOCAL

void MPHFAlgorithm<span,Abundance_t,NodeState_t>::check ()
{
    size_t nb_iterated = 0;

    Iterator<Count>* itKmers = _solidCounts->iterator();  LOCAL (itKmers);
    
    // TODO parallize that too

    for (itKmers->first(); !itKmers->isDone(); itKmers->next())
    {
        Count& count = itKmers->item();

        /** We get the current abundance. */
        Abundance_t abundance = (*_abundanceMap)[count.value];

        // sanity check (thank god i wrote this, was useful for spruce) //todo change this now that abundance is discretized
       /* if (abundance!=count.abundance && abundance<MAX_ABUNDANCE)
        {  
            std::cout << "debug info: " << (int)abundance << " " << (int)count.abundance << std::endl;
            typename AbundanceMap::Hash::Code h = _abundanceMap->getCode (count.value);
            size_t n = _abundanceMap->size();
            std::cout << "debug info: " << h << " / " << n << std::endl;
            throw Exception ("ERROR: MPHF isn't injective (abundance population failed)");  
        }*/

        nb_iterated ++;
    }

    if (nb_iterated != _abundanceMap->size() && _abundanceMap->size() > 3)
    {
        throw Exception ("ERROR during abundance population: itKmers iterated over %d/%d kmers only", nb_iterated, _abundanceMap->size());
    }
}
开发者ID:zy26,项目名称:gatb-core,代码行数:33,代码来源:MPHFAlgorithm.cpp


示例13: setType

void SearchDlg::setType(int tp)
{
    type_ = tp;
    if ( tp == UserSearch )
    {
        ui->pushButton_AddContact->setText(LOCAL("选择"));
    }
}
开发者ID:ycsoft,项目名称:QtQQ,代码行数:8,代码来源:searchdlg.cpp


示例14: info

void QHttpDownLoad::downloadFile(QString url)
{
    QFileInfo   info(url);
    QString     fn =  info.fileName();
    m_file = new QFile(fn);
    qDebug()<<"File Name: "<<fn;
    if ( m_file->exists() )
    {
        int res = 0;
        QString title = LOCAL("提示"), text = LOCAL("文件已存在,是否重复下载?");
        res = QMessageBox::information(NULL,title,text,QMessageBox::Yes,QMessageBox::No);
        if ( res != QMessageBox::Yes)
        {
            delete m_file;
            m_file = NULL;
            qDebug()<<"Do not overwrite";
        }else
        {
            qDebug()<<"Overwrite";
            m_file->open(QIODevice::WriteOnly);
            QNetworkRequest &request = QNetworkRequest(QUrl(url));
            m_error = false;
            m_reply = m_nam->get(request);
            connect(m_reply,SIGNAL(readyRead()),this,SLOT(readyRead()));
            connect(m_reply,SIGNAL(finished()),this,SLOT(finished()));
            connect(m_reply,SIGNAL(error(QNetworkReply::NetworkError)),this,SLOT(error(QNetworkReply::NetworkError)));

        }
    }else
    {
        qDebug()<<"Download";
        m_file->open(QIODevice::WriteOnly);
        QNetworkRequest &request = QNetworkRequest(QUrl(url));
        m_error = false;
        m_reply = m_nam->get(request);
        connect(m_reply,SIGNAL(readyRead()),this,SLOT(readyRead()));
        connect(m_reply,SIGNAL(finished()),this,SLOT(finished()));
        connect(m_reply,SIGNAL(error(QNetworkReply::NetworkError)),this,SLOT(error(QNetworkReply::NetworkError)));

    }

}
开发者ID:hermixy,项目名称:QtDeskTop,代码行数:42,代码来源:qhttpdownload.cpp


示例15: QDialog

//查找好友
FindFriend::FindFriend(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::FindFriend)
{
    ui->setupUi(this);
    Qt::WindowFlags flags=Qt::Dialog;
        flags |=Qt::WindowMinimizeButtonHint ;
        setWindowFlags(flags);
    this->setWindowTitle(LOCAL("添加好友"));
    connect(ui->pushButton,SIGNAL(clicked()),this,SLOT(addFriend()));
}
开发者ID:ash-github,项目名称:QtQQ,代码行数:12,代码来源:findfriend.cpp


示例16: Fposition_if_not

void Fposition_if_not(CL_FORM *base, int nargs)
{
	CL_FORM *rest_0;
	CL_FORM *local;
	GEN_HEAPVAR(ARG(0), ARG(0 + nargs));
	rest_0 = ARG(2);
	local = ARG(nargs);
	LOAD_GLOBFUN(&CFposition, LOCAL(0));
	LOAD_NIL(LOCAL(1));
	COPY(ARG(1), LOCAL(2));
	LOAD_SYMBOL(SYMBOL(Slisp, 282), LOCAL(3));	/* TEST */
	{
		GEN_CLOSURE(array, LOCAL(4), 4, Z156_lambda, 2);
		COPY(ARG(0), &array[3]);
		LOAD_CLOSURE(array, LOCAL(4));
	}
	COPY(LOCAL(4), LOCAL(4));
	REST_APPLY(LOCAL(0), 5, rest_0);
	COPY(LOCAL(0), ARG(0));
}
开发者ID:hoelzl,项目名称:Clicc,代码行数:20,代码来源:lisp611.c


示例17: Z7_lambda

static void Z7_lambda(CL_FORM *base, int nargs)
{
	CL_FORM *rest_0;
	CL_FORM *local;
	rest_0 = ARG(1);
	local = ARG(nargs + 1);
	{
		COPY(INDIRECT(GET_FORM(ARG(0)) + 3), LOCAL(0));
		REST_APPLY(LOCAL(0), 1, rest_0);
		mv_count = 1;
		if(CL_TRUEP(LOCAL(0)))
		{
			LOAD_NIL(ARG(0));
		}
		else
		{
			LOAD_SYMBOL(SYMBOL(Slisp, 48), ARG(0));	/* T */
		}
	}
}
开发者ID:hoelzl,项目名称:Clicc,代码行数:20,代码来源:nunion1.c


示例18: main

int main (int argc, char* argv[])
{
    if (argc < 2)
    {
        std::cerr << "you must provide a bank." << std::endl;
        return EXIT_FAILURE;
    }

    // We declare an input Bank and use it locally
    IBank* inputBank = Bank::open (argv[1]);
    LOCAL (inputBank);

    // We create an iterator over this bank.
    Iterator<Sequence>* it = inputBank->iterator();
    LOCAL (it);

    // We loop over sequences in a "push" fashion (a functor is called for each sequence)
    Functor fct;
    it->iterate (fct);
}
开发者ID:pombredanne,项目名称:gatb-core,代码行数:20,代码来源:bank3.cpp


示例19: CP_builtin_set2

VOIDPTRFUNC
CP_builtin_set2() {
    {
	OBJ value = RETVAL;
	OBJ env = ARG(0);
	OBJ varName = LOCAL(0);

	environmentSet(env, varName, value);
	RETURN (js_void);
     }
}
开发者ID:JohannesTheo,项目名称:JScheme,代码行数:11,代码来源:builtinFunctions.c


示例20: QDialog

SendFiles::SendFiles(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::SendFiles)
{
    ui->setupUi(this);
    Qt::WindowFlags flags=Qt::Dialog;
        flags |=Qt::WindowMinimizeButtonHint;
        setWindowFlags(flags);
    this->setWindowTitle(LOCAL("文件发送"));
    connect(ui->choose,SIGNAL(clicked()),this,SLOT(choosefile()));
    connect(ui->send,SIGNAL(clicked()),this,SLOT(sendfile())); 
}
开发者ID:ash-github,项目名称:QtQQ,代码行数:12,代码来源:sendfiles.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ LOCAL_COPY函数代码示例发布时间:2022-05-30
下一篇:
C++ LOC函数代码示例发布时间: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