您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ synchronize函数代码示例

51自学网 2021-06-03 08:36:39
  C++
这篇教程C++ synchronize函数代码示例写得很实用,希望能帮到您。

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

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

示例1: caseBranch

void caseBranch (CaseItemPtr& caseItemHead, CaseItemPtr& caseItemTail, long& caseLabelCount, TypePtr expressionType) {	//static CaseItemPtr oldCaseItemTail = NULL;	CaseItemPtr oldCaseItemTail = caseItemTail;	bool anotherLabel;	do {		TypePtr labelType = caseLabel(caseItemHead, caseItemTail, caseLabelCount);		if (expressionType != labelType)			syntaxError(ABL_ERR_SYNTAX_INCOMPATIBLE_TYPES);		getToken();		if (curToken == TKN_COMMA) {			getToken();			if (tokenIn(CaseLabelStartList))				anotherLabel = true;			else {				syntaxError(ABL_ERR_SYNTAX_MISSING_CONSTANT);				anotherLabel = false;			}			}		else			anotherLabel = false;	} while (anotherLabel);	//--------------	// Error sync...	synchronize(FollowCaseLabelList, statementStartList, NULL);	ifTokenGetElseError(TKN_COLON, ABL_ERR_SYNTAX_MISSING_COLON);	//-----------------------------------------------------------------	// Fill in the branch location for each CaseItem for this branch...	CaseItemPtr caseItem = (!oldCaseItemTail ? caseItemHead : oldCaseItemTail->next);	//oldCaseItemTail = CaseItemTail;	while (caseItem) {		caseItem->branchLocation = codeBufferPtr;		caseItem = caseItem->next;	}	if (curToken != TKN_END_CASE)		do {			statement();			while (curToken == TKN_SEMICOLON)				getToken();			if (curToken == TKN_END_CASE)				break;		} while (tokenIn(statementStartList));	ifTokenGetElseError(TKN_END_CASE, ABL_ERR_SYNTAX_MISSING_END_CASE);	ifTokenGetElseError(TKN_SEMICOLON, ABL_ERR_SYNTAX_MISSING_SEMICOLON);}
开发者ID:Ariemeth,项目名称:MechCommander2HD,代码行数:51,


示例2: get

    T& get (const std::string& filename, int type) {        Synchronizable::lock_holder hnd(synchronize());        if (assets.count(type) == 0) {            gdx_cpp::Gdx::app->error("AssetManager.hpp", "Asset '%s' not loaded", filename.c_str());        }        const AssetMap& assetsByType = assets[type];        assert(assetsByType.count(filename));//         assetsByType[filename];//         T& asset = (T&) *();//         return asset;    }
开发者ID:ozires,项目名称:libgdx-cpp,代码行数:14,


示例3: reporter_spawn

/* * This function is called only when the reporter thread * This function is the loop that the reporter thread processes */void reporter_spawn( thread_Settings *thread ) {    do {        // This section allows for safe exiting with Ctrl-C        Condition_Lock ( ReportCond );        if ( ReportRoot == NULL ) {            // Allow main thread to exit if Ctrl-C is received            thread_setignore();            Condition_Wait ( &ReportCond );            // Stop main thread from exiting until done with all reports            thread_unsetignore();        }        Condition_Unlock ( ReportCond );again:        if ( ReportRoot != NULL ) {            ReportHeader *temp = ReportRoot;            //Condition_Unlock ( ReportCond );            if(temp->report.mThreadMode == kMode_Client){            	synchronize();            }            if ( reporter_process_report ( temp ) ) {                // This section allows for more reports to be added while                // the reporter is processing reports without needing to                // stop the reporter or immediately notify it                Condition_Lock ( ReportCond );                if ( temp == ReportRoot ) {                    // no new reports                    ReportRoot = temp->next;                } else {                    // new reports added                    ReportHeader *itr = ReportRoot;                    while ( itr->next != temp ) {                        itr = itr->next;                    }                    itr->next = temp->next;                }                // finished with report so free it                free( temp );                Condition_Unlock ( ReportCond );                Condition_Signal( &ReportDoneCond );                if (ReportRoot)                    goto again;            }            Condition_Signal( &ReportDoneCond );            usleep(10000);        } else {            //Condition_Unlock ( ReportCond );        }    } while ( 1 );}
开发者ID:AbderrahmaneLaribi,项目名称:iperf2,代码行数:54,


示例4: Client

ClipboardMonitor::ClipboardMonitor(int &argc, char **argv)    : Client()    , App(createPlatformNativeInterface()->createMonitorApplication(argc, argv))    , m_formats()    , m_newdata()    , m_updateTimer( new QTimer(this) )    , m_needCheckClipboard(false)#ifdef COPYQ_WS_X11    , m_needCheckSelection(false)    , m_x11(new PrivateX11)#endif#ifdef Q_OS_MAC    , m_prevChangeCount(0)    , m_clipboardCheckTimer(new MacTimer(this))    , m_macPlatform(new MacPlatform())#endif{    Q_ASSERT(argc == 3);    const QString serverName( QString::fromUtf8(argv[2]) );#ifdef HAS_TESTS    if ( serverName == QString("copyq_TEST") )        QCoreApplication::instance()->setProperty("CopyQ_testing", true);#endif    m_updateTimer->setSingleShot(true);    m_updateTimer->setInterval(300);    connect( m_updateTimer, SIGNAL(timeout()),             this, SLOT(updateTimeout()));#ifdef COPYQ_WS_X11    connect( &m_x11->incompleteSelectionTimer(), SIGNAL(timeout()),             this, SLOT(updateSelection()) );    connect( &m_x11->syncTimer(), SIGNAL(timeout()),             this, SLOT(synchronize()) );    connect( &m_x11->resetClipboardTimer(), SIGNAL(timeout()),             this, SLOT(resetClipboard()) );#endif#ifdef Q_OS_MAC    m_clipboardCheckTimer->setInterval(250);    m_clipboardCheckTimer->setTolerance(500);    connect(m_clipboardCheckTimer, SIGNAL(timeout()), this, SLOT(clipboardTimeout()));    m_clipboardCheckTimer->start();#endif    Arguments arguments(argc, argv);    if ( !startClientSocket(serverName, arguments) )        exit(1);}
开发者ID:lmbrt,项目名称:CopyQ,代码行数:50,


示例5: main

main(int argc,char **argv){		unsigned start,end,i;        printf(".4k8 -> .tap 1.0/n");        if (argc!=3) { printf("Usage: %s file.4k8 file.tap/n",argv[0]); exit(1);}	in=fopen(argv[1],"rb"); out=fopen(argv[2],"wb");	if (in==NULL || out==NULL) { printf("Unable to open file/n"); exit(1);}	synchronize();	sync_ok=1;        while (!feof(in)) putc(getbyte(),out);        fclose(in); fclose(out);	exit(0);}
开发者ID:Blonder,项目名称:oric-tools,代码行数:14,


示例6: if

void GeneOntology::call_RAY_SLAVE_MODE_ONTOLOGY_MAIN(){	if(!m_slaveStarted){		m_listedRelevantColors=false;		m_loadedAnnotations=false;		m_countOntologyTermsInGraph=false;		m_synced=false;		m_waitingForReply=false;		m_slaveStarted=true;	}else if(!m_listedRelevantColors){		fetchRelevantColors();	}else if(!m_loadedAnnotations){		loadAnnotations();		loadOntology(&m_identifiers,&m_descriptions);	}else if(!m_countOntologyTermsInGraph){		countOntologyTermsInGraph();	}else if(!m_synced){				synchronize();	}else{		if(m_rank==MASTER_RANK){			// busy wait for other to complete their tasks.			if(m_ranksSynchronized<m_size){				return;			}			cout<<"Rank "<<m_rank<<": synchronization is complete!"<<endl;			cout<<"Rank "<<m_rank<<": ontology terms with biological signal: "<<m_ontologyTermFrequencies.size()<<endl;			writeOntologyFiles();			writeTrees();		}		m_switchMan->closeSlaveModeLocally(m_outbox,m_rank);	}}
开发者ID:CharlesJB,项目名称:ray,代码行数:49,


示例7: append

AudioSettings::AudioSettings() {  frequencyLabel.setText("Frequency:");  frequency.append("32000hz");  frequency.append("44100hz");  frequency.append("48000hz");  frequency.append("96000hz");  latencyLabel.setText("Latency:");  latency.append("20ms");  latency.append("40ms");  latency.append("60ms");  latency.append("80ms");  latency.append("100ms");  resamplerLabel.setText("Resampler:");  resampler.append("Linear");  resampler.append("Hermite");  resampler.append("Sinc");  volume.name.setText("Volume:");  volume.slider.setLength(201);  append(controlLayout, {~0, 0}, 5);    controlLayout.append(frequencyLabel, {0, 0}, 5);    controlLayout.append(frequency, {~0, 0}, 5);    controlLayout.append(latencyLabel, {0, 0}, 5);    controlLayout.append(latency, {~0, 0}, 5);    controlLayout.append(resamplerLabel, {0, 0}, 5);    controlLayout.append(resampler, {~0, 0});  append(volume, {~0, 0});  switch(config->audio.frequency) { default:  case 32000: frequency.setSelection(0); break;  case 44100: frequency.setSelection(1); break;  case 48000: frequency.setSelection(2); break;  case 96000: frequency.setSelection(3); break;  }  switch(config->audio.latency) { default:  case  20: latency.setSelection(0); break;  case  40: latency.setSelection(1); break;  case  60: latency.setSelection(2); break;  case  80: latency.setSelection(3); break;  case 100: latency.setSelection(4); break;  }  resampler.setSelection(config->audio.resampler);  volume.slider.setPosition(config->audio.volume);  frequency.onChange = latency.onChange = resampler.onChange = volume.slider.onChange =  {&AudioSettings::synchronize, this};  synchronize();}
开发者ID:Electricstar,项目名称:bsnes-mercury,代码行数:49,


示例8: synchronize

unsigned long long FunctionalUnitManager::turnOn(const unsigned long &unitNumber, const unsigned long long &now){    synchronize(unitNumber, now);    if(functionalUnits[unitNumber].status==FUS_ON)        return 0;    else if(functionalUnits[unitNumber].status==FUS_OFF)    {        functionalUnits[unitNumber].transitionTime = now;        functionalUnits[unitNumber].nextClock=now+functionalUnits[unitNumber].onLatency;        functionalUnits[unitNumber].lastPeakPower = 0;        //do nothing with regards to power accum or timing    }    else if(functionalUnits[unitNumber].status==FUS_OFF_TRANSITION)    {        unsigned long long prevOnTime, chargedLatency;        double powerTotal, currentPower, powerNotConsumed, transitionPoint;        //Take total transition triangle power (or time since last transition)        prevOnTime = functionalUnits[unitNumber].nextClock - functionalUnits[unitNumber].transitionTime;        powerTotal =  .5 * functionalUnits[unitNumber].lastPeakPower * (double)prevOnTime; //1/2 base * height (fixed.. if there are two mid transitions in a row or something        //subtract smaller triangle        //Using parametrized line, figure out what instantateous power is        chargedLatency = now - functionalUnits[unitNumber].transitionTime;        currentPower = functionalUnits[unitNumber].onPower - (functionalUnits[unitNumber].onPower/((double)prevOnTime))*(double)((functionalUnits[unitNumber].offLatency - prevOnTime) + chargedLatency); //instantaneous Power        //Only add power that has been consumed        powerNotConsumed = .5 * currentPower * (double)(prevOnTime - chargedLatency);        //Subtract larger triangle from smaller one        functionalUnits[unitNumber].totalPower += (powerTotal - powerNotConsumed);        assert((powerTotal - powerNotConsumed) >= 0);        //calculate transition point, and new latency        transitionPoint = currentPower*((double)functionalUnits[unitNumber].onLatency/functionalUnits[unitNumber].onPower);        // FIXME: Currently suffers all the latency for turning off, though        // FIXED!!!        // it is not fully turned on.        functionalUnits[unitNumber].nextClock=now+(functionalUnits[unitNumber].onLatency - (unsigned long long)transitionPoint);        functionalUnits[unitNumber].transitionTime = now;        functionalUnits[unitNumber].lastPeakPower = currentPower;        assert(functionalUnits[unitNumber].nextClock > now);    }    functionalUnits[unitNumber].status=FUS_ON_TRANSITION;    return functionalUnits[unitNumber].nextClock;}
开发者ID:xjtunk,项目名称:llvm-power,代码行数:49,


示例9: sizeof

void Chatpad::init(HardwareSerial &serial, Chatpad::callback_t callback) {  _serial = &serial;  _callback = callback;  _last_modifiers = 0;  _last_key0 = 0;  _last_key1 = 0;  _last_ping = 0;  _serial->begin(19200);  _serial->write(kInitMessage, sizeof(kInitMessage));/* 28/06/2015 fdufnews * call synchronize to find header in data stream */  synchronize();  }
开发者ID:fdufnews,项目名称:Chatpad,代码行数:15,


示例10: synchronize

void oCourse::setStart(const string &start, bool sync){  if (getDI().setString("StartName", start)) {    if (sync)      synchronize();    oClassList::iterator it;    for (it=oe->Classes.begin();it!=oe->Classes.end();++it) {      if (it->getCourse()==this) {        it->setStart(start);        if (sync)          it->synchronize();      }    }  }}
开发者ID:ledusledus,项目名称:meos,代码行数:15,


示例11: setFileExtension

// Initialize this d classifier code documentvoid DClassifierCodeDocument::init(){    setFileExtension(QLatin1String(".d"));    //initCodeClassFields(); // this is dubious because it calls down to                             // CodeGenFactory::newCodeClassField(this)                             // but "this" is still in construction at that time.    classDeclCodeBlock = 0;    operationsBlock = 0;    constructorBlock = 0;    // this will call updateContent() as well as other things that sync our document.    synchronize();}
开发者ID:KDE,项目名称:umbrello,代码行数:16,


示例12: reply

bool QGalleryTrackerResultSetPrivate::parseRows(        const QDBusPendingCall &call, int limit, bool reset){    QDBusReply<QVector<QStringList> > reply(call);    typedef QVector<QStringList>::const_iterator iterator;    const QVector<QStringList> resultSet = reply.value();    QVector<QVariant> &values = iCache.values;    if (reset) {        values.clear();        iCache.count = 0;    }    iCache.count += resultSet.count();    values.reserve(iCache.count * tableWidth);    for (iterator it = resultSet.begin(), end = resultSet.end(); it != end; ++it) {        for (int i = 0, count = qMin(valueOffset, it->count()); i < count; ++i)            values.append(it->at(i));        for (int i = valueOffset, count = qMin(tableWidth, it->count()); i < count; ++i)            values.append(valueColumns.at(i - valueOffset)->toVariant(it->at(i)));        // The rows should all have a count equal to tableWidth, but check just in case.        for (int i = qMin(tableWidth, it->count()); i < tableWidth; ++i)            values.append(QVariant());    }    if (resultSet.count() <= limit) {        if (!values.isEmpty() && !sortCriteria.isEmpty()) {            correctRows(                    row_iterator(values.begin(), tableWidth),                    row_iterator(values.end(), tableWidth),                    sortCriteria.constBegin(),                    sortCriteria.constEnd());        }        synchronize();        return true;    } else {        return false;    }}
开发者ID:bavanisp,项目名称:qtmobility-1.1.0,代码行数:48,


示例13: synchronize

void DelayQueue::addEntry(DelayQueueEntry* newEntry) {  synchronize();  DelayQueueEntry* cur = head();  while (newEntry->fDeltaTimeRemaining >= cur->fDeltaTimeRemaining) {    newEntry->fDeltaTimeRemaining -= cur->fDeltaTimeRemaining;    cur = cur->fNext;  }  cur->fDeltaTimeRemaining -= newEntry->fDeltaTimeRemaining;  // Add "newEntry" to the queue, just before "cur":  newEntry->fNext = cur;  newEntry->fPrev = cur->fPrev;  cur->fPrev = newEntry->fPrev->fNext = newEntry;}
开发者ID:119,项目名称:dropcam_for_iphone,代码行数:16,


示例14: QObject

ClipboardMonitor::ClipboardMonitor(int &argc, char **argv)    : QObject()    , App(new QApplication(argc, argv))    , m_formats()    , m_newdata()#ifdef COPYQ_WS_X11    , m_copyclip(false)    , m_checksel(false)    , m_copysel(false)#endif    , m_socket( new QLocalSocket(this) )    , m_updateTimer( new QTimer(this) )    , m_needCheckClipboard(false)#ifdef COPYQ_WS_X11    , m_needCheckSelection(false)    , m_x11(new PrivateX11)#endif{    connect( m_socket, SIGNAL(readyRead()),             this, SLOT(readyRead()), Qt::DirectConnection );    connect( m_socket, SIGNAL(disconnected()),             QApplication::instance(), SLOT(quit()) );    QStringList args = QCoreApplication::instance()->arguments();    Q_ASSERT(args.size() == 3);    const QString &serverName = args[2];    COPYQ_LOG( QString("Connecting to server /"%1/".").arg(serverName) );    m_socket->connectToServer(serverName);    if ( !m_socket->waitForConnected(2000) ) {        log( tr("Cannot connect to server!"), LogError );        exit(1);    }    COPYQ_LOG("Connected to server.");    m_updateTimer->setSingleShot(true);    m_updateTimer->setInterval(300);    connect( m_updateTimer, SIGNAL(timeout()),             this, SLOT(updateTimeout()));#ifdef COPYQ_WS_X11    connect( &m_x11->timer(), SIGNAL(timeout()),             this, SLOT(updateSelection()) );    connect( &m_x11->syncTimer(), SIGNAL(timeout()),             this, SLOT(synchronize()) );#endif}
开发者ID:pmros,项目名称:CopyQ,代码行数:47,


示例15: muen_channel_read

enum muchannel_reader_result muen_channel_read(        const struct muchannel * const channel,        struct muchannel_reader *reader,        void *element){    uint64_t epoch, pos, wc, wsc;    enum muchannel_reader_result result;    if (muen_channel_is_active(channel)) {        if (reader->epoch == MUCHANNEL_NULL_EPOCH ||                has_epoch_changed(channel, reader))            return synchronize(channel, reader);        serialized_copy(&channel->hdr.wc, &wc);        if (reader->rc == wc)            result = MUCHANNEL_NO_DATA;        else if (wc - reader->rc > reader->elements)        {            result = MUCHANNEL_OVERRUN_DETECTED;        }        else        {            pos = reader->rc % reader->elements * reader->size;            memcpy(element, channel->data + pos, reader->size);            cc_barrier();            serialized_copy(&channel->hdr.wsc, &wsc);            if (wsc - reader->rc > reader->elements) {                result = MUCHANNEL_OVERRUN_DETECTED;            } else {                result = MUCHANNEL_SUCCESS;                reader->rc++;            }            if (has_epoch_changed(channel, reader)) {                result = MUCHANNEL_EPOCH_CHANGED;                epoch = 0;                serialized_copy(&epoch, &reader->epoch);            }        }    } else {        reader->epoch = MUCHANNEL_NULL_EPOCH;        result = MUCHANNEL_INACTIVE;    }    return result;}
开发者ID:mato,项目名称:solo5,代码行数:47,


示例16: synchronize

void VisusDataProbe::display3D(VisusTransformation3D model_view_3D){  synchronize();    if (mDataLock.readLock() == 0) {    vwarning("Could not lock data probe content for reading.");    return;  }    glMatrixMode(GL_MODELVIEW);    glPushMatrix();  glLoadMatrixf(model_view_3D);    // If we have a valid data source   if (mDataSource->isValid()) {        VisusBoundingBox bbox;    mDataSource->domainBoundingBox(bbox);    glColor3f(1,1,1);    glDisable(GL_LIGHTING);        glBegin(GL_LINES);    glVertex3f(mPosition[0],mPosition[1],bbox[2]);    glVertex3f(mPosition[0],mPosition[1],bbox[5]);    glVertex3f(bbox[0],mPosition[1],mPosition[2]);    glVertex3f(bbox[3],mPosition[1],mPosition[2]);    glVertex3f(mPosition[0],bbox[1],mPosition[2]);    glVertex3f(mPosition[0],bbox[4],mPosition[2]);    glEnd();  }    if (mDataLock.unlock() == 0)    vwarning("Could not unlock data probe content.");      for (CIterator it=mChildren.begin();it!=mChildren.end();it++)     (*it)->display(model_view_3D);  glPopMatrix();}
开发者ID:NCPP,项目名称:uvcdat-devel,代码行数:46,


示例17: vwarning

void VisusDataProbe::translate(float x, float y){  VisusBoundingBox bbox;  VisusTransformation3D acc;  VisusTransformation3D matrix;  VisusOpenGLState state;  std::vector<float> trans;    if (mDataLock.readLock() == 0) {    vwarning("Could not lock data source for reading. Ignoring translation.");    return;  }  if (mDataSource->isValid()) {    mDataSource->domainBoundingBox(bbox);        if (mDataLock.unlock() == 0)       vwarning("Could not unlock data source.");    accumulate3D(acc);    getValue(matrix);    getValue(state);    trans = matrix.translation(acc,state,x,-y);    trans[0] *= (bbox[3] - bbox[0]);    trans[1] *= (bbox[4] - bbox[1]);    trans[2] *= (bbox[5] - bbox[2]);      matrix[12] += trans[0];    matrix[13] += trans[1];    matrix[14] += trans[2];        matrix[12] = MIN(bbox[3],MAX(bbox[0],matrix[12]));    matrix[13] = MIN(bbox[4],MAX(bbox[1],matrix[13]));    matrix[14] = MIN(bbox[5],MAX(bbox[2],matrix[14]));    setValue(matrix);          synchronize(true);  }  else {    if (mDataLock.unlock() == 0)       vwarning("Could not unlock data source.");  }}
开发者ID:NCPP,项目名称:uvcdat-devel,代码行数:46,


示例18: generateSaveName

Common::Error XeenEngine::saveGameState(int slot, const Common::String &desc) {	Common::OutSaveFile *out = g_system->getSavefileManager()->openForSaving(		generateSaveName(slot));	if (!out)		return Common::kCreatingFileFailed;	XeenSavegameHeader header;	header._saveName = desc;	writeSavegameHeader(out, header);	Common::Serializer s(nullptr, out);	synchronize(s);	out->finalize();	delete out;	return Common::kNoError;}
开发者ID:86400,项目名称:scummvm,代码行数:18,


示例19: synchronize

/*--------------------------------------------------------*/void AzOptOnTree::optimize(AzRgfTreeEnsemble *rgf_ens,                       const AzTrTreeFeat *inp_tree_feat,                       bool doRefreshP,                       int ite_num,                       double lam,                       double sig){  ens = rgf_ens;   tree_feat = inp_tree_feat;   synchronize();   if (doRefreshP) {    refreshPred();   }  iterate(ite_num, lam, sig);   updateTreeWeights(rgf_ens);   ens = NULL;   tree_feat = NULL; }
开发者ID:AlexInTown,项目名称:santander_2016,代码行数:20,


示例20: irq_controller_isr

void irq_controller_isr(uint32_t addr){	uint32_t irq;        irq = get_register(INTC_BASE + INTC_SIR_IRQ);	irq_isr isr = irq_vectors[irq];	if(!isr)	{		uart_print(0, "No ISR for received IRQ/n");		for(;;);		return;	}	isr(addr);        set_register_bit_value(INTC_BASE + INTC_CONTROL, 0, 1);        synchronize();}
开发者ID:dankar,项目名称:boneos,代码行数:19,


示例21: CreateWindowEx

void pListView::constructor() {  lostFocus = false;  hwnd = CreateWindowEx(    WS_EX_CLIENTEDGE, WC_LISTVIEW, L"",    WS_CHILD | WS_TABSTOP | LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_NOSORTHEADER | LVS_NOCOLUMNHEADER,    0, 0, 0, 0, parentWindow->p.hwnd, (HMENU)id, GetModuleHandle(0), 0  );  SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)&listView);  setDefaultFont();  setHeaderText(listView.state.headerText);  setHeaderVisible(listView.state.headerVisible);  setCheckable(listView.state.checkable);  for(auto &text : listView.state.text) append(text);  for(unsigned n = 0; n < listView.state.checked.size(); n++) setChecked(n, listView.state.checked[n]);  setImageList();  if(listView.state.selected) setSelection(listView.state.selection);  autoSizeColumns();  synchronize();}
开发者ID:vgmtool,项目名称:vgmtool,代码行数:19,


示例22: QTreeWidgetItem

void StateManagerWindow::reload() {  list->clear();  list->setSortingEnabled(false);  if(SNES::cartridge.loaded() && cartridge.saveStatesSupported()) {    for(unsigned n = 0; n < StateCount; n++) {      QTreeWidgetItem *item = new QTreeWidgetItem(list);      item->setData(0, Qt::UserRole, QVariant(n));      char slot[16];      sprintf(slot, "%2u", n + 1);      item->setText(0, slot);    }    update();  }  list->setSortingEnabled(true);  list->header()->setSortIndicatorShown(false);  synchronize();}
开发者ID:Arnethegreat,项目名称:bsnes-plus,代码行数:19,


示例23: synchronize

void QNanoQuickItemPainter::presynchronize(QQuickFramebufferObject *item){    QNanoQuickItem *realItem = static_cast<QNanoQuickItem*>(item);    if (realItem) {        m_antialiasing = realItem->antialiasing();        m_pixelAlign = realItem->pixelAlign();        m_pixelAlignText = realItem->pixelAlignText();        m_fillColor = realItem->fillColor();        m_devicePixelRatio = realItem->window()->devicePixelRatio();        m_painter->enableHighQualityRendering(realItem->highQualityRendering());    }#ifdef QNANO_DEBUG    m_debugTimer.start();#endif    synchronize(realItem);}
开发者ID:gabriele,项目名称:qnanopainter,代码行数:19,


示例24: QAction

void NMainMenuBar::setupToolsMenu() {  toolsMenu = this->addMenu(tr("&Tools"));  QFont f;  f.setPointSize(8);  synchronizeAction = new QAction(tr("Synchronize"), this);  synchronizeAction->setToolTip(tr("Close the program"));  connect(synchronizeAction, SIGNAL(triggered()), parent, SLOT(synchronize()));  setupShortcut(synchronizeAction, QString("Tools_Synchronize"));  synchronizeAction->setFont(f);  toolsMenu->addAction(synchronizeAction);  disconnectAction = new QAction(tr("Disconnect"), this);  synchronizeAction->setToolTip(tr("Disconnect from Evernote"));  connect(disconnectAction, SIGNAL(triggered()), parent, SLOT(disconnect()));  setupShortcut(disconnectAction, QString("Tools_Synchronize"));  disconnectAction->setFont(f);  toolsMenu->addAction(disconnectAction);  disconnectAction->setEnabled(false);}
开发者ID:vasantam,项目名称:Nixnote2,代码行数:20,


示例25: QAction

void QgsOfflineEditingPlugin::initGui(){  delete mActionConvertProject;  // Create the action for tool  mActionConvertProject = new QAction( QIcon( ":/offline_editing/offline_editing_copy.png" ), tr( "Convert to offline project" ), this );  mActionConvertProject->setObjectName( "mActionConvertProject" );  // Set the what's this text  mActionConvertProject->setWhatsThis( tr( "Create offline copies of selected layers and save as offline project" ) );  // Connect the action to the run  connect( mActionConvertProject, SIGNAL( triggered() ), this, SLOT( convertProject() ) );  // Add the icon to the toolbar  mQGisIface->addDatabaseToolBarIcon( mActionConvertProject );  mQGisIface->addPluginToDatabaseMenu( tr( "&Offline Editing" ), mActionConvertProject );  mActionConvertProject->setEnabled( false );  mActionSynchronize = new QAction( QIcon( ":/offline_editing/offline_editing_sync.png" ), tr( "Synchronize" ), this );  mActionSynchronize->setObjectName( "mActionSynchronize" );  mActionSynchronize->setWhatsThis( tr( "Synchronize offline project with remote layers" ) );  connect( mActionSynchronize, SIGNAL( triggered() ), this, SLOT( synchronize() ) );  mQGisIface->addDatabaseToolBarIcon( mActionSynchronize );  mQGisIface->addPluginToDatabaseMenu( tr( "&Offline Editing" ), mActionSynchronize );  mActionSynchronize->setEnabled( false );  mOfflineEditing = new QgsOfflineEditing();  mProgressDialog = new QgsOfflineEditingProgressDialog( mQGisIface->mainWindow(), QgisGui::ModalDialogFlags );  connect( mOfflineEditing, SIGNAL( progressStarted() ), this, SLOT( showProgress() ) );  connect( mOfflineEditing, SIGNAL( layerProgressUpdated( int, int ) ), this, SLOT( setLayerProgress( int, int ) ) );  connect( mOfflineEditing, SIGNAL( progressModeSet( QgsOfflineEditing::ProgressMode, int ) ), this, SLOT( setProgressMode( QgsOfflineEditing::ProgressMode, int ) ) );  connect( mOfflineEditing, SIGNAL( progressUpdated( int ) ), this, SLOT( updateProgress( int ) ) );  connect( mOfflineEditing, SIGNAL( progressStopped() ), this, SLOT( hideProgress() ) );  connect( mOfflineEditing, SIGNAL( warning( QString, QString ) ), mQGisIface->messageBar(), SLOT( pushWarning( QString, QString ) ) );  connect( mQGisIface->mainWindow(), SIGNAL( projectRead() ), this, SLOT( updateActions() ) );  connect( mQGisIface->mainWindow(), SIGNAL( newProject() ), this, SLOT( updateActions() ) );  connect( QgsProject::instance(), SIGNAL( writeProject( QDomDocument & ) ), this, SLOT( updateActions() ) );  connect( QgsMapLayerRegistry::instance(), SIGNAL( layerWasAdded( QgsMapLayer* ) ), this, SLOT( updateActions() ) );  connect( QgsMapLayerRegistry::instance(), SIGNAL( layerWillBeRemoved( QString ) ), this, SLOT( updateActions() ) );  updateActions();}
开发者ID:GavrisAS,项目名称:QGIS,代码行数:41,


示例26: muen_channel_has_pending_data

bool muen_channel_has_pending_data(const struct muchannel * const channel,        struct muchannel_reader * reader){    enum muchannel_reader_result res;    uint64_t wc;    if (!muen_channel_is_active(channel)) {        return false;    }    if (MUCHANNEL_NULL_EPOCH == reader->epoch ||            has_epoch_changed(channel, reader))    {        res = synchronize(channel, reader);        if (MUCHANNEL_INCOMPATIBLE_INTERFACE == res) {            return false;        }    }    serialized_copy(&channel->hdr.wc, &wc);    return wc > reader->rc;}
开发者ID:mato,项目名称:solo5,代码行数:21,


示例27: parallelFor

void parallelFor(const std::function<void(parallel::ThreadGroup g)>& function){    typedef std::list<std::thread> ThreadList;    size_t threadCount = std::thread::hardware_concurrency();    ThreadList threads;    for(size_t i = 0; i < threadCount; ++i)    {        threads.emplace_back(std::thread(function, ThreadGroup(threadCount, i)));    }    // barrier threads    for(auto& thread : threads)    {        thread.join();    }    synchronize();}
开发者ID:DLlearn,项目名称:persistent-rnn,代码行数:21,


示例28: while

		//-----------------------------------------------------------------------		void PhysXBridge::_update(Real timeElapsed)		{			if (!mScene)				return;			// Simulate the PhysX scene every x seconds			mTimeSinceLastSimulation += timeElapsed;			while (mTimeSinceLastSimulation > SIMULATION_INTERVAL)			{				// Simulate with SIMULATION_INTERVAL				mScene->simulate(SIMULATION_INTERVAL);				// Fetch simulation results				mScene->flushStream();				mScene->fetchResults(NX_RIGID_BODY_FINISHED, true);				// Broadcast to registered PhysXExterns				synchronize(SIMULATION_INTERVAL);				mTimeSinceLastSimulation -= SIMULATION_INTERVAL;			}		}
开发者ID:Ketzer2002,项目名称:meridian59-engine,代码行数:22,



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


C++ synchronize_irq函数代码示例
C++ sync_inodes_sb函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。