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


C++ release函数代码示例

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


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

示例1: release

	DisplayObject::~DisplayObject()
	{
		if (_parent != 0) {
			release(_parent);
		}
	}
开发者ID:masiw,项目名称:masicore,代码行数:6,代码来源:DisplayObject.cpp

示例2: stop

Input::~Input() {
    stop();
    release();
    delete m_localFrame;
    delete m_listener;
}
开发者ID:fhs-company,项目名称:comet,代码行数:6,代码来源:input.cpp

示例3: release

QCLVectorBase::~QCLVectorBase()
{
    release();
}
开发者ID:radrad350,项目名称:QtOpenCL,代码行数:4,代码来源:qclvector.cpp

示例4: NEObject

	NE_DLL NEDebugManager::Flag::Flag()
		: NEObject()
	{
		release();
	}
开发者ID:kniz,项目名称:World,代码行数:5,代码来源:Flag.cpp

示例5: release

tupp::~tupp()		// destructor
{
    // release the pointer before deallocating the space for it
    release();
}
开发者ID:AlexPeng19,项目名称:incubator-trafodion,代码行数:5,代码来源:ExpSqlTupp.cpp

示例6: swrite

/* Return bytes written, negative on error */
int swrite(rd_t rd, char* s) {
    if (rd < 0 || rd >= RESOURCE_TABLE_SIZE) {
        return -1;
    }

    int n = 0; 

    if (task_switching) {
        acquire(curr_task->task->resources[rd]->sem);
        if (curr_task->task->resources[rd]->swriter) {
            int ret = curr_task->task->resources[rd]->swriter(s, curr_task->task->resources[rd]->env);
            if (ret >= 0) {
                n += ret;
            }
            else {
                n = ret;
            }
                
        }
        else {
            while(*s) {
                int ret = curr_task->task->resources[rd]->writer(*s++, curr_task->task->resources[rd]->env);
                if (ret >= 0) {
                    n += ret;
                }
                else {
                    n = ret;
                    break;
                }
            }
        }
        release(curr_task->task->resources[rd]->sem);
    }
    else {
        if(default_resources[rd] != NULL) {
            if (default_resources[rd]->swriter) {
                int ret = default_resources[rd]->swriter(s, default_resources[rd]->env);
                if (ret >= 0) {
                    n += ret;
                }
                else {
                    n = ret;
                }
            }
            else {
                while(*s) {
                    int ret = default_resources[rd]->writer(*s++, default_resources[rd]->env);
                    if (ret >= 0) {
                        n += ret;
                    }
                    else {
                        n = ret;
                        break;
                    }
                }
            }
        }
        else { 
            return -1;
        }
    }

    return n;
}
开发者ID:DuinoPilot,项目名称:F4OS,代码行数:65,代码来源:resource.c

示例7: release

 SDOXMLString::~SDOXMLString()
 {
     release();
 }
开发者ID:insidenothing,项目名称:SCA_SDO-1.2.4,代码行数:4,代码来源:SDOXMLString.cpp

示例8: memset

void* OPJSupport::decompressJPEG2KWithBuffer	( void* inputBuffer, void* jp2Data, long jp2DataSize, long *decompressedBufferSize, int *colorModel){
    opj_dparameters_t parameters;
	OPJ_BOOL hasFile = OPJ_FALSE;

	opj_buffer_info_t buf_info;
	int i, decod_format;
	int width, height;
	OPJ_BOOL hasAlpha, fails = OPJ_FALSE;
	OPJ_CODEC_FORMAT codec_format;
	unsigned char rc, gc, bc, ac;

	decode_info_t decodeInfo;


	memset(&decodeInfo, 0, sizeof(decode_info_t));
	memset(&buf_info, 0, sizeof(opj_buffer_info_t));

	if (jp2Data != NULL)
	{
		buf_info.len = jp2DataSize;
		buf_info.buf =  (OPJ_BYTE*)jp2Data;
		buf_info.cur = buf_info.buf;
	}


	opj_set_default_decoder_parameters(&parameters);
	decod_format = buffer_format(&buf_info);

	if(decod_format == -1)
	{
		fprintf(stderr,"%s:%d: decode format missing\n",__FILE__,__LINE__);
		release(&decodeInfo);
		return 0;
	}

	/*-----------------------------------------------*/
	if(decod_format == J2K_CFMT)
		codec_format = OPJ_CODEC_J2K;
	else
		if(decod_format == JP2_CFMT)
			codec_format = OPJ_CODEC_JP2;
		else
			if(decod_format == JPT_CFMT)
				codec_format = OPJ_CODEC_JPT;
			else
			{
				/* clarified in infile_format() : */
				release(&decodeInfo);
				return 0;
			}
    parameters.decod_format = decod_format;
    while(1)
    {
	int tile_index=-1, user_changed_tile=0, user_changed_reduction=0;
	int max_tiles=0, max_reduction=0;
	fails = OPJ_TRUE;
	decodeInfo.stream =  opj_stream_create_buffer_stream(&buf_info, 1);


	if(decodeInfo.stream == NULL)
	{
	    fprintf(stderr,"%s:%d: NO decodeInfo.stream\n",__FILE__,__LINE__);
	    break;
	}
	decodeInfo.codec = opj_create_decompress(codec_format);
	if(decodeInfo.codec == NULL)
	{
	    fprintf(stderr,"%s:%d: NO coded\n",__FILE__,__LINE__);
	    break;
	}

      //  opj_set_info_handler(decodeInfo.codec, error_callback, this);
      //  opj_set_info_handler(decodeInfo.codec, warning_callback, this);
      //  opj_set_info_handler(decodeInfo.codec, info_callback, this);

	if( !opj_setup_decoder(decodeInfo.codec, &parameters))
	{
	    fprintf(stderr,"%s:%d:\n\topj_setup_decoder failed\n",__FILE__,__LINE__);
	    break;
	}

	if(user_changed_tile && user_changed_reduction)
	{
	    int reduction=0;
	    opj_set_decoded_resolution_factor(decodeInfo.codec, reduction);
	}

	if( !opj_read_header(decodeInfo.stream, decodeInfo.codec, &decodeInfo.image))
	{
	    fprintf(stderr,"%s:%d:\n\topj_read_header failed\n",__FILE__,__LINE__);
	    break;
	}

	if( !(user_changed_tile && user_changed_reduction)
	   || (max_tiles <= 0) || (max_reduction <= 0) )
	{
	    opj_codestream_info_v2_t *cstr;

	    cstr = opj_get_cstr_info(decodeInfo.codec);

//.........这里部分代码省略.........
开发者ID:zyinventory,项目名称:simple-ris,代码行数:101,代码来源:OPJSupport.cpp

示例9: run

void run(void)
{
	data='w';
	while(1)
	{
		while(data == 'w') //waiting for signal
		{	
		}
		while(data == '\0' )
		{
			stop();
			_delay_ms(4000);
			comintersection();
			_delay_ms(100);
		}
		if(data=='f') // forward
		{
			data='\0';
		}
		if(data=='r') // right	
		{
			data='\0';
			turn_right();
		}
		if(data=='l') // left
		{
			data='\0';
			turn_left();
		} 
		if(data == 'h') // halt
		{
			data='\0';
			stop();
			_delay_ms(100);
			continue;
		
		}
		if(data == 'o') // origin
		{
			data='w';
			stop();
			_delay_ms(100);
			continue;
		}
		if(data == 'c') //collect item data -> i when the bot is trying to pick up an rfid
		{
			data='w';
			arm_down();
			_delay_ms(2700);
			stop_arm();
			_delay_ms(2000);
	       	grab();
			arm_up();
		    _delay_ms(3100);
		    stop_arm();
		    _delay_ms(2000);
			lcd_cursor(2,1);
			lcd_string("Collecting");
			_delay_ms(3500);
			readrfidtag();	
			clearrfid();     
			continue;   
			
		}
		if(data == 'd') //drop_item
		{
			data='w';
			go_down();
			release();
	        go_up();
			lcd_cursor(2,1);
			lcd_string("Dropping");
			_delay_ms(3500);
			senddroppedsig();
			continue;
		}
		
		while(1) 
		{
			if(move_bot() == 1)
			{
				continue;
			}
			else 
			{
				break;
			}
		}
	}
}
开发者ID:E-yantra,项目名称:The_Hilfskraft_Roboter,代码行数:90,代码来源:whitelinemovement.c

示例10: release

 port& operator= (port&& rhs) {
     if (this != &rhs) {
         release(); m_blob = rhs.m_blob; rhs.m_blob = nullptr;
     }
     return *this;
 }
开发者ID:saleyn,项目名称:eixx,代码行数:6,代码来源:port.hpp

示例11: main


//.........这里部分代码省略.........
	    fflush(NULL);

	    /* Create a pipe to serve as an error indicator. */
	    if (pipe(pfd) < 0) {
		report("pipe");
		goto bad;
	    }
	    (void) fcntl(pfd[1], F_SETFD,
		    fcntl(pfd[1], F_GETFD) | FD_CLOEXEC);

	    /* Fork and exec. */
	    switch (fork()) {
	    case -1:
		report("fork");
		close(pfd[0]);
		close(pfd[1]);
		goto bad;
	    case 0:
		close(tcp_fd);
		close(pfd[0]);
#if PARANOID
		/* Check if access to this service allowed. */
		if (ioctl(client_fd, NWIOGTCPCONF, &tcpconf) == 0
		    && tcpconf.nwtc_remaddr != tcpconf.nwtc_locaddr
		    && !servxcheck(tcpconf.nwtc_remaddr, argv[1], NULL)
		) {
		    exit(1);
		}
#endif
		sigprocmask(SIG_SETMASK, &oldmask, NULL);
		dup2(client_fd, 0);
		dup2(client_fd, 1);
		close(client_fd);
		execvp(progv[0], progv);
		report(progv[0]);
		write(pfd[1], &errno, sizeof(errno));
		exit(1);
	    default:
		nchildren++;
		release(&client_fd);
		close(pfd[1]);
		r= read(pfd[0], &errno, sizeof(errno));
		close(pfd[0]);
		if (r != 0) goto bad;
		break;
	    }
	}

	while (nchildren >= max_children) {
	    /* Too many clients, wait for one to die off. */
	    sigsuspend(&chldunmask);
	}

	/* Wait for a new connection. */
	sigprocmask(SIG_UNBLOCK, &chldmask, NULL);

	tcplistenopt.nwtcl_flags= 0;
	while (ioctl(tcp_fd, NWIOTCPLISTEN, &tcplistenopt) < 0) {
	    if (errno != EINTR) {
		if (errno != EAGAIN || debug) {
		    report("Unable to listen");
		}
		goto bad;
	    }
	}
	sigprocmask(SIG_BLOCK, &chldmask, NULL);

	/* We got a connection. */
	client_fd= tcp_fd;
	tcp_fd= -1;

	if (debug && ioctl(client_fd, NWIOGTCPCONF, &tcpconf) == 0) {
	    fprintf(stderr, "%s %s: Connection from %s:%u\n",
		arg0, service,
		inet_ntoa(tcpconf.nwtc_remaddr),
		ntohs(tcpconf.nwtc_remport));
	}
	/* All is well, no need to stall. */
	stall= 0;
	continue;

    bad:
	/* All is not well, release resources. */
	release(&tcp_fd);
	release(&client_fd);

	/* Wait a bit if this happens more than once. */
	if (stall != 0) {
	    if (debug) {
		fprintf(stderr, "%s %s: stalling %u second%s\n",
		    arg0, service,
		    stall, stall == 1 ? "" : "s");
	    }
	    sleep(stall);
	    stall <<= 1;
	} else {
	    stall= 1;
	}
    }
}
开发者ID:BiancoZandbergen,项目名称:RTMINIX3,代码行数:101,代码来源:tcpd.c

示例12: release

_XEngineLogo::~_XEngineLogo()
{
    release();
}
开发者ID:QiangJi,项目名称:XEffect2D,代码行数:4,代码来源:XEngineLogo.cpp

示例13: release

SSLContext::~SSLContext()
{
    release();
}
开发者ID:ewwink,项目名称:openlitespeed,代码行数:4,代码来源:sslcontext.cpp

示例14: release

void
ScopedCancelHandle::cancel()
{
  release().cancel();
}
开发者ID:named-data,项目名称:ndn-cxx,代码行数:5,代码来源:cancel-handle.cpp

示例15: close

WBaseStream::~WBaseStream() {
    close();
    release();
}
开发者ID:353,项目名称:viewercv,代码行数:4,代码来源:bitstrm.cpp


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