本文整理汇总了C++中processData函数的典型用法代码示例。如果您正苦于以下问题:C++ processData函数的具体用法?C++ processData怎么用?C++ processData使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了processData函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
}
示例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();
}
示例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();
}
示例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;
}
}
示例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();
}
示例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;
}
}
示例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;
}
示例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;
}
示例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()));
}
示例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;
}
}
}
}
示例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
}
示例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;
}
}
示例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;
}
示例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();
}
}
示例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;
}