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

C++ refreshCache函数代码示例

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

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



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

示例1: qDebug

void PackageManager::onFinished(PackageKit::Transaction::Exit status, uint runtime)
{
#ifdef PACKAGEMANAGER_LOG
    qDebug() << Q_FUNC_INFO << status << runtime;
#endif
    PackageKit::Transaction *t = qobject_cast<PackageKit::Transaction*>(sender());

    if (sender() == m_getUpdatesTransaction) {
//        delete m_getUpdatesTransaction;
        m_getUpdatesTransaction = 0;
    } else if (sender() == m_getPackagesTransaction) {
//        delete m_getPackagesTransaction;
        m_getPackagesTransaction = 0;
    }

    if (t && t->role() == PackageKit::Transaction::RoleRemovePackages) {
        m_packManContext.setSelectedGroup(PackageKit::Transaction::GroupUnknown);
        refreshUpdate();
        refreshInstalled();
    } else if (t && t->role() == PackageKit::Transaction::RoleUpdatePackages) {
        m_packManContext.setSelectedGroup(PackageKit::Transaction::GroupUnknown);
        refreshUpdate();
        refreshInstalled();
    } else if (t && t->role() == PackageKit::Transaction::RoleInstallPackages) {
        uint group = m_packManContext.selectedGroup();
        refreshCache(); // includes refreshUpdate();
        refreshInstalled();
        if (m_bSimulation == false) {
            refreshAvailable(group);
        }
    }
}
开发者ID:nemomobile,项目名称:qmlpackagemanager,代码行数:32,代码来源:packagemanager.cpp


示例2: sl

  MetaObjectPrivate&  MetaObjectPrivate::operator=(const MetaObjectPrivate &rhs)
  {
    if (this == &rhs)
      return *this;

    {
      boost::recursive_mutex::scoped_lock sl(rhs._methodsMutex);
      _methodsNameToIdx = rhs._methodsNameToIdx;
      _methods          = rhs._methods;
    }
    {
      boost::recursive_mutex::scoped_lock sl(rhs._eventsMutex);
      _eventsNameToIdx = rhs._eventsNameToIdx;
      _events = rhs._events;
    }
    {
      boost::recursive_mutex::scoped_lock sl(rhs._propertiesMutex);
      _properties = rhs._properties;
    }
    _index = rhs._index;
    _description = rhs._description;
    // cache data uses pointers to map entries and must be refreshed
    refreshCache();
    return (*this);
  }
开发者ID:dmerejkowsky,项目名称:libqi,代码行数:25,代码来源:metaobject.cpp


示例3: WFX_CONDITION

ULONG VorticalLayerCtrl::expand(ULONG nItem, BOOL bexpand /*= TRUE*/)
{
	m_bCached = FALSE;
	ULONG nLine = m_pRoot->expand(nItem, TRUE, bexpand);
	if (bexpand)
	{
		WFX_CONDITION(nItem < m_rgCacheInfo.size());
		m_rgCacheInfo[nItem].m_bexpanded = TRUE;
		for (int i = 0; i < nLine; i++)
		{
			WFX_CONDITION(nItem + i + 1 <= m_rgCacheInfo.size());
			CacheInfo chinfo(getLayer(nItem + i + 1), TRUE);
			m_rgCacheInfo.insert(m_rgCacheInfo.begin() + nItem + 1, chinfo);
		}
	}
	else
	{
		m_rgCacheInfo[nItem].m_bexpanded = FALSE;
		for (int i = 0; i < nLine; i++)
		{
			WFX_CONDITION(nItem + i + 1 < m_rgCacheInfo.size());
			m_rgCacheInfo.erase(m_rgCacheInfo.begin() + nItem + 1);
		}
	}
	refreshCache();
	return m_rgCacheInfo.size();
}
开发者ID:wxtnote,项目名称:wfc,代码行数:27,代码来源:wfxListCtrl.cpp


示例4: meridian

char* meridian(time_t t) { // meridian
  refreshCache(t);
  if (isPM())
    return "PM";
  else
    return "AM";
}
开发者ID:jaketesler,项目名称:arduino_libraries,代码行数:7,代码来源:Time.cpp


示例5: hourFormat12

