本文整理汇总了C++中destroy函数的典型用法代码示例。如果您正苦于以下问题:C++ destroy函数的具体用法?C++ destroy怎么用?C++ destroy使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了destroy函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
inline LazyInit<T>::~LazyInit ()
{
if (_ptr != NULL) destroy();
}
示例2: destroy
UpdateComponent::~UpdateComponent()
{
destroy();
}
示例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);
//.........这里部分代码省略.........
示例5: destroy
ShaderObject::~ShaderObject()
{
destroy();
}
示例6: destroy
void CEffectManager::Reload()
{
destroy();
load(m_FileName);
}
示例7: destroy
PlayActionEffectComboInstance::~PlayActionEffectComboInstance()
{
DEC_NDOBJ_RTCLS;
destroy( true );
}
示例8: destroy
~vector() { destroy(vec_.start_, vec_.finish_); }
示例9: destroy
TextureManager::~TextureManager()
{
destroy();
}
示例10: toRenderBox
void InlineBox::deleteLine(RenderArena* arena)
{
if (!m_extracted && m_renderer->isBox())
toRenderBox(m_renderer)->setInlineBoxWrapper(0);
destroy(arena);
}
示例12: destroy
int LLL::destroy(void) {
return destroy(head);
}
示例13: destroy
void WSHttpBinding_USCOREINWNMasterServerAPIService::reset()
{ destroy();
soap_done(this);
soap_init(this);
WSHttpBinding_USCOREINWNMasterServerAPIService_init(SOAP_IO_DEFAULT, SOAP_IO_DEFAULT);
}
示例15: destroy
xhn::context::~context()
{
destroy();
}