这篇教程C++ updateStats函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中updateStats函数的典型用法代码示例。如果您正苦于以下问题:C++ updateStats函数的具体用法?C++ updateStats怎么用?C++ updateStats使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了updateStats函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: updateStatsvoid ComputationManager::optimize(Computation &c) { updateStats(c); if (optUnsatCheckInterval.getValue() > 0) { optUnsatCheckCounter++; optUnsatCheckCounter %= optUnsatCheckInterval.getValue(); if (optUnsatCheckCounter == 0) { RESULT result = decide(c); if (result == RESULT::UNSAT) { throw AbortException("Intermediate unsat check successful", RESULT::UNSAT); } } } if (optOptimizeInterval.getValue() > 0) { optIntervalCounter++; optIntervalCounter %= optOptimizeInterval.getValue(); if (optIntervalCounter == 0) { while ((maxGlobalNSFSizeEstimation < optMaxGlobalNSFSize.getValue()) || (optMaxGlobalNSFSize.getValue() <= -1)) { unsigned int oldLeavesCount = c.leavesCount();// divideGlobalNSFSizeEstimation(c.leavesCount()); if (!(c.optimize(left))) { break; } left = !left; divideGlobalNSFSizeEstimation(oldLeavesCount); multiplyGlobalNSFSizeEstimation(c.leavesCount()); } } } updateStats(c);}
开发者ID:gcharwat,项目名称:dynqbf,代码行数:34,
示例2: ifvoid State_selectPart::KeyDown(const int &key, const int &unicode){ if (key == SDLK_ESCAPE) { resultRef = -1; popMe = true; } else if (key == SDLK_DOWN) { int size = getInventorySize(); if (selector < size - 1) { selector++; redraw(); updateStats(); } } else if (key == SDLK_UP) { int size = getInventorySize(); if (selector > 0) { selector--; redraw(); updateStats(); } } else if (key == SDLK_RETURN) { resultRef = selector; popMe = true; }}
开发者ID:Skyyrunner,项目名称:ChartedWaters,代码行数:34,
示例3: cpuTime// ~Game()// Description: game ends, calculate & dump results to logGame::~Game(){ m_objCount--; if(m_objCount == 0 && m_objInit){ m_endTime = cpuTime(); updateStats(); dumpLog("open_src_version.log"); } else updateStats();}
开发者ID:ChuyuHsu,项目名称:Threes-Expectiminimax,代码行数:12,
示例4: QMainWindowMainWindow::MainWindow(QWidget *parent) : QMainWindow(parent){ setupUi(this); setupActions(); mStatLabel = new QLabel; statusBar()->addPermanentWidget(mStatLabel); connect(textEdit, SIGNAL(textChanged()), this, SLOT(updateStats())); updateStats();}
开发者ID:bingo2011,项目名称:codes_TheBookOfQT4,代码行数:11,
示例5: updateStatsvoid FPSGraph::update(float dt){ time += dt; ++frames; if (time > GUIFPS_MIN_TIME) { tpfLast = time / frames; fpsLast = frames / time; time = 0.0f; frames = 0; currentSample = (currentSample + 1) % GUIFPS_NUM_SAMPLES; times[currentSample] = tpfLast; updateStats(); if (print) printf("%.2ffps %.2fms/n", fpsLast, 1000.0*tpfLast); gotNewSample = true; } else gotNewSample = false; if (tpfMaximum > 0) { float step = dt * 10000.0; float targetHeight = 0.6666 / tpfMaximum; float to = targetHeight - heightScale; if (fabs(to) > step) heightScale += step * to / fabs(to); else heightScale = targetHeight; }}
开发者ID:pknowles,项目名称:pyarlib,代码行数:35,
示例6: while void ChunkManager::prioritise(Uint32 from,Uint32 to,Priority priority) { if (from > to) std::swap(from,to); Uint32 i = from; while (i <= to && i < (Uint32)d->chunks.size()) { Chunk* c = d->chunks[i]; c->setPriority(priority); if (priority == ONLY_SEED_PRIORITY) { only_seed_chunks.set(i,true); d->todo.set(i,false); } else if (priority == EXCLUDED) { only_seed_chunks.set(i,false); d->todo.set(i,false); } else { only_seed_chunks.set(i,false); d->todo.set(i,!bitset.get(i)); } i++; } updateStats(); }
开发者ID:netrunner-debian-kde-extras,项目名称:libktorrent,代码行数:31,
示例7: QWidgetCWidgetSearchTemplate::CWidgetSearchTemplate(QString searchString, QWidget* parent) : QWidget(parent), ui(new Ui::CWidgetSearchTemplate){ ui->setupUi(this); searchMenu = new QMenu(this); searchMenu->addAction(ui->actionDownload); searchMenu->addSeparator(); searchMenu->addAction(ui->actionBanNode); searchMenu->addAction(ui->actionMarkAsJunk); searchMenu->addAction(ui->actionClearResults); searchMenu->addSeparator(); searchMenu->addAction(ui->actionViewReviews); searchMenu->addAction(ui->actionVirusTotalCheck); m_sSearchString = searchString; m_pSearch = 0; m_nFiles = 0; m_nHits = 0; m_nHubs = 0; m_nLeaves = 0; m_searchState = SearchState::Default; m_pSortModel = new QSortFilterProxyModel(this); m_pSearchModel = new SearchTreeModel(); m_pSortModel->setSourceModel(m_pSearchModel); ui->treeViewSearchResults->setModel(m_pSortModel); m_pSortModel->setDynamicSortFilter(false); connect(m_pSearchModel, SIGNAL(sort()), this, SLOT(Sort())); connect(m_pSearchModel, SIGNAL(updateStats()), this, SLOT(OnStatsUpdated())); loadHeaderState(); connect(ui->treeViewSearchResults->header(), SIGNAL(sectionMoved(int,int,int)), this, SLOT(saveHeaderState())); connect(ui->treeViewSearchResults->header(), SIGNAL(sectionResized(int,int,int)), this, SLOT(saveHeaderState())); connect(ui->treeViewSearchResults->header(), SIGNAL(sectionClicked(int)), this, SLOT(saveHeaderState())); setSkin();}
开发者ID:quazaa-development-team,项目名称:quazaa,代码行数:35,
示例8: SendPacket/*-------------------------------------------------------------------------------------------------------------------- FUNCTION: SendPacket---- DATE: November 25, 2015---- REVISIONS: (Date and Description)---- DESIGNER: Alvin Man---- PROGRAMMER: Alvin Man---- INTERFACE: SendPacket(char* str)-- -char* str : the packet to be sent---- RETURNS: VOID---- NOTES:-- Sends a packet to the serial port. If we get an ACK back acknowledging the packet we just sent, the packet is-- considered sent successfully, and we return. If we don't get an ACK back, we assume something went wrong with the-- transmission and we resend the same packet, up to the maximum specified tries. ----------------------------------------------------------------------------------------------------------------------*/VOID SendPacket(char* str) { DWORD numTries_sendPacket = 0; //Try to send the packet until we reach the maximum number of tries while (numTries_sendPacket < SEND_PACKET_MAX_TRIES) { //Send the packet Send(str, strlen(str), hWrite_Lock); //Wait for a response for the Packet we sent char *response = ""; if (!Wait_For_Data(&response, 1, 3000)) { updateStats(stats.packetSent++, IDC_SDATA0); //Time'd out, increment counter and restart the loop to send the packet again OutputDebugString("Packet sending timeout/n"); numTries_sendPacket++; continue; } else if (Evaluate_Response (response[0])) { updateProgressBar (progressSize / Write_Packets.size()); return; } }}
开发者ID:okwan,项目名称:WirelessProtocol,代码行数:47,
示例9: whilevoid Application::go(){ Ogre::Timer loopTimer; bool continueRunning = true; while ( continueRunning ) { Ogre::WindowEventUtilities::messagePump(); SimpleInputManager::capture(); // Update logic stuff float elapsedSeconds = loopTimer.getMicroseconds() * 1.0 / 1000000; updateLogic( elapsedSeconds ); // Update graphics stuff updateAnimations( elapsedSeconds ); bool windowClosed = m_window->isClosed(); continueRunning &= ! windowClosed; updateStats(); loopTimer.reset(); bool renderFrameSuccess = m_root->renderOneFrame(); continueRunning &= renderFrameSuccess; continueRunning &= ! m_exitRequested; }}
开发者ID:juanjmostazo,项目名称:ouan-tests,代码行数:30,
示例10: instrument_Triop/* instruments a Binary Operation Expression in a Ist_WrTmp statement */static void instrument_Triop(IRSB* sb, IRStmt* st, Addr64 cia) { Char thisFct[]="instrument_Triop"; IRDirty* di; IRExpr** argv; IRExpr *op = st->Ist.WrTmp.data; IRExpr* oa_event_expr; IROp irop=op->Iex.Triop.details->op; void* f=callbackFromIROp(irop); if (f == NULL) return; OA_InstrumentContext inscon=contextFor(cia, irop); if (not_worth_watching(inscon)) return; // filter events that can't be attached to source-code location updateStats(inscon->op); oa_event_expr = mkIRExpr_HWord( (HWord)inscon ); IRExpr * args1[2]; packToI32orI64(sb, op->Iex.Triop.details->arg2, args1, irop); IRExpr * args2[2]; packToI32orI64(sb, op->Iex.Triop.details->arg3, args2, irop); argv = mkIRExprVec_3(args1[0], args2[0], oa_event_expr); di = unsafeIRDirty_0_N( 3, thisFct, VG_(fnptr_to_fnentry)( f ), argv); addStmtToIRSB( sb, IRStmt_Dirty(di) ); if (args1[1] != NULL) { // we need a second callback for 64bit types argv = mkIRExprVec_3(args1[1], args2[1], oa_event_expr); di = unsafeIRDirty_0_N( 3, thisFct, VG_(fnptr_to_fnentry)( f ), argv); addStmtToIRSB( sb, IRStmt_Dirty(di) ); }}
开发者ID:flight2006,项目名称:valgrind-extend,代码行数:30,
示例11: setTicksvoid ConditionAttributes::addCondition(Creature* creature, const Condition* condition){ if (updateCondition(condition)) { setTicks(condition->getTicks()); const ConditionAttributes& conditionAttrs = static_cast<const ConditionAttributes&>(*condition); //Remove the old condition endCondition(creature); //Apply the new one memcpy(skills, conditionAttrs.skills, sizeof(skills)); memcpy(specialSkills, conditionAttrs.specialSkills, sizeof(specialSkills)); memcpy(skillsPercent, conditionAttrs.skillsPercent, sizeof(skillsPercent)); memcpy(stats, conditionAttrs.stats, sizeof(stats)); memcpy(statsPercent, conditionAttrs.statsPercent, sizeof(statsPercent)); disableDefense = conditionAttrs.disableDefense; if (Player* player = creature->getPlayer()) { updatePercentSkills(player); updateSkills(player); updatePercentStats(player); updateStats(player); } }}
开发者ID:DevelopersPL,项目名称:forgottenserver,代码行数:25,
示例12: QWidgetvoid ServerMonitorWindow::loadServers(){ ScrollBarLayout = new QWidget(this); Layout = new QGridLayout(ScrollBarLayout); AvailableServers = 0; UnavailableServers = 0; ServerStatusWidgetList.clear(); (ProtocolsManager::instance()->byName("gadu") && config_file.readBoolEntry("serverMonitor", "useGaduServersList", true))? loadServersListFromGaduManager() : loadServersListFromFile(); int serverCounter = 0; foreach (ServerStatusWidget* serverStatusWidget, ServerStatusWidgetList) { int row = serverCounter; if (serverCounter % 2) --row; Layout->addWidget(serverStatusWidget, row, (serverCounter) % 2); connect (serverStatusWidget, SIGNAL(statusChanged (ServerStatusWidget::ServerState, ServerStatusWidget::ServerState)), this, SLOT(updateStats (ServerStatusWidget::ServerState, ServerStatusWidget::ServerState))); serverCounter++; }
开发者ID:partition,项目名称:kadu,代码行数:25,
示例13: setTicksvoid ConditionAttributes::addCondition(Creature* creature, const Condition* addCondition){ if(updateCondition(addCondition)) { setTicks(addCondition->getTicks()); const ConditionAttributes& conditionAttrs = static_cast<const ConditionAttributes&>(*addCondition); //Remove the old condition endCondition(creature, CONDITIONEND_ABORT); //Apply the new one memcpy(skills, conditionAttrs.skills, sizeof(skills)); memcpy(skillsPercent, conditionAttrs.skillsPercent, sizeof(skillsPercent)); memcpy(stats, conditionAttrs.stats, sizeof(stats)); memcpy(statsPercent, conditionAttrs.statsPercent, sizeof(statsPercent)); if(Player* player = creature->getPlayer()) { updatePercentSkills(player); updateSkills(player); updatePercentStats(player); updateStats(player); } }}
开发者ID:armadaazteca,项目名称:tfs0.2.15,代码行数:25,
示例14: updateStatsvoid InventoryState::onAutoequip(Action *){ // don't act when moving items if (_inv->getSelectedItem() != 0) { return; } BattleUnit *unit = _battleGame->getSelectedUnit(); Tile *groundTile = unit->getTile(); std::vector<BattleItem*> *groundInv = groundTile->getInventory(); Mod *mod = _game->getMod(); RuleInventory *groundRuleInv = mod->getInventory("STR_GROUND", true); int worldShade = _battleGame->getGlobalShade(); std::vector<BattleUnit*> units; units.push_back(unit); BattlescapeGenerator::autoEquip(units, mod, NULL, groundInv, groundRuleInv, worldShade, true, true); // refresh ui _inv->arrangeGround(false); updateStats(); _refreshMouse(); // give audio feedback _game->getMod()->getSoundByDepth(_battleGame->getDepth(), Mod::ITEM_DROP)->play();}
开发者ID:atlimit8,项目名称:OpenXcom,代码行数:27,
示例15: initializeDepqbfComputation* ComputationManager::newComputation(const std::vector<NTYPE>& quantifierSequence, const std::vector<BDD>& cubesAtLevels, const BDD& bdd) { bool keepFirstLevel = false; if (quantifierSequence.size() >= 1) { // && quantifierSequence.at(0) == NTYPE::EXISTS) { keepFirstLevel = app.enumerate() || app.modelCount(); } if (keepFirstLevel) { if (optUnsatCheckInterval.getValue() > 0 && quantifierSequence.size() >= 1 && quantifierSequence.at(0) == NTYPE::FORALL) { throw std::runtime_error("Intermediate UNSAT checking must be disabled for enumeration and counting if outermost quantifier is universal"); } if (optDisableCache.isUsed()) { throw std::runtime_error("Removal cache must be enabled for enumeration and counting"); } } if (optDisableCache.isUsed()) { if ((optMaxGlobalNSFSize.isUsed() && optMaxGlobalNSFSize.getValue() != -1) || (optMaxBDDSize.isUsed() && optMaxBDDSize.getValue() != 0) || (optDependencyScheme.isUsed() && optDependencyScheme.getValue() != "naive")) { throw std::runtime_error("Cache can only be disabled if none of NSF size, BDD size, and dependency scheme are set"); } optMaxGlobalNSFSize.setValue("-1"); optMaxBDDSize.setValue("0"); optDependencyScheme.setValue("naive"); } Computation* c = NULL; #ifdef DEPQBF_ENABLED if (optDependencyScheme.getValue() == "standard" || (optDependencyScheme.getValue() == "dynamic" && quantifierSequence.size() > 2)) { if (depqbf == NULL) { initializeDepqbf(); } if (cuddToOriginalIds == NULL) { initializeCuddToOriginalIds(); } // always return a new vector std::vector<std::set < htd::vertex_t>> notYetRemovedAtLevels = initializeNotYetRemovedAtLevels(); c = new StandardDependencyCacheComputation(*this, quantifierSequence, cubesAtLevels, bdd, optMaxBDDSize.getValue(), keepFirstLevel, *depqbf, *cuddToOriginalIds, notYetRemovedAtLevels); }#endif if (optDependencyScheme.getValue() == "simple") { if (variableCountAtLevels == NULL) { initializeVariableCountAtLevels(); } c = new SimpleDependencyCacheComputation(*this, quantifierSequence, cubesAtLevels, bdd, optMaxBDDSize.getValue(), keepFirstLevel, *variableCountAtLevels); } if (c == NULL) { if (!optDisableCache.isUsed()) { c = new CacheComputation(*this, quantifierSequence, cubesAtLevels, bdd, optMaxBDDSize.getValue(), keepFirstLevel); } else { c = new Computation(*this, quantifierSequence, cubesAtLevels, bdd); } } updateStats(*c); return c;}
开发者ID:gcharwat,项目名称:dynqbf,代码行数:59,
示例16: SignStatsSignStats * CoreData::addStats(QDate &sdate, QDate &edate){ SignStats * stats = new SignStats(sdate, edate); updateStats(stats); statsReports.insert(stats->getKey(), stats); return stats;}
开发者ID:revive,项目名称:YangManage,代码行数:8,
示例17: firePostUpdate void RenderTarget::_endUpdate() { // notify listeners (post) firePostUpdate(); // Update statistics (always on top) updateStats(); }
开发者ID:mACH1VO,项目名称:MuOnline,代码行数:8,
示例18: ship_failstate_t * ship_fail(){ printf("Failed to ship parts.../n"); refund(); updateStats(LOST); return &accepting; }
开发者ID:p-easterbrooks,项目名称:p4,代码行数:8,
示例19: ship_successstate_t * ship_success(){ printf("Successfully shipped parts.../n"); start_warranty(); updateStats(DONE); exit_from(); return &accepting;}
开发者ID:p-easterbrooks,项目名称:p4,代码行数:8,
示例20: QLabelGUIPlayer::GUIPlayer( Player* p ){ player = p; if(nameLabel == NULL) nameLabel = new QLabel( this ); nameLabel->setTextFormat(Qt::RichText); updateStats();}
开发者ID:thejasonhsu,项目名称:Monopoly,代码行数:8,
示例21: refToFleetState_selectPart::State_selectPart(Fleet& fleet, const int& shipnum, const char& type, int& resultsave): refToFleet(fleet), parttype(type), resultRef(resultsave), page(shipnum){ selector = 0; console = new TCODConsole(screenwidth/2, screenheight); partConsole = new TCODConsole(screenwidth / 2, screenheight); redraw(); updateStats();}
开发者ID:Skyyrunner,项目名称:ChartedWaters,代码行数:9,
示例22: istvoid CoreData::updateReport(){ QMapIterator<QString, SignStats*> ist(statsReports); while (ist.hasNext()) { ist.next(); SignStats * stats = ist.value(); updateStats(stats); }}
开发者ID:revive,项目名称:YangManage,代码行数:9,
示例23: advanceQueueTimevoid ReliabilitySystem::update( float deltaTime ) { acked.clear(); advanceQueueTime( deltaTime ); updateQueues(); updateStats();#ifdef NET_UNIT_TEST validate();#endif}
开发者ID:mrdeveloperdude,项目名称:OctoMY,代码行数:9,
示例24: updateStats/** * Unloads the selected weapon. * @param action Pointer to an action. */void InventoryState::btnUnloadClick(Action *){ if (_inv->unload()) { _txtItem->setText(L""); _txtAmmo->setText(L""); _selAmmo->clear(); updateStats(); }}
开发者ID:fibercube,项目名称:OpenXcom,代码行数:14,
示例25: updateStatsvoid KBBGame::abortGame(){ if (running) { running = FALSE; ballsPlaced = 0; updateStats(); gr->clearFocus(); emit gameRuns( running ); }}
开发者ID:xwizard,项目名称:kde1,代码行数:10,
示例26: updateRink/** Public driver routine to call * other private update methods */void Window::update(){ updateRink(); updatePlayers(); updatePuck(); updateStats(); // Swap buffers to show the whole thing SDL_Flip(mainSurface);}
开发者ID:abbec,项目名称:roboHockey,代码行数:12,
示例27: QMainWindow// Inicializa los elementos necesarios para la aplicaciónMainWindow::MainWindow(QWidget *parent) : QMainWindow(parent){ setupUi(this); setupActions(); // Configura la barra de herramienta QMenu *toolBarMenu = menuSettings->addMenu(tr("&Toolbars")); toolBar->toggleViewAction()->setShortcut(tr("CTRL+T")); toolBar->toggleViewAction()->setStatusTip(tr("Show/Hide Main Toolbar")); toolBar->toggleViewAction()->setText(tr("&Main Toolbar")); toolBarMenu->addAction(toolBar->toggleViewAction()); actionUndo->setEnabled(false); actionRepeat->setEnabled(false); mStatLabel = new QLabel(); statusBar()->addPermanentWidget(mStatLabel); connect(textEdit, SIGNAL(textChanged()), this, SLOT(updateStats())); updateStats(); QDockWidget *templateDocker = new QDockWidget; templateDocker->setAllowedAreas(Qt::LeftDockWidgetArea| Qt::RightDockWidgetArea); templateDocker->setObjectName("TemplateDocker"); templateDocker->setWindowTitle("Templates"); addDockWidget(Qt::LeftDockWidgetArea,templateDocker); QListView *view = new QListView(); templateDocker->setWidget(view); TemplateHandler *mTemplate = new TemplateHandler(view, textEdit, this); templateDocker->toggleViewAction()->setShortcut(tr("CTRL+M")); templateDocker->toggleViewAction()->setStatusTip(tr("Show/Hide Template Docker")); templateDocker->toggleViewAction()->setText(tr("&Template Docker")); toolBarMenu->addAction(templateDocker->toggleViewAction()); // Recuoera la configuración del editor readsettings();}
开发者ID:dobeslao,项目名称:qt-by-example,代码行数:44,
示例28: updateStats// reset()// Description: prepare variables for new gamevoid Game::reset(){ updateStats(); m_grid.clear(); m_gameOver = FALSE; resetGrabBag(); setNextTile(); for(int i = 0;i < INITIAL_TILE_NUM;i++) genInitTile();}
开发者ID:ChuyuHsu,项目名称:Threes-Expectiminimax,代码行数:12,
注:本文中的updateStats函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ updateStatus函数代码示例 C++ updateState函数代码示例 |