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

C++ processData函数代码示例

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

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



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

示例1: processData

void Fight::slot_animateFighting()
{
	attalFightData dataFight;

	if( !_attData->isEmpty() ) {
		if(  !_animatedUnit || !_animatedUnit->isMoving() ) { 
			dataFight = _attData->first();
			processData( dataFight );
			_attData->removeFirst();
		}
		if(  _animatedUnit && _animatedUnit->isMoving() ) {
			dataFight = _attData->first();
			while(( _animatedUnit == dataFight.unit && dataFight.dataType == FIGHT_DATA_MOVE ) ) {
				processData( dataFight );
				_attData->removeFirst();
				dataFight = _attData->first();
			}
		}
	} else {
		_animatedUnit = NULL;
	}

	checkTimer();

}
开发者ID:q4a,项目名称:attal,代码行数:25,代码来源:fight.cpp


示例2: DCHECK

void DocumentLoader::dataReceived(Resource* resource,
                                  const char* data,
                                  size_t length) {
  DCHECK(data);
  DCHECK(length);
  DCHECK_EQ(resource, m_mainResource);
  DCHECK(!m_response.isNull());
  DCHECK(!m_frame->page()->defersLoading());

  if (m_inDataReceived) {
    // If this function is reentered, defer processing of the additional data to
    // the top-level invocation. Reentrant calls can occur because of web
    // platform (mis-)features that require running a nested message loop:
    // - alert(), confirm(), prompt()
    // - Detach of plugin elements.
    // - Synchronous XMLHTTPRequest
    m_dataBuffer->append(data, length);
    return;
  }

  AutoReset<bool> reentrancyProtector(&m_inDataReceived, true);
  processData(data, length);

  // Process data received in reentrant invocations. Note that the invocations
  // of processData() may queue more data in reentrant invocations, so iterate
  // until it's empty.
  const char* segment;
  size_t pos = 0;
  while (size_t length = m_dataBuffer->getSomeData(segment, pos)) {
    processData(segment, length);
    pos += length;
  }
  // All data has been consumed, so flush the buffer.
  m_dataBuffer->clear();
}
开发者ID:ollie314,项目名称:chromium,代码行数:35,代码来源:DocumentLoader.cpp


示例3: qDebug

void SignalProcessor::input(double red, double green, double blue) {
	qDebug() << "SignalProcessor: set Input" << red << green << blue;

	processData(dataRedIn, dataRedOut, red);
	processData(dataGreenIn, dataGreenOut, green);
	processData(dataBlueIn, dataBlueOut, blue);

	emit output(dataRedOut->last(), dataGreenOut->last(), dataBlueOut->last());
	qDebug() << "SignalProcessor: output " << dataRedOut->last() << dataGreenOut->last() << dataBlueOut->last();
}
开发者ID:wbt729,项目名称:pure,代码行数:10,代码来源:signalprocessor.cpp


示例4: while

//***********************************************************
//* Process a <noteresource> node.
//***********************************************************
void ImportEnex::processResource(Resource &resource) {
    bool atEnd = false;

    resource.active = true;

    while(!atEnd) {
        if (reader->isStartElement()) {
            QString name = reader->name().toString().toLower();
            QUuid uuid;
            QString g =  uuid.createUuid().toString().replace("{","").replace("}","");
            resource.guid = g;
            if (name == "active") {
                resource.active =  booleanValue();
            }
            if (name == "mime") {
                resource.mime = textValue();
            }
            if (name == "duration") {
                resource.duration = shortValue();
            }
            if (name == "height") {
                resource.height = shortValue();
            }
            if (name == "width") {
                resource.width = shortValue();
            }
            if (name == "data") {
                Data d;
                resource.data = d;
                processData("Data", resource.data);
            }
            if (name == "alternate-data") {
                Data d;
                resource.alternateData = d;
                processData("AlternateData", resource.data);
            }
            if (name == "recognition-data") {
                Data d;
                resource.recognition = d;
                processData("RecognitionData", resource.recognition);
            }
            if (name == "resource-attributes") {
                ResourceAttributes ra;
                resource.attributes = ra;
                processResourceAttributes(resource.attributes);
            }
        }
        reader->readNext();
        QString endName = reader->name().toString().toLower();
        if (endName == "resource" && reader->isEndElement())
            atEnd = true;
    }
}
开发者ID:AustinPowered,项目名称:Nixnote2,代码行数:56,代码来源:importenex.cpp


示例5: TcpConThread

