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


C++ create函数代码示例

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


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

示例1: create

cfg_t::cfg_t(backend_visitor *v)
{
   create(v->mem_ctx, &v->instructions);
}
开发者ID:MaikuMori,项目名称:mesa,代码行数:4,代码来源:brw_cfg.cpp

示例2: create

void GMainLoopSource::scheduleAndDeleteOnDestroy(const char* name, std::function<bool()> function, int priority, std::function<void()> destroyFunction, GMainContext* context)
{
    create().schedule(name, function, priority, destroyFunction, context);
}
开发者ID:ddxxyy,项目名称:webkit,代码行数:4,代码来源:GMainLoopSource.cpp

示例3: test_creation_of_character_circular_queue

void test_creation_of_character_circular_queue(){
	CircularQueue* actual = create(sizeof(char),3);
	char exp_arr[] = {0,0,0};
	CircularQueue expected = {exp_arr,-1,-1,3,sizeof(char)};
	ASSERT(compareQueue(actual,&expected));
};
开发者ID:pallavig,项目名称:dsa,代码行数:6,代码来源:circularQueueTest.c

示例4: test_creation_of_double_circular_queue

void test_creation_of_double_circular_queue(){
	CircularQueue* actual = create(sizeof(double),3);
	double exp_arr[] = {0.0,0.0,0.0};
	CircularQueue expected = {exp_arr,-1,-1,3,sizeof(double)};
	ASSERT(compareQueue(actual,&expected));
};
开发者ID:pallavig,项目名称:dsa,代码行数:6,代码来源:circularQueueTest.c

示例5: runEppTestSecDns