int hourFormat12(time_t t) { // the hour for the given time in 12 hour format
  refreshCache(t);
  if( tm.Hour == 0 )
    return 12; // 12 midnight
  else if( tm.Hour  > 12)
    return tm.Hour - 12 ;
  else
    return tm.Hour ;
}
开发者ID:2016SNUSATCANSAT,项目名称:2015ARLISSSOURCECODE,代码行数:9,代码来源:Time.cpp


示例6: ThreadSchedulerFIFO

/**
 * Store the simulated events in the given workspace. This clears the calculated
 * values
 * @param resultWS :: An output workspace that has all of its meta-data set up
 * and just needs to
 * be filled with events.
 */
void ResolutionConvolvedCrossSection::storeSimulatedEvents(
    const API::IMDEventWorkspace_sptr &resultWS) {
    auto outputWS = boost::dynamic_pointer_cast<MDEventWorkspace4>(resultWS);
    if (!outputWS) {
        throw std::invalid_argument(
            "ResolutionConvolvedCrossSection currently only supports 4 dimensions");
    }

    auto iterEnd = m_simulatedEvents.end();
    for (auto iter = m_simulatedEvents.begin(); iter != iterEnd; ++iter) {
        outputWS->addEvent(*iter);
    }
    m_simulatedEvents.clear();

    // This splits up all the boxes according to split thresholds and sizes.
    auto threadScheduler = new ThreadSchedulerFIFO();
    ThreadPool threadPool(threadScheduler);
    outputWS->splitAllIfNeeded(threadScheduler);
    threadPool.joinAll();
    outputWS->refreshCache();
}
开发者ID:rosswhitfield,项目名称:mantid,代码行数:28,代码来源:ResolutionConvolvedCrossSection.cpp


示例7: refreshCache

void KStandardItemListWidget::triggerCacheRefreshing()
{
    if ((!m_dirtyContent && !m_dirtyLayout) || index() < 0) {
        return;
    }

    refreshCache();

    const QHash<QByteArray, QVariant> values = data();
    m_isExpandable = m_supportsItemExpanding && values["isExpandable"].toBool();
    m_isHidden = isHidden();
    m_customizedFont = customizedFont(styleOption().font);
    m_customizedFontMetrics = QFontMetrics(m_customizedFont);

    updateExpansionArea();
    updateTextsCache();
    updatePixmapCache();

    m_dirtyLayout = false;
    m_dirtyContent = false;
    m_dirtyContentRoles.clear();
}
开发者ID:theunbelievablerepo,项目名称:dolphin2.1,代码行数:22,代码来源:kstandarditemlistwidget.cpp


示例8: createMDWorkspace

/**
 * Performs centre-point rebinning and produces an MDWorkspace
 * @param inputWs : The workspace you wish to perform centre-point rebinning on.
 * @param boxController : controls how the MDWorkspace will be split
 * @param frame: the md frame for the two MDHistoDimensions
 * @returns An MDWorkspace based on centre-point rebinning of the inputWS
 */
Mantid::API::IMDEventWorkspace_sptr ReflectometryTransform::executeMD(
    Mantid::API::MatrixWorkspace_const_sptr inputWs,
    BoxController_sptr boxController,
    Mantid::Geometry::MDFrame_uptr frame) const {
  auto dim0 = boost::make_shared<MDHistoDimension>(
      m_d0Label, m_d0ID, *frame, static_cast<Mantid::coord_t>(m_d0Min),
      static_cast<Mantid::coord_t>(m_d0Max), m_d0NumBins);
  auto dim1 = boost::make_shared<MDHistoDimension>(
      m_d1Label, m_d1ID, *frame, static_cast<Mantid::coord_t>(m_d1Min),
      static_cast<Mantid::coord_t>(m_d1Max), m_d1NumBins);

  auto ws = createMDWorkspace(dim0, dim1, boxController);

  auto spectraAxis = inputWs->getAxis(1);
  for (size_t index = 0; index < inputWs->getNumberHistograms(); ++index) {
    auto counts = inputWs->readY(index);
    auto wavelengths = inputWs->readX(index);
    auto errors = inputWs->readE(index);
    const size_t nInputBins = wavelengths.size() - 1;
    const double theta_final = spectraAxis->getValue(index);
    m_calculator->setThetaFinal(theta_final);
    // Loop over all bins in spectra
    for (size_t binIndex = 0; binIndex < nInputBins; ++binIndex) {
      const double &wavelength =
          0.5 * (wavelengths[binIndex] + wavelengths[binIndex + 1]);
      double _d0 = m_calculator->calculateDim0(wavelength);
      double _d1 = m_calculator->calculateDim1(wavelength);
      double centers[2] = {_d0, _d1};

      ws->addEvent(MDLeanEvent<2>(float(counts[binIndex]),
                                  float(errors[binIndex] * errors[binIndex]),
                                  centers));
    }
  }
  ws->splitAllIfNeeded(nullptr);
  ws->refreshCache();
  return ws;
}
开发者ID:liyulun,项目名称:mantid,代码行数:45,代码来源:ReflectometryTransform.cpp


