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

C++ destroy函数代码示例

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

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



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

示例1:

inline LazyInit<T>::~LazyInit ()
{
   if (_ptr != NULL) destroy();
}
开发者ID:deniskin82,项目名称:chapel,代码行数:4,代码来源:lazy.hpp


示例2: destroy

 UpdateComponent::~UpdateComponent()
 {
     destroy();
 }
开发者ID:mphe,项目名称:GameLib,代码行数:4,代码来源:UpdateComponent.cpp


示例3: main

int main(int argc, char *argv[]) {
   char line,c;
   int i,j,e1, e2;
   edge e;
   createList(&edgeList, sizeof(edge), NULL);
   pthread_t thread_satcnf, thread_approx_1, thread_approx_2;
      
   loop:while(scanf(" %c", &line) != EOF) {
      switch(line) {
         case 'V':
            scanf(" %d", &numNodes);

            if(numNodes <= 0) {
               fprintf(stderr,"Error: Invalid number of vertices: %d!\n", numNodes);
               goto loop;
            }

            if(edgeList.length != 0) {
               destroy(&edgeList);             
            }

            break;
         case 'E':
            scanf(" %c", &c);

            while(c != '}') {
               if(!scanf(" <%d,%d>", &e1,&e2)) goto loop;

               if( (e1 >= numNodes || e1 < 0) || (e2 >= numNodes || e2 < 0)) {
                  fprintf(stderr,"Error: Invalid edge <%d,%d>!\n", e1, e2);
                  destroy(&edgeList);
                  goto loop;
               }

               e.p1 = e1;
               e.p2 = e2;
               append(&edgeList,&e);
               scanf("%c", &c); //scan ',' or '}'
            }

            thread_function_args thread_args[N];

            /*initialize parameters for each thread function*/
            for(i=0; i<N; i++) {
               thread_args[i].numNodes = numNodes;
               thread_args[i].edgeList = &edgeList;
               thread_args[i].vc = NULL;
            }

            int iter = 1;

            #ifdef DEBUG
               iter = 10;
               double ratio1,ratio2;
               double *runTimeSatCnf = (double *)malloc(iter*sizeof(double));
               double *runTimeApprox1 = (double *)malloc(iter*sizeof(double));
               double *runTimeApprox2 = (double *)malloc(iter*sizeof(double));
            #endif

            for(j=0; j<iter; j++) {
               pthread_create(&thread_satcnf, NULL, &sat_cnf, &thread_args[0]);
               pthread_create(&thread_approx_1, NULL, &approx1, &thread_args[1]);
               pthread_create(&thread_approx_2, NULL, &approx2, &thread_args[2]);

               pthread_join(thread_satcnf, NULL);
               pthread_join(thread_approx_1, NULL);
               pthread_join(thread_approx_2, NULL);   

               #ifdef DEBUG
                  runTimeSatCnf[j] = thread_args[0].cputime;
                  runTimeApprox1[j] = thread_args[1].cputime;
                  runTimeApprox2[j] = thread_args[2].cputime;
               #endif
            }

            #ifdef DEBUG
               ratio1 = thread_args[1].vcSize / (double) thread_args[0].vcSize;
               ratio2 = thread_args[2].vcSize / (double) thread_args[0].vcSize; 

               for(j=0; j<iter; j++) {
                  //printf("%f,%f\n", runTimeApprox1[j],runTimeApprox2[j]);
                  printf("%f,%f,%f\n", runTimeSatCnf[j],runTimeApprox1[j],runTimeApprox2[j]);
                  fflush(stdout);
               }
               printf("%f,%f\n", ratio1,ratio2);
               printf("%f\n", ratio);
               fflush(stdout);

               for(i=0; i<N; i++) {
                  free(thread_args[i].vc);
               }
               free(runTimeSatCnf);
               free(runTimeApprox1);
               free(runTimeApprox2);
            #else
               const char *name[N] = {"CNF-SAT-VC", "APPROX-VC-1", "APPROX-VC-2"};
                  
               for(i=0; i<N; i++) {
                  printVC(thread_args[i].vcSize, thread_args[i].vc, name[i]);
                  free(thread_args[i].vc);
//.........这里部分代码省略.........
开发者ID:chrisplyn,项目名称:ece650,代码行数:101,代码来源:main.c


示例4: destroy

GBuffer::~GBuffer() { destroy(); }
开发者ID:mickymuis,项目名称:folia,代码行数:1,代码来源:gbuffer.cpp


示例5: destroy

ShaderObject::~ShaderObject()
{
    destroy();
}
开发者ID:rugnight,项目名称:glfw,代码行数:4,代码来源:shader.cpp


示例6: destroy

void CEffectManager::Reload()
{
	destroy();
	load(m_FileName);
}
开发者ID:rcrmn,项目名称:mastervj-basic-engine,代码行数:5,代码来源:EffectManager.cpp


示例7: destroy

PlayActionEffectComboInstance::~PlayActionEffectComboInstance()
{
	DEC_NDOBJ_RTCLS;
	destroy( true );
}
开发者ID:korman,项目名称:Temp,代码行数:5,代码来源:PlayActionEffectComboInstance.cpp


示例8: destroy

 ~vector() { destroy(vec_.start_, vec_.finish_); }
开发者ID:0x-ff,项目名称:libmysql-android,代码行数:1,代码来源:vector.hpp


示例9: destroy

	TextureManager::~TextureManager()
	{
		destroy();
	}
开发者ID:holocronweaver,项目名称:python-ogre,代码行数:4,代码来源:TextureManager.cpp


示例10: toRenderBox

void InlineBox::deleteLine(RenderArena* arena)
{
    if (!m_extracted && m_renderer->isBox())
        toRenderBox(m_renderer)->setInlineBoxWrapper(0);
    destroy(arena);
}
开发者ID:flwh,项目名称:Alcatel_OT_985_kernel,代码行数:6,代码来源:InlineBox.cpp


示例11: destroy

ofFbo::~ofFbo() {
    destroy();
}
开发者ID:pampam,项目名称:openFrameworks,代码行数:3,代码来源:ofFbo.cpp


示例12: destroy

int LLL::destroy(void) {
	return destroy(head);
}
开发者ID:michelleduer,项目名称:independent-study,代码行数:3,代码来源:lll.cpp


示例13: destroy

void WSHttpBinding_USCOREINWNMasterServerAPIService::reset()
{	destroy();
	soap_done(this);
	soap_init(this);
	WSHttpBinding_USCOREINWNMasterServerAPIService_init(SOAP_IO_DEFAULT, SOAP_IO_DEFAULT);
}
开发者ID:HellSinker,项目名称:nwncx,代码行数:6,代码来源:soapWSHttpBinding_USCOREINWNMasterServerAPIService.cpp


示例14: destroy

	~ObjectPool()
	{
		destroy();
	}	
开发者ID:321543223,项目名称:kbengine,代码行数:4,代码来源:objectpool.hpp


示例15: destroy

xhn::context::~context()
{
    destroy();
}
开发者ID:vengine,项目名称:xhnSTL,代码行数:4,代码来源:xhn_context.cpp


示例16: destroy

VirusMonitor::Gui::Window::~Window()
{
  destroy();
}
开发者ID:blakelapierre,项目名称:virus-one,代码行数:4,代码来源:window.cpp


示例17: destroy

LightPassShader::~LightPassShader()
{
	destroy();
}
开发者ID:hudovisk,项目名称:MyGE,代码行数:4,代码来源:LightPassShader.cpp


示例18: destroy

/*
 *  Destroys the object and frees any allocated resources
 */
CQOptimizationWidget::~CQOptimizationWidget()
{
  destroy();
  // no need to delete child widgets, Qt does it all for us
}
开发者ID:PriKalra,项目名称:COPASI,代码行数:8,代码来源:CQOptimizationWidget.cpp


示例19: main

void main()
{
	link_list mylist;

	init_list(&mylist);

	int select = 1;
	elem_type item;
	node *p = NULL;
	while(select)
	{
		printf("*************************************************\n");
		printf("*  [1] push_back	 [2] push_front 	*\n");
		printf("*  [3] show_list	 [4] pop_back    	*\n");
		printf("*  [5] pop_front	 [6] insert_val 	*\n");
		printf("*  [7] find 	 	 [8] get_length 	*\n");
		printf("*  [9] delete_val	 [10] sort   	 	*\n");
		printf("*  [11] resever		 [12] clear 	 	*\n");
		printf("*  [13*] destroy	 [0] quit_system 	*\n");
		printf("*  [14] prior_node 	 [15] next_node 	*\n");
		printf("*************************************************\n");

		printf("请选择操作选项:> ");
		scanf("%d", &select);

		if(select == 0)
			break;

		switch(select)
		{
			case 1:
				printf("请输入要插入的数据(-1结束):>");
				while(scanf("%d", &item), item != -1)
				{
					push_back(&mylist, item);
				}
				break;
			case 2:
				printf("请输入要插入的数据(头插法, -1结束);>");
				while(scanf("%d", &item), item != -1)
				{
					push_front(&mylist, item);
				}
				break;
			case 3:
				show_list(&mylist);
				break;
			case 4:
				pop_back(&mylist);
				break;
			case 5:
				pop_front(&mylist);
				break;
			case 6:
				printf("请输入要插入的数据:>");
				scanf("%d", &item);
				insert_val(&mylist, item);
				break;
			case 7:
				printf("请输入要查找的数据:>");
				scanf("%d", &item);
				p = find(&mylist, item);
				if (p == NULL)
				{
					printf("要查找的数据在单链表中不存在.");
				}
				else
				 	printf("在单链表查找到数据: %d\n", p->data);
				break;
			case 8:
				printf("单链表的长度为: %d\n", get_length(&mylist));
				break;
			case 9:
				printf("请输入要删除的值:> ");
				scanf("%d", &item);
				delete_val(&mylist, item);
				break;
			case 10:
				sort(&mylist);
				break;
			case 11:
				resver(&mylist);
				break;
			case 12:
				clear(&mylist);
				break;
			case 14:
				printf("请输入要查找的数据:>");
				scanf("%d", &item);
				p = prior_node(&mylist, item);
				if (p == NULL || p == (&mylist)->head)
				{
					printf("要查找的数据在单链表中不存在前驱.\n");
				}
				else
				{
			 	 	printf("要查找的数据在单链表中的前驱为:%d.\n", p->data);	
				}
				break;
 	 	 	case 15:
//.........这里部分代码省略.........
开发者ID:qomolangmaice,项目名称:data.structures.algorithms,代码行数:101,代码来源:main.c


示例20: destroy

AlignedBlockAllocator::~AlignedBlockAllocator()
{
    destroy();
    m_chunk.Close();
    delete [] m_map.bits;
}
开发者ID:PioneerLab,项目名称:OpenAphid-AJ,代码行数:6,代码来源:BlockAllocatorSymbian.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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