int runEppTestSecDns(EppParser& parser)
{


	DOMNode* n;

	EppDomain domain("DOMAIN.BIZ");
	EppAuthInfo authInfo(EppAuthInfo::TYPE_PW, "3fooBar");
	domain.setAuthInfo(authInfo);
	EppCommandCreate create(&domain, "ABC-DEF-XXXX-ID");

	EppCommandCreateSecDns * createSecDns = new EppCommandCreateSecDns();
	EppSecDnsDsData ds0;
	EppSecDnsDsData ds1;
	time_t cal = ::time(0);

	char * str0 = "ABCDEF012345789";
	char * str1 = "012345789ABCDEF";

	ds0.setKeyTag(12345);
	ds0.setAlgorithm(3);
	ds0.setDigestType(1);
	//ds0.setDigest((unsigned char *) str0, 16);
	//ds0.setStartDate(cal);
	//ds0.setEndDate(cal + 86400 * 365);

	ds1.setKeyTag(54321);
	ds1.setAlgorithm(3);
	ds1.setDigestType(1);
	//ds1.setDigest((unsigned char *) str1, 16);
	//ds1.setStartDate(cal + 86400 * 365);
	//ds1.setEndDate(cal + 86400 * 730);
	//ds1.setValidationInterval("P60D");

	createSecDns->add(ds0);
	createSecDns->add(ds1);

	create.addExtension(createSecDns);

	cout << create.toString() << endl;
	parser.parse(create.toString());
	n = parser.getRootNode();
	EppCommandCreate * newCreate = (EppCommandCreate *) EppCommand::fromXML(*n);
	cout << newCreate->toString() << endl;
	delete newCreate;

	EppCommandUpdateDomain updateDomainAdd("DOMAIN.BIZ");
	updateDomainAdd.setClientTransactionId("CLINET-XID");

	EppCommandUpdateSecDns * addSecDns = new EppCommandUpdateSecDns();
	addSecDns->add(ds0);
	addSecDns->add(ds1);
	updateDomainAdd.addExtension(addSecDns);

	cout << updateDomainAdd.toString() << endl;
	parser.parse(updateDomainAdd.toString());
	n = parser.getRootNode();
	EppCommandUpdate * newUpdateDomainAdd = (EppCommandUpdate *) EppCommand::fromXML(*n);
	cout << newUpdateDomainAdd->toString() << endl;
	delete newUpdateDomainAdd;

	EppCommandUpdateDomain updateDomainChg("DOMAIN.BIZ");
	updateDomainChg.setClientTransactionId("CLINET-XID");

	EppCommandUpdateSecDns * chgSecDns = new EppCommandUpdateSecDns();
	chgSecDns->change(ds0);
	chgSecDns->change(ds1);
	updateDomainChg.addExtension(chgSecDns);

	cout << updateDomainChg.toString() << endl;
	parser.parse(updateDomainChg.toString());
	n = parser.getRootNode();
	EppCommandUpdate * newUpdateDomainChg = (EppCommandUpdate *) EppCommand::fromXML(*n);
	cout << newUpdateDomainChg->toString() << endl;
	delete newUpdateDomainChg;

	EppCommandUpdateDomain updateDomainRem("DOMAIN.BIZ");
	updateDomainRem.setClientTransactionId("CLINET-XID");

	EppCommandUpdateSecDns * remSecDns = new EppCommandUpdateSecDns();
	updateDomainRem.addExtension(remSecDns);

	cout << updateDomainRem.toString() << endl;
	parser.parse(updateDomainRem.toString());
	n = parser.getRootNode();
	EppCommandUpdate * newUpdateDomainRem = (EppCommandUpdate *) EppCommand::fromXML(*n);
	cout << newUpdateDomainRem->toString() << endl;
	delete newUpdateDomainRem;

	EppResult result(EppError::CODE_NO_ERROR);
	EppValueReason reason0("Value0", "Reason0", "en_US");
	EppValueReason reason4("Value4");
	result.addValue(reason0);
	result.addValue("Value1");
	result.addValue("Value2");
	result.addValue("Value3");
	result.addValue(reason4);
	EppTransactionId trid("CLIENT-XID", "SERVER-ID");
	EppResponse rsp;
	rsp.addResult(result);
//.........这里部分代码省略.........
开发者ID:neustar,项目名称:registrar_toolkit,代码行数:101,代码来源:EppTestSecDns.cpp

示例6: create

StackTraceNoHeap::StackTraceNoHeap(bool trace) {
  if (trace && Enabled) {
    create();
  }
}
开发者ID:Orvid,项目名称:hhvm,代码行数:5,代码来源:stack-trace.cpp

示例7: create

void ViewZoneDlg::doDialog()
{
    if (!isCreated())
        create(IDD_VIEWZONE);
    display();
};
开发者ID:Loreia,项目名称:UDL2,代码行数:6,代码来源:documentMap.cpp

示例8: destroy

int GatherPolicy::reload()
{
  destroy();
  return create();
}
开发者ID:kernel0612,项目名称:multip_http_sensor,代码行数:5,代码来源:GatherPolicy.cpp

示例9: create

NDBT_Thread::NDBT_Thread()
{
  create(0, -1);
}
开发者ID:4T-Shirt,项目名称:mysql,代码行数:4,代码来源:NDBT_Thread.cpp

示例10: setUp

 void setUp() {
   create();
 }
开发者ID:JesseChavez,项目名称:rubinius,代码行数:3,代码来源:test_thread.hpp

示例11: test_create_should_create_a_head_with_null

void test_create_should_create_a_head_with_null(){
	listPtr = create();
	ASSERT(listPtr->length == 0);
	ASSERT(listPtr->head == NULL );
}
开发者ID:manishjo,项目名称:DSA,代码行数:5,代码来源:priorityQueueTest.c

示例12: test_top_return_top_null_of_stack_if_stack_empty

void test_top_return_top_null_of_stack_if_stack_empty(){
	Stack* stack = create(sizeof(int),3);
	ASSERT(!top(stack));
}
开发者ID:KavitaJadhav,项目名称:DSA,代码行数:4,代码来源:stackLibTest.c

示例13: create

    int Cornea::computeCentre(const std::vector<Eigen::Vector3d, Eigen::aligned_allocator<Eigen::Vector3d> > &led_pos, // LED locations
                              const std::vector<Eigen::Vector3d, Eigen::aligned_allocator<Eigen::Vector3d> > &glint_pos,
                              std::vector<double> &gx_guesses,
                              Eigen::Vector3d &centre,
                              double &err) {

        // initialise the cornea tracker
        create(led_pos, glint_pos);

        /*
         * Check out usage and more info about GSL:
         * http://www.csse.uwa.edu.au/programming/gsl-1.0/gsl-ref_35.html
         */

        const size_t n = 3 * pairsOfTwo(data.size());	// number of functions
        const size_t p = gx_guesses.size();				// number of parameters

        // initial guesses
        gsl_vector_const_view x = gsl_vector_const_view_array(gx_guesses.data(), p);

        gsl_multifit_function_fdf f;
        f.f			= &my_f;	// function
        f.df		= &my_df;	// derivative
        f.fdf		= &my_fdf;	// both
        f.n			= n;		// number of functions
        f.p			= p;		// number of parameters
        f.params	= this;		// additional parameter

        const gsl_multifit_fdfsolver_type *T = gsl_multifit_fdfsolver_lmsder;
        gsl_multifit_fdfsolver *solver = gsl_multifit_fdfsolver_alloc(T, n, p);
        gsl_multifit_fdfsolver_set(solver, &f, &x.vector);


        int status;
        unsigned int iter = 0;

        do {
            iter++;
            status = gsl_multifit_fdfsolver_iterate(solver);

            if(status) {
                break;
            }

            status = gsl_multifit_test_delta(solver->dx, solver->x, PRECISION, PRECISION);

        }
        while(status == GSL_CONTINUE && iter < MAX_ITER);

        if(iter == MAX_ITER) {
            printf("Cornea::computeCentre(): iter = MAX_ITER\n");
        }


        gsl_matrix *covar = gsl_matrix_alloc(p, p);
        gsl_multifit_covar(solver->J, 0.0, covar);

        // for(int row = 0; row < p; ++row) {
        //     for(int col = 0; col < p; ++col) {
        //         printf("%.2f ", covar->data[row * p + col]);
        //     }
        //     printf("\n");
        // }
        // printf("*****************************\n");

        /***********************************************************************
         * Compute the fit error
         **********************************************************************/

        err = 0;
        for(size_t i = 0; i < p; i++) {
            err += gsl_matrix_get(covar, i, i);
        }
        err = std::sqrt(err);


        Eigen::Vector3d cw(0.0, 0.0, 0.0);

        // cornea sphere radius
        const double RHO = trackerSettings.RHO;

        // remove this
        double dMaxX = -10.0;

        for(size_t i = 0; i < data.size(); ++i) {

            const DATA_FOR_CORNEA_COMPUTATION &cur_data = data[i];

            const double gx_guess = gsl_vector_get(solver->x, i);

            const double B_aux = atan2(gx_guess * tan(cur_data.alpha_aux), (cur_data.l_aux - gx_guess));

            // calculate the corneal sphere centers in the auxiliary coordinate systems
            const Eigen::Vector3d c_aux(gx_guess - RHO * sin((cur_data.alpha_aux - B_aux) / 2.),
                                        0.,
                                        gx_guess * tan(cur_data.alpha_aux) + RHO * cos((cur_data.alpha_aux - B_aux) / 2.));

            const Eigen::Vector3d tmp = cur_data.R * c_aux;

            cw(0) += tmp(0);
//.........这里部分代码省略.........
开发者ID:bwrc,项目名称:gaze_tracker_glasses,代码行数:101,代码来源:Cornea_computer.cpp

示例14: mycreat

int
mycreat(char *n, int p)
{

	return create(n, 1, p);
}
开发者ID:8l,项目名称:NxM,代码行数:6,代码来源:Posix.c

示例15: create

MenuWorldLeadOut::MenuWorldLeadOut(const string &imageFileName)
{
	create(imageFileName);
}
开发者ID:foxostro,项目名称:arbarlith2,代码行数:4,代码来源:MenuWorldLeadOut.cpp


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