示例9: hour

int hour(time_t t) { // the hour for the given time
  refreshCache(t);
  return tm.Hour;  
}
开发者ID:2016SNUSATCANSAT,项目名称:2015ARLISSSOURCECODE,代码行数:4,代码来源:Time.cpp


示例10: month

int month(time_t t) {  // the month for the given time
  refreshCache(t);
  return tm.Month;
}
开发者ID:2016SNUSATCANSAT,项目名称:2015ARLISSSOURCECODE,代码行数:4,代码来源:Time.cpp


示例11: year

int year(time_t t) { // the year for the given time
  refreshCache(t);
  return tmYearToCalendar(tm.Year);
}
开发者ID:2016SNUSATCANSAT,项目名称:2015ARLISSSOURCECODE,代码行数:4,代码来源:Time.cpp


示例12: day

int day(time_t t) { // the day for the given time (0-6)
  refreshCache(t);
  return tm.Day;
}
开发者ID:2016SNUSATCANSAT,项目名称:2015ARLISSSOURCECODE,代码行数:4,代码来源:Time.cpp


示例13: weekday

int weekday(time_t t) {
  refreshCache(t);
  return tm.Wday;
}
开发者ID:2016SNUSATCANSAT,项目名称:2015ARLISSSOURCECODE,代码行数:4,代码来源:Time.cpp


示例14: second

int second(time_t t) {  // the second for the given time
  refreshCache(t);
  return tm.Second;
}
开发者ID:2016SNUSATCANSAT,项目名称:2015ARLISSSOURCECODE,代码行数:4,代码来源:Time.cpp


示例15: weekdayStr

char* weekdayStr(time_t t) {
  refreshCache(t);
  return dayShortStr(tm.Wday);
}
开发者ID:jaketesler,项目名称:arduino_libraries,代码行数:4,代码来源:Time.cpp


示例16: minute

int minute(time_t t) { // the minute for the given time
  refreshCache(t);
  return tm.Minute;  
}
开发者ID:2016SNUSATCANSAT,项目名称:2015ARLISSSOURCECODE,代码行数:4,代码来源:Time.cpp


示例17: weekdayStrLong

char* weekdayStrLong(time_t t) {   //this returns a string
  refreshCache(t);
  return dayStr(tm.Wday);
}
开发者ID:jaketesler,项目名称:arduino_libraries,代码行数:4,代码来源:Time.cpp


示例18: resultValueIndex

/**
 * Create an output event workspace filled with data simulated with the fitting
 * function.
 * @param baseName :: The base name for the workspace
 * @param inputWorkspace :: The input workspace.
 * @param values :: The calculated values
 * @param outputWorkspacePropertyName :: The property name
 */
boost::shared_ptr<API::Workspace> FitMD::createEventOutputWorkspace(
    const std::string &baseName, const API::IMDEventWorkspace &inputWorkspace,
    const API::FunctionValues &values,
    const std::string &outputWorkspacePropertyName) {
  auto outputWS =
      MDEventFactory::CreateMDWorkspace(inputWorkspace.getNumDims(), "MDEvent");
  // Add events
  // TODO: Generalize to ND (the current framework is a bit limiting)
  auto mdWS = boost::dynamic_pointer_cast<
      DataObjects::MDEventWorkspace<DataObjects::MDEvent<4>, 4>>(outputWS);
  if (!mdWS) {
    return boost::shared_ptr<API::Workspace>();
  }

  // Bins extents and meta data
  for (size_t i = 0; i < 4; ++i) {
    boost::shared_ptr<const Geometry::IMDDimension> inputDim =
        inputWorkspace.getDimension(i);
    Geometry::MDHistoDimensionBuilder builder;
    builder.setName(inputDim->getName());
    builder.setId(inputDim->getDimensionId());
    builder.setUnits(inputDim->getUnits());
    builder.setNumBins(inputDim->getNBins());
    builder.setMin(inputDim->getMinimum());
    builder.setMax(inputDim->getMaximum());
    builder.setFrameName(inputDim->getMDFrame().name());

    outputWS->addDimension(builder.create());
  }

  // Run information
  outputWS->copyExperimentInfos(inputWorkspace);
  // Coordinates
  outputWS->setCoordinateSystem(inputWorkspace.getSpecialCoordinateSystem());
  // Set sensible defaults for splitting behaviour
  BoxController_sptr bc = outputWS->getBoxController();
  bc->setSplitInto(3);
  bc->setSplitThreshold(3000);
  outputWS->initialize();
  outputWS->splitBox();

  auto inputIter = inputWorkspace.createIterator();
  size_t resultValueIndex(0);
  const float errorSq = 0.0;
  do {
    const size_t numEvents = inputIter->getNumEvents();
    const float signal =
        static_cast<float>(values.getCalculated(resultValueIndex));
    for (size_t i = 0; i < numEvents; ++i) {
      coord_t centers[4] = {
          inputIter->getInnerPosition(i, 0), inputIter->getInnerPosition(i, 1),
          inputIter->getInnerPosition(i, 2), inputIter->getInnerPosition(i, 3)};
      mdWS->addEvent(MDEvent<4>(signal, errorSq, inputIter->getInnerRunIndex(i),
                                inputIter->getInnerDetectorID(i), centers));
    }
    ++resultValueIndex;
  } while (inputIter->next());
  delete inputIter;

  // This splits up all the boxes according to split thresholds and sizes.
  auto threadScheduler = new Kernel::ThreadSchedulerFIFO();
  Kernel::ThreadPool threadPool(threadScheduler);
  outputWS->splitAllIfNeeded(threadScheduler);
  threadPool.joinAll();
  outputWS->refreshCache();

  // Store it
  if (!outputWorkspacePropertyName.empty()) {
    declareProperty(
        new API::WorkspaceProperty<API::IMDEventWorkspace>(
            outputWorkspacePropertyName, "", Direction::Output),
        "Name of the output Workspace holding resulting simulated spectrum");
    m_manager->setPropertyValue(outputWorkspacePropertyName,
                                baseName + "Workspace");
    m_manager->setProperty(outputWorkspacePropertyName, outputWS);
  }

  return outputWS;
}
开发者ID:DanNixon,项目名称:mantid,代码行数:87,代码来源:FitMD.cpp


示例19: __attribute__


//.........这里部分代码省略.........
			    //if (fp == NULL){
				//printf("Assembled file does not exist. Assembling here...\n");
				//assemble(event->name);
			    //} else {
				//printf("Assembled file already exist. Don't assembled anymore..\n");
			    //}
			    //fclose(fp);
                        }
                      }
		    }
                  }
              }

              if (event->mask & IN_CLOSE){
                  if (event->mask & IN_ISDIR){

                  }else{
                      syslog(LOG_INFO, "FileTransaction: The file %s was closed.\n", event->name);
                      //printf("File %s closed.\n", event->name);
		      int k = 0;
		      for (k = 0; k < counter; k++){
			if (wds[k] == event->wd){
				//printf("IN_CLOSE : %s | FILENAME : %s\n", dirs[k], event->name);
				break;
			}
		      }
		      //strcpy(COMMANDS[COUNTER], "");
		      //COUNTER++;
		      //String original_file = "";
		      //sprintf(original_file, "%s/%s", STORAGE_LOC, event->name);
		      //FILE *fp;
                    //  fp = fopen(original_file, "r");
		  //    if (fp == NULL){
		//	printf("Original file does not exist.. Do nothing..\n");
		  //    } else {
		//	printf("Original file exist. File closed. Disassembling file..\n");
		     //}
		      //fclose(fp);
		      int flag;
		      FILE *fp = fopen("random.txt", "rb");
		      fscanf(fp, "%d", &flag);
		      fclose(fp);
		      printf("IN CLOSE FLAG := %d\n", flag);
		      if (flag == 0) { //done striping

			String comm = "", comm_out = "";
			int inCache = 0;
			strcpy(comm, "ls /mnt/CVFSCache");
			runCommand(comm, comm_out);

			char *pch = strtok(comm_out, "\n");
			while (pch != NULL){
				if (strcmp(pch, event->name) == 0){
					inCache = 1;
					break;
				}
				pch = strtok(NULL, "\n");
			}

			if (!inCache){
				//check if file already assembled
				FILE *fp = fopen("assembled.txt", "rb");
				String line = "";
				String file = "";
				int assembled = 0;
				strcpy(file, event->name);
				strcat(file, "\n");
				while (fgets(line, sizeof(file), fp) != NULL){
					printf("LINE := %s | FILE := %s\n", line, event->name);
					if (strcmp(line, file) == 0){
						assembled = 1;
						break;
					}
				}
				fclose(fp);

				if (assembled){
		    			printf("File has been closed\n");
					disassemble(event->name);
				}
			}

                      	if (strstr(event->name, "part1.") != NULL){
                        	   refreshCache();
                      	}
		      }
                  }
              }

              p += EVENT_SIZE + event->len;

       }
}

    /* Clean up */
    inotify_rm_watch(fd, wd);
    close(fd);
    sqlite3_finalize(res);
    sqlite3_close(db);
}
开发者ID:int-argc,项目名称:CVFS2.0,代码行数:101,代码来源:watch_share.c


示例20: QDialog

repo::gui::RepoFederationDialog::RepoFederationDialog(
        RepoIDBCache *dbCache,
        QWidget *parent)
    : QDialog(parent)
    , ui(new Ui::RepoFederationDialog)
    , dbCache(dbCache)

{
    ui->setupUi(this);
    ui->availableWidget->setExpandedUI();
    ui->availableWidget->setExtendedSelection();
    ui->availableWidget->setRootIsDecorated(true);

    ui->federatedWidget->setExpandedUI();
    ui->federatedWidget->setExtendedSelection();
    ui->federatedWidget->setRootIsDecorated(true);

//    ui->federatedWidget->getTreeView()->setDragEnabled(true);
//    ui->federatedWidget->getTreeView()->viewport()->setAcceptDrops(true);
//    ui->federatedWidget->getTreeView()->setDropIndicatorShown(true);
//    ui->federatedWidget->getTreeView()->setDragDropMode(QAbstractItemView::InternalMove);

    ui->buttonBox->button(QDialogButtonBox::StandardButton::Ok)->setText(tr("Next"));

    //--------------------------------------------------------------------------

    dbCache->setHostsComboBox(ui->hostComboBox);
    dbCache->setDatabasesComboBox(ui->databaseComboBox);

    //--------------------------------------------------------------------------

    ui->addPushButton->setIcon(RepoFontAwesome::getInstance().getIcon(RepoFontAwesome::fa_arrow_right));
    ui->removePushButton->setIcon(RepoFontAwesome::getInstance().getIcon(RepoFontAwesome::fa_arrow_left));


    QStandardItemModel *availableModel = ui->availableWidget->getModel();
    availableModel->setColumnCount(1);
    availableModel->setHeaderData(
                0,
                Qt::Horizontal,
                tr("Project"));


    QStandardItemModel *federatedModel = ui->federatedWidget->getModel();
    federatedModel->setColumnCount(3);
    federatedModel->setHeaderData(
                0,
                Qt::Horizontal,
                tr("Project"));
    federatedModel->setHeaderData(
                1,
                Qt::Horizontal,
                tr("Branch"));
    federatedModel->setHeaderData(
                2,
                Qt::Horizontal,
                tr("Revision"));

    QObject::connect(ui->refreshPushButton, SIGNAL(pressed()),
                     this, SLOT(refresh()));

    QObject::connect(ui->refreshPushButton, SIGNAL(pressed()),
                     this, SLOT(refreshCache()));

    QObject::connect(ui->databaseComboBox, SIGNAL(currentIndexChanged(const QString &)),
                     this, SLOT(refresh()));

    QObject::connect(ui->addPushButton, SIGNAL(pressed()),
                     this, SLOT(addProjectsToFederation()));

    QObject::connect(ui->removePushButton, SIGNAL(pressed()),
                     this, SLOT(removeProjectsFromFederation()));

    QObject::connect(ui->federatedWidget->getTreeView(), SIGNAL(customContextMenuRequested(QPoint)),
        this, SLOT(showFederationMenu(QPoint)));
}
开发者ID:jmbertinat,项目名称:3drepogui,代码行数:76,代码来源:repofederationdialog.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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