void TcpSockServer::incomingConnection(int socketDescriptor)
{
    qRegisterMetaType <Qlist>("Qlist");

   // qDebug() << QString("Client %1 Comming").arg(socketDescriptor);
    TcpConThread *thread = new TcpConThread(socketDescriptor, this);
//    connect(thread, SIGNAL(finished()), thread, SLOT(deleteLater()));
    connect(this,SIGNAL(sendKeySettingRequest(Device,RegOperation)),
            thread,SLOT(sendKeySettingRequest(Device,RegOperation)));
    connect(this,SIGNAL(grabWindow()),thread,SLOT(sendGrabWindowRequest()));
    connect(thread,SIGNAL(processData(Qlist)),
            this,SIGNAL(processData(Qlist)));
    thread->start();
}
开发者ID:ZheYang,项目名称:anti-cheat,代码行数:14,代码来源:tcpsockserver.cpp


示例6: processData

void SAXMzxmlHandler::endElement(const XML_Char *el)
{
	if(isElement("peaks", el))
	{
		processData();
		m_bInPeaks = false;
	}
	else if(isElement("precursorMz", el))
	{
		processData();
		m_bInPrecursorMz = false;
	}
	else if(isElement("scan", el) && m_bInMsLevel2 == true)
	{
		// only add a spectrum without charge (which will lead
		// to internal xtandem charge state guessing) if there
		// were no values parsed from *both* "precursorCharge"
		// or "possibleCharges"
		if ( (m_precursorCharge == 0) && (m_viPossiblePrecursorCharges.size() == 0) ) {
		  // add spectrum, with precursorMz charge
		  pushSpectrum();
		}
		
		else {

		  // add the spectrum with the m_precursorCharge value
		  int originalPrecursorMZ = m_precursorCharge; // do other pushSpectrum calls change this?
		  pushSpectrum(m_precursorCharge);
		  
		  // are there any multiple precursor charges from mzXML 3.1's
		  // possibleCharges?
		  if (m_viPossiblePrecursorCharges.size() > 0) {
		    size_t originalId = m_tId;
		    for (vector<int>::iterator i = m_viPossiblePrecursorCharges.begin();
			 i != m_viPossiblePrecursorCharges.end();
			 ++i) {
		      int z = *i;
		      if (z != originalPrecursorMZ) { // no need to duplicate if already added
			m_tId += 100000000;
			pushSpectrum(z);
		      }
		    }
		    m_tId = originalId;
		  }
		}

		m_bInMsLevel2 = false;
	}
}
开发者ID:bspratt,项目名称:xtandem-g,代码行数:49,代码来源:saxmzxmlhandler.cpp


示例7: xmlReaderForFile

int cDataMap::read_xml_file(string incdir)
{
	xmlTextReaderPtr reader;
    int ret;
	string genre = incdir + "genre.xml" ;
    string category = incdir + "category.xml" ;

	// read categories and genre into ONE map. They don't share id's (Logic genre div 100 = category, genre is never full 100)

	// categories
    reader = xmlReaderForFile(category.c_str(), "iso-8859-1" , XML_PARSE_NOENT | XML_PARSE_DTDLOAD);
    if (reader != NULL) {
        ret = xmlTextReaderRead(reader);
        while (ret == 1) {
            processData(reader);
            ret = xmlTextReaderRead(reader);
        }
        xmlFreeTextReader(reader);

        if (ret != 0) {
			fprintf(stderr, "epgdata2vdr : failed to parse %s\n", category.c_str() );
			return ret;
		}
    }
	else {
		fprintf(stderr, "Unable to open %s\n", category.c_str());
		return -1;
	}

	// genres
	reader = xmlReaderForFile(genre.c_str(), "iso-8859-1" , XML_PARSE_NOENT | XML_PARSE_DTDLOAD);
    if (reader != NULL) {
        ret = xmlTextReaderRead(reader);
        while (ret == 1) {
            processData(reader);
            ret = xmlTextReaderRead(reader);
        }
        xmlFreeTextReader(reader);
        if (ret != 0) {
			fprintf(stderr, "Failed to parse %s.\n", genre.c_str());
			return ret;
		}
    }
	else {
		fprintf(stderr, "Unable to open %s\n", genre.c_str());
		return -1;
	}
	return 0;
}
开发者ID:yavdr,项目名称:vdr-addon-epgdata2vdr,代码行数:49,代码来源:datamap.c


示例8: main

/*** FUNCTION CODE ***/
int main(int argc, char *argv[]) {
    //Setup Signal handler and atexit functions
	signal(SIGINT, INThandler);                     //Interrupts (calls INThandler) when Ctrl+c (?)
    COM1 = open_serialport("/dev/ttyUSB0",500000); //Open USB port
    Time_struct Curr_time;                          //Create time structure
    Curr_time = get_time();                         //Fill it with current time
    char fname[26];                                 //Create space for filename
    sprintf(fname, "%d-%d-%d-%d:%d:%d:%d.csv", Curr_time.year, Curr_time.month, Curr_time.day, Curr_time.hour, Curr_time.minute, Curr_time.second, Curr_time.msecond); //Create filename (date, time)
    fp = fopen(fname,"w");                          //Open file
    struct sockaddr_in outsock;
    int s_out_sensordata, slen = sizeof(struct sockaddr_in);
    initClientSocket(IMU_PORT, &s_out_sensordata, OPC_IP, &outsock);
    //initClientSocket(65100, &s_out_sensordata, "10.0.0.10", &outsock); //fakeclient
    sensor_data data;
    initBuffer();
    while(running) {
        data = receiveSensorData();
        writeToBuffer(&data);
        if (processData(&data))
            sendSensorData(&data, s_out_sensordata, outsock, slen);
    }
    //At end by Ctrl+c
    printf("Fin\n");
    fclose(fp);                                     //Close file
    return 0;
}
开发者ID:WheelLoaderTeam,项目名称:wheelloaderproject,代码行数:27,代码来源:main.c


示例9: generateCacheKey

void GrooveRequest::post()
{
    QString cacheKey = generateCacheKey();

    if (cacheKey.length()) {
        qDebug() << Q_FUNC_INFO << "Possibly cached request";
        QString cachePath = QDesktopServices::storageLocation(QDesktopServices::CacheLocation) + "/libgroove/cache/api/" + cacheKey;
        QFile cacheFile(cachePath);
        if (cacheFile.open(QIODevice::ReadOnly)) {
            qDebug() << Q_FUNC_INFO << "Definitely cached request";
            QByteArray response = cacheFile.readAll();
            processData(response);
            return;
        }
    }

    m_request.setHeader(m_request.ContentTypeHeader, "application/json");

    QJson::Serializer serializer;

    qDebug() << Q_FUNC_INFO << "Posting to: " << m_request.url();
    qDebug() << Q_FUNC_INFO << serializer.serialize(buildRequest());

    QNetworkReply *reply = m_client->networkManager()->post(m_request, serializer.serialize(buildRequest()));
    connect(reply, SIGNAL(error(QNetworkReply::NetworkError)), SIGNAL(error(QNetworkReply::NetworkError)));
    connect(reply, SIGNAL(finished()), SLOT(onFinished()));
}
开发者ID:dotblank,项目名称:libgroove,代码行数:27,代码来源:grooverequest.cpp


示例10: processResData_ByRotID

	void processResData_ByRotID( const std::string& resName, ContainerType& data, RotamerLibrary& _RotLib )
	{
		// Sort the data to increase efficiency below
		std::stable_sort( data.begin(), data.end(), sortPsi);
		std::stable_sort( data.begin(), data.end(), sortPhi);		
		std::stable_sort( data.begin(), data.end(), sortRotID);

		ContainerType subdata;
		
		while( true )
		{
			if( data.size() > 0 && (subdata.size() == 0 || subdata[0].rotID.compare( data.back().rotID,0,4,0 )) )
			{
				subdata.push_back( data.back() );
				data.erase(data.end()-1); // rob the end, not the start (ContainerType<> perfomance reasons!)
			}
			else
			{
				ASSERT( data.size() == (36*36), ParseException, "Assumption error!");
				ASSERT( data[0].phi == -180.0 && data[0].psi == -180.0, ParseException, "Wrong phi/psi");
				for( size_t j = 1; j < data.size(); j++ )
				{	
					ASSERT( data[j].phi == (-180.0+(j/36)*10) && data[j].psi == (-180.0+(j%36)*10), ParseException, "Wrong phi/psi");			
				}
				processData( resName, subdata, _RotLib, 40.0 ); // 40 degree tollerance delta from data[0]
				subdata.clear();
				if( data.size() == 0 )
				{
					return;
				}
			}
		}		
	}
开发者ID:JonnyWideFoot,项目名称:pd,代码行数:33,代码来源:rotamer_dunbrack.cpp


示例11: ReadFile

    void NewSerialPort::read(std::vector<char>& aDataBuffer,
                             size_t aNumOfBytesToRead)
    {
#if _WIN32
        size_t numBytesRead = 0;

        aDataBuffer.clear();
        aDataBuffer.assign(aNumOfBytesToRead, '\0');

		BOOL result = ReadFile(
            m_serialPortHandle,
            aDataBuffer.data(),
            aNumOfBytesToRead,
            reinterpret_cast<LPDWORD>(&numBytesRead),
            NULL);

		DWORD error = GetLastError();

        if (!result && GetLastError() != ERROR_IO_PENDING)
        {
            throw unknown_error();
        }
        else if (numBytesRead > 0)
        {
            // For an accurate reading of how many bytes were actually read
            aDataBuffer.resize(numBytesRead);
            storeReadData(aDataBuffer);
			processData();
        }

#endif
    }
开发者ID:Space-at-VT,项目名称:CSACS,代码行数:32,代码来源:newserialport.cpp


示例12: switch

void
WorkerTask::handleMsg(Msg *msg)
{
	// flush any irrelevant messages
	if (msg->getActivityId() != activityId)
		return;

	switch (msg->getCode()) {
	case DfbProcess:
		// perform a DFB/channelization
		lock();
		processData(msg);
		unlock();
		break;
	case DATA_COLLECTION_COMPLETE:
		// all channels are done, time to go
		lock();
		spectrometer->stopSpectrometry(activity);
		activity = 0;
		activityId = -1;
		unlock();
		break;
	case STOP_DX_ACTIVITY:
	case SHUTDOWN_DX:
	case RESTART_DX:
		lock();
		stopActivity(msg);
		unlock();
		terminate();
		break;
	default:
		Fatal(ERR_IMT);
		break;
	}
}
开发者ID:Abhishekpatil,项目名称:SonATA,代码行数:35,代码来源:WorkerTask.cpp


示例13: main

int main(void){
	
	DDRC = 0x00;	
		
	uart_init( UART_BAUD_SELECT(UART_BAUD_RATE,F_CPU) );
	sei();
	unsigned int c;
	while(1){
		c = uart_getc();
		if(c & UART_NO_DATA){
				/*
			 	* NO UART DATA available
			 	*/
		}
		else{
				/*
				 *  New Data is avialable at the port.
				 *  check the frame for overrun errro
				 */
				if ( c & UART_FRAME_ERROR ){

	   					/* Framing Error detected, i.e no stop bit detected */
						uart_puts_P("UART Frame Error: ");
				}	
				if ( c & UART_OVERRUN_ERROR ){			
	
						/* 
						 *
						 * Overrun, a character already present in the UART UDR register was 
				 		 *
						 * not read by the interrupt handler before the next character arrived,
						 * one or more received characters have been dropped
				  		 *	
				 		 *                                                                  
						 */

						uart_puts_P("UART Overrun Error: ");
		
				}

				if ( c & UART_BUFFER_OVERFLOW ){

						/* 
						 *
					 	 * We are not reading the receive buffer fast enough,
						 *
						 * one or more received character have been dropped 
					 	 *
					 	 */

						uart_puts_P("Buffer overflow error: ");

				}

				processData(c);
			//	PORTC = c;
		}
	}
	return 0;
}
开发者ID:nileshkulkarni,项目名称:AUV_UART_AVR,代码行数:60,代码来源:motion_controller.c


示例14: while

void AudioCapture::run()
{
    m_userStop = false;

    while (!m_userStop)
    {
        m_mutex.lock();
        if (m_pause == false && m_captureSize != 0)
        {
            if (readAudio(m_captureSize) == true)
            {
                processData();
            }
            else
            {
                //qDebug() << "Error reading data from audio source";
                usleep(5000);
            }

        }
        else
            usleep(15000);
        m_mutex.unlock();
    }
}
开发者ID:ChrisLaurie,项目名称:qlcplus,代码行数:25,代码来源:audiocapture.cpp


示例15: WGetEditMenuTitle

static WMPropList *processSubmenu(WEditMenu * menu)
{
	WEditMenuItem *item;
	WMPropList *pmenu;
	WMPropList *pl;
	char *s;
	int i;

	s = WGetEditMenuTitle(menu);
	pl = WMCreatePLString(s);

	pmenu = WMCreatePLArray(pl, NULL);

	i = 0;
	while ((item = WGetEditMenuItem(menu, i++))) {
		WEditMenu *submenu;

		s = WGetEditMenuItemTitle(item);

		submenu = WGetEditMenuSubmenu(item);
		if (submenu) {
			pl = processSubmenu(submenu);
		} else {
			pl = processData(s, WGetEditMenuItemData(item));
		}

		if (!pl)
			continue;

		WMAddToPLArray(pmenu, pl);
	}

	return pmenu;
}
开发者ID:awmaker,项目名称:awmaker,代码行数:34,代码来源:Menu.c


示例16: Q_ASSERT

bool ValveRuntimeBox::setValve(int)
{
    Q_ASSERT(m_valve.outputPort()->state().hasData());
    m_valveOpen = m_valve.data().data()[0] != 0;
    m_hasValve = true;
    return processData();
}
开发者ID:deadmorous,项目名称:equares,代码行数:7,代码来源:ValveBox.cpp


示例17: input

void shakeData::loadSMC(string filename)
{
	file=filename;
	ifstream input(ofToDataPath(file).c_str());
	string buffer;
	sampFreq=200.;
	bool tagOpen=false;
	int pipeCount=0;
	vector<double> val;
	getline(input, buffer);
	while(buffer.length()&&(buffer[0]=='|'||pipeCount<4)){
		if(buffer.length()&&buffer[0]=='|') pipeCount++;
		getline(input, buffer);
	}
	while (input.peek()!=EOF) {
		getline(input, buffer);
		if(buffer.length()%10==0){
			for(int i=0; i<buffer.length()/10; i++){
				string num(buffer.begin()+10*i,buffer.begin()+10*i+10);
				//uData.push_back(dataPoint(ofToFloat(num),1/sampFreq));
				val.push_back(ofToFloat(num));
			}
		}
	}
	input.close();
	for(unsigned int i=0; i<val.size(); i++){
		uData.push_back(dataPoint(val[i],1/sampFreq));
	}
	processData();
}
开发者ID:d8062,项目名称:earthquakeTable,代码行数:30,代码来源:accParse.cpp


示例18: marker

void MJPEGImageGrabber::onReadyRead()
{
//    qDebug() << "got ready read";
    m_imageData.append(m_reply->readAll());
//    qDebug() << "number of bytes in imageData" << m_imageData.size();

    QByteArray marker(streamSperator, strlen(streamSperator));
//    qDebug() << "Marker " << marker;

    if (!m_imageStarted) {
        int index = m_imageData.indexOf(marker);
        if (index < 0) { // current data doesn't have a image start
//            qDebug() << "not started yet, leaving... looked for marker";
            m_imageData.clear();
            return;
        }
        m_imageStarted = true; //started
        m_imageData = m_imageData.mid(index+marker.length()); // discard data before the start
    }

    int index = m_imageData.indexOf(marker);

    if (index < 0) { // no end yet
//        qDebug() << "frame started but no end yet, leaving...";
        return;
    }

    // end reached, get the frame
//    qDebug() << "one frame complete, process it";
    QByteArray fullFrame = m_imageData.left(index);
    Q_EMIT processData(fullFrame);
    m_imageStarted = false;
    m_imageData = m_imageData.mid(index+marker.length()); // discard data upto the extracted frame
}
开发者ID:pritamghanghas,项目名称:picontrolclient,代码行数:34,代码来源:mjpegimagegrabber.cpp


示例19: processData

void VideoDecoder::update() {
	if (getTimeToNextFrame() > 0)
		return;

	processData();
	copyData();
}
开发者ID:jjardon,项目名称:eos,代码行数:7,代码来源:decoder.cpp


示例20: KVI_ASSERT

void KviHttpRequest::slotSocketReadDataReady()
{
	KVI_ASSERT(m_p->pSocket);

	int iBytes = m_p->pSocket->bytesAvailable();

	if(iBytes <= 0)
	{
		// assume connection closed ?
		slotSocketDisconnected();
		return;
	}

	// FIXME: Avoid double-buffering here!

	KviDataBuffer oBuffer(iBytes);

	int iRead = m_p->pSocket->read((char *)(oBuffer.data()),iBytes);
	if(iRead < iBytes)
	{
		// hum.... what here ?
		if(iRead < 1)
		{
			slotSocketDisconnected();
			return;
		}

		// FIXME
		// well... otherwise just wait.
		// FIXME ?
		oBuffer.resize(iRead);
	}

	processData(&oBuffer);
}
开发者ID:kartagis,项目名称:KVIrc,代码行数:35,代码来源:KviHttpRequest.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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