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


C++ destroy函数代码示例

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


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


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