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

C++ profile函数代码示例

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

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



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

示例1: profileSuffix

Core::GeneratedFiles
        EmptyProjectWizard::generateFiles(const QWizard *w,
                                        QString * /*errorMessage*/) const
{
    const EmptyProjectWizardDialog *wizard = qobject_cast< const EmptyProjectWizardDialog *>(w);
    const QtProjectParameters params = wizard->parameters();
    const QString projectPath = params.projectPath();
    const QString profileName = Core::BaseFileWizard::buildFileName(projectPath, params.name, profileSuffix());

    Core::GeneratedFile profile(profileName);
    return Core::GeneratedFiles() << profile;
}
开发者ID:halsten,项目名称:beaverdbg,代码行数:12,代码来源:emptyprojectwizard.cpp


示例2: assert

void ProfileDialog::slotOk()
{
    const int index = mListView->itemIndex(mListView->selectedItem());
    if(index < 0)
        return; // none selected

    assert((unsigned int)index < mProfileList.count());

    KConfig profile(*mProfileList.at(index), true, false);
    emit profileSelected(&profile);
    KDialogBase::slotOk();
}
开发者ID:serghei,项目名称:kde3-kdepim,代码行数:12,代码来源:configuredialog_p.cpp


示例3: CHECK

bool MFolderFromProfile::Rename(const String& newName)
{
   CHECK( !m_folderName.empty(), false, _T("can't rename the root pseudo-folder") );

   String path = m_folderName.BeforeLast(_T('/')),
          name = m_folderName.AfterLast(_T('/'));

   String newFullName = path;
   if ( !path.empty() )
      newFullName += _T('/');
   newFullName += newName;

   // we can't use Exists() here as it tries to read a value from the config
   // group newFullName and, as a side effect of this, creates this group, so
   // Profile::Rename() below will then fail!
#if 0
   if ( Exists(newFullName) )
   {
      wxLogError(_("Cannot rename folder '%s' to '%s': the folder with "
                   "the new name already exists."),
                   m_folderName.c_str(), newName.c_str());

      return false;
   }
#endif // 0

   Profile_obj profile(path);
   CHECK( profile, false, _T("panic in MFolder: no profile") );
   if ( !profile->Rename(name, newName) )
   {
      wxLogError(_("Cannot rename folder '%s' to '%s': the folder with "
                   "the new name already exists."),
                   m_folderName.c_str(), newName.c_str());

      return false;
   }

   String oldName = m_folderName;
   m_folderName = newFullName;

   // TODO: MFolderCache should just subscribe to "Rename" events...
   MFolderCache::RenameAll(oldName, newFullName);

   // notify everybody about the change of the folder name
   MEventManager::Send(
     new MEventFolderTreeChangeData(oldName,
                                    MEventFolderTreeChangeData::Rename,
                                    newFullName)
     );

   return true;
}
开发者ID:mark711,项目名称:mahogany,代码行数:52,代码来源:MFolder.cpp


示例4: cbc_cost

/**
 * Calculate CBC encryption or decryption cost
 *
 * @v cipher			Cipher algorithm
 * @v key_len			Length of key
 * @v op			Encryption or decryption operation
 * @ret cost			Cost (in cycles per byte)
 */
static unsigned long cbc_cost ( struct cipher_algorithm *cipher,
				size_t key_len,
				void ( * op ) ( struct cipher_algorithm *cipher,
						void *ctx, const void *src,
						void *dst, size_t len ) ) {
	static uint8_t random[8192]; /* Too large for stack */
	uint8_t key[key_len];
	uint8_t iv[cipher->blocksize];
	uint8_t ctx[cipher->ctxsize];
	union profiler profiler;
	unsigned long long elapsed;
	unsigned long cost;
	unsigned int i;
	int rc;

	/* Fill buffer with pseudo-random data */
	srand ( 0x1234568 );
	for ( i = 0 ; i < sizeof ( random ) ; i++ )
		random[i] = rand();
	for ( i = 0 ; i < sizeof ( key ) ; i++ )
		key[i] = rand();
	for ( i = 0 ; i < sizeof ( iv ) ; i++ )
		iv[i] = rand();

	/* Initialise cipher */
	rc = cipher_setkey ( cipher, ctx, key, key_len );
	assert ( rc == 0 );
	cipher_setiv ( cipher, ctx, iv );

	/* Time operation */
	profile ( &profiler );
	op ( cipher, ctx, random, random, sizeof ( random ) );
	elapsed = profile ( &profiler );

	/* Round to nearest whole number of cycles per byte */
	cost = ( ( elapsed + ( sizeof ( random ) / 2 ) ) / sizeof ( random ) );

	return cost;
}
开发者ID:Afterglow,项目名称:ipxe,代码行数:47,代码来源:cbc_test.c


示例5: profileSuffix

Core::GeneratedFiles SubdirsProjectWizard::generateFiles(const QWizard *w,
                                                         QString * /*errorMessage*/) const
{
    const SubdirsProjectWizardDialog *wizard = qobject_cast< const SubdirsProjectWizardDialog *>(w);
    const QtProjectParameters params = wizard->parameters();
    const QString projectPath = params.projectPath();
    const QString profileName = Core::BaseFileWizardFactory::buildFileName(projectPath, params.fileName, profileSuffix());

    Core::GeneratedFile profile(profileName);
    profile.setAttributes(Core::GeneratedFile::OpenProjectAttribute | Core::GeneratedFile::OpenEditorAttribute);
    profile.setContents(QLatin1String("TEMPLATE = subdirs\n"));
    return Core::GeneratedFiles() << profile;
}
开发者ID:KeeganRen,项目名称:qt-creator,代码行数:13,代码来源:subdirsprojectwizard.cpp


示例6: profile

    Profile *ProfileManager::find_load_profile(const std::string &name)
    {
        auto loaded = profile(name);
        if (loaded != nullptr)
        {
            return loaded;
        }

        std::string path("profiles/");
        path += name;
        path += ".lua";
        return ProfileLuaSerialiser::deserialise(path);
    }
开发者ID:astrellon,项目名称:cotsb,代码行数:13,代码来源:profile.cpp


示例7: parseFile

ParseTree* parseFile(ParserContext& context)
{
	gUniqueNames.clear();
	gUniqueTypes.clear();
	gUniqueExpressions.clear();

	SemaContext& globals = *new SemaContext(context, getAllocator(context));
	SemaNamespace& walker = *new SemaNamespace(globals);
	ParserGeneric<SemaNamespace> parser(context, walker);

	cpp::symbol_sequence<cpp::declaration_seq> result(NULL);
	try
	{
		ProfileScope profile(gProfileParser);
		PROFILESCOPE_ENABLECOLLECTION(profile2);
		PARSE_SEQUENCE(parser, result);
	}
	catch(ParseError&)
	{
	}
	catch(SemanticError&)
	{
		printPosition(parser.context.getErrorPosition());
		std::cout << "caught SemanticError" << std::endl;
		throw;
	}
	catch(SymbolsError&)
	{
		printPosition(parser.context.getErrorPosition());
		std::cout << "caught SymbolsError" << std::endl;
		throw;
	}
	catch(TypeError& e)
	{
		e.report();
	}
	if(!context.finished())
	{
		printError(parser);
	}
	dumpProfile(gProfileIo);
	dumpProfile(gProfileWave);
	dumpProfile(gProfileParser);
	dumpProfile(gProfileLookup);
	dumpProfile(gProfileDiagnose);
	dumpProfile(gProfileAllocator);
	dumpProfile(gProfileIdentifier);
	dumpProfile(gProfileTemplateId);

	return result.get();
}
开发者ID:willjoseph,项目名称:cpparch-old,代码行数:51,代码来源:Sema.cpp


示例8: test_basic_profile_population

int test_basic_profile_population() {
    int fails=0;
    pstrudel::Profile   profile(0);
    std::vector<double> raw_data{3, 7, 9, 10};
    profile.set_data(raw_data.begin(), raw_data.end());
    raw_data.insert(raw_data.begin(), 0); // profile generation adds '0'
    fails += platypus::testing::compare_equal(
            raw_data,
            profile.get_profile(raw_data.size()),
            __FILE__,
            __LINE__,
            "incorrect raw-data sized profile");
    return fails;
}
开发者ID:jeetsukumaran,项目名称:pstrudel,代码行数:14,代码来源:profile_generation.cpp


示例9: test_basic_profile_interpolation

int test_basic_profile_interpolation() {
    int fails=0;
    pstrudel::Profile   profile(0);
    std::vector<double> raw_data{3, 7, 9, 10};
    profile.set_data(raw_data.begin(), raw_data.end());
    std::vector<double> expected{0, 1.5, 3, 5, 7, 8, 9, 9.5, 10};
    fails += platypus::testing::compare_equal(
            expected,
            profile.get_profile(raw_data.size() * 2),
            __FILE__,
            __LINE__,
            "incorrect interpolated profile");
    return fails;
}
开发者ID:jeetsukumaran,项目名称:pstrudel,代码行数:14,代码来源:profile_generation.cpp


示例10: profile

sk_sp<GrFragmentProcessor> GrCircleBlurFragmentProcessor::Make(GrResourceProvider* resourceProvider,
                                                               const SkRect& circle, float sigma) {
    float solidRadius;
    float textureRadius;
    sk_sp<GrTextureProxy> profile(create_profile_texture(resourceProvider, circle, sigma,
                                                         &solidRadius, &textureRadius));
    if (!profile) {
        return nullptr;
    }
    return sk_sp<GrFragmentProcessor>(new GrCircleBlurFragmentProcessor(resourceProvider,
                                                                        circle,
                                                                        textureRadius, solidRadius,
                                                                        std::move(profile)));
}
开发者ID:Wafflespeanut,项目名称:gecko-dev,代码行数:14,代码来源:GrCircleBlurFragmentProcessor.cpp


示例11: profile

//static
QPixmap KThumb::getImage(KUrl url, int frame, int width, int height)
{
    Mlt::Profile profile(KdenliveSettings::current_profile().toUtf8().constData());
    QPixmap pix(width, height);
    if (url.isEmpty()) return pix;

    //"<mlt><playlist><producer resource=\"" + url.path() + "\" /></playlist></mlt>");
    //Mlt::Producer producer(profile, "xml-string", tmp);
    Mlt::Producer *producer = new Mlt::Producer(profile, url.path().toUtf8().constData());
    double swidth = (double) profile.width() / profile.height();
    pix = QPixmap::fromImage(getFrame(producer, frame, (int) (height * swidth + 0.5), width, height));
    delete producer;
    return pix;
}
开发者ID:mcfrisk,项目名称:kdenlive,代码行数:15,代码来源:kthumb.cpp


示例12: throw

/** \brief function to test a pkttype_t
 */
nunit_res_t	pkttype_testclass_t::comparison(const nunit_testclass_ftor_t &testclass_ftor) throw()
{
	// log to debug
	KLOG_DBG("enter");
	// set variable
	pkttype_profile_t	profile(10, 2, pkttype_profile_t::UINT32);
	nunit_pkttype_t		pkttype = nunit_pkttype_t(profile).PKT_REQUEST();
	// do some comparison
	NUNIT_ASSERT( pkttype == pkttype.PKT_REQUEST() );
	NUNIT_ASSERT( pkttype != pkttype.PKT_REPLY() );
	NUNIT_ASSERT( pkttype <  pkttype.PKT_REPLY() );
	// return no error
	return NUNIT_RES_OK;
}
开发者ID:jeromeetienne,项目名称:neoip,代码行数:16,代码来源:neoip_pkttype_nunit.cpp


示例13: GateInit

 void GateInit(RTC::Manager* manager)
 {
   int i;
   for (i = 0; strlen(gate_spec[i]) != 0; i++);
   char** spec_intl = new char*[i + 1];
   for (int j = 0; j < i; j++) {
     spec_intl[j] = (char *)_(gate_spec[j]);
   }
   spec_intl[i] = (char *)"";
   coil::Properties profile((const char **)spec_intl);
   manager->registerFactory(profile,
                            RTC::Create<Gate>,
                            RTC::Delete<Gate>);
 }
开发者ID:Nobu19800,项目名称:OpenHRIAudio,代码行数:14,代码来源:Gate.cpp


示例14: PulseAudioInputInit

 void PulseAudioInputInit(RTC::Manager* manager)
 {
   int i;
   for (i = 0; strlen(pulseaudioinput_spec[i]) != 0; i++);
   char** spec_intl = new char*[i + 1];
   for (int j = 0; j < i; j++) {
     spec_intl[j] = _((char *)pulseaudioinput_spec[j]);
   }
   spec_intl[i] = (char *)"";
   coil::Properties profile((const char **)spec_intl);
   manager->registerFactory(profile,
                          RTC::Create<PulseAudioInput>,
                          RTC::Delete<PulseAudioInput>);
 }
开发者ID:SeishoIrie,项目名称:OpenHRIAudio,代码行数:14,代码来源:PulseAudioInput.cpp


示例15: throw

/** \brief Construct a bt_io_write_t request
 */
bt_io_write_t *	bt_io_cache_t::write_ctor(const file_range_t &totfile_range, const datum_t &data2write
					, bt_io_write_cb_t *callback, void *userptr)	throw()
{
	// if write-thru, simply forward to the subio_vapi
	if( profile().write_thru() ){
		// remove all bt_io_cache_block_t contained in this totfile_range
		// - NOTE: this ensure that previously-read data will not remain 
		block_remove_included_in(totfile_range);
		// simply return a write on the subio_vapi
		return subio_vapi()->write_ctor(totfile_range, data2write, callback, userptr);
	}
	// else it is write-delayed, and so use the bt_io_cache_write_t
	return nipmem_new bt_io_cache_write_t(this, totfile_range, data2write, callback, userptr);
}
开发者ID:jeromeetienne,项目名称:neoip,代码行数:16,代码来源:neoip_bt_io_cache.cpp


示例16: TH135LoadProfile

static void TH135LoadProfile()
{
#define LoadAddress(N) { TCHAR addrStr[16]; \
	s_##N = profile.ReadString(_T("Address"), _T(#N), _T(""), addrStr, sizeof addrStr); \
	if (!::StrToIntEx(addrStr, STIF_SUPPORT_HEX, reinterpret_cast<int *>(&s_##N))) s_##N = Default_##N;  }
#define LoadChar(N) profile.ReadString(_T("TH135"), _T(#N), Default_##N, s_##N, sizeof s_##N)

	Minimal::ProcessHeapPath profPath = g_appPath;
	CProfileIO profile(profPath /= _T("TH135Addr.ini"));
	LoadChar(WindowClass);
	LoadChar(WindowCaption);

	LoadAddress(CoreBase);
}
开发者ID:hxdnshx,项目名称:SolfiskMod,代码行数:14,代码来源:TH135Addr.cpp


示例17: main

void main(int argc, char** argv){
	gint isStd=1;
	gint suiteSize=0;
	if(argc>=2){
		isStd=atoi(argv[1]);
		if(argc>=3){
			TESTCASEDIR=argv[2];
			if(argc>=4){
				CURRDIR=argv[3];
				if(argc>=5){
					timeout_sec=atof(argv[4]);
					if(argc>=6){
						suiteSize=atoi(argv[5]);
					
					}
				}
				else{
					timeout_sec=TIMEOUT;
				}
			}
			else{
				CURRDIR=DEFAULT_CURR_DIR;
				timeout_sec=TIMEOUT;
			}
		}
		else{
			TESTCASEDIR=DEFAULT_TESTCASES_DIR;
			CURRDIR=DEFAULT_CURR_DIR;
			timeout_sec=TIMEOUT;
		}
	}
	else{
		isStd=1;
		CURRDIR=DEFAULT_CURR_DIR;
		TESTCASEDIR=DEFAULT_TESTCASES_DIR;
		timeout_sec=TIMEOUT;
	}

	randomUtility=g_rand_new();
	logfp=fopen("memoryLog.txt", "w+");
	readTestcases();
fprintf(logfp, "timeout_sec=%lf\n", timeout_sec);
fflush(logfp);
	double time=0, time_usr=0, time_sys=0, memory=0, correctness=0;
	profile(&time_usr, &time_sys, &memory, &correctness, suiteSize, isStd);
	freeTestcases();
	fclose(logfp);
	g_rand_free(randomUtility);
}
开发者ID:FanWuUCL,项目名称:HOMI,代码行数:49,代码来源:memory.c


示例18: profile

void BronchoscopyRegistrationWidget::setup()
{
	mOptions = profile()->getXmlSettings().descend("bronchoscopyregistrationwidget");

	mSelectMeshWidget = StringPropertySelectMesh::New(mServices->patient());
	mSelectMeshWidget->setValueName("Centerline: ");

	//this->initializeTrackingService();

	connect(mServices->patient().get(),&PatientModelService::patientChanged,this,&BronchoscopyRegistrationWidget::clearDataOnNewPatient);

	mProcessCenterlineButton = new QPushButton("Process centerline");
	connect(mProcessCenterlineButton, SIGNAL(clicked()), this, SLOT(processCenterlineSlot()));
	mProcessCenterlineButton->setToolTip(this->defaultWhatsThis());

//	mBronchoscopeRegistrationPtr = BronchoscopeRegistrationPtr(new BronchoscopePositionProjection());
//	mProjectionCenterlinePtr->createMaxDistanceToCenterlineOption(mOptions.getElement());

	mRegisterButton = new QPushButton("Register");
	connect(mRegisterButton, SIGNAL(clicked()), this, SLOT(registerSlot()));
	mRegisterButton->setToolTip(this->defaultWhatsThis());

	mRecordTrackingWidget = new RecordTrackingWidget(mOptions.descend("recordTracker"),
													 mServices->acquisition(), mServices,
													 "bronc_path",
													 this);
	mRecordTrackingWidget->getSessionSelector()->setHelp("Select bronchoscope path for registration");
	mRecordTrackingWidget->getSessionSelector()->setDisplayName("Bronchoscope path");

	mVerticalLayout->setMargin(0);
	mVerticalLayout->addWidget(new DataSelectWidget(mServices->view(), mServices->patient(), this, mSelectMeshWidget));

	this->selectSubsetOfBranches(mOptions.getElement());
	this->createMaxNumberOfGenerations(mOptions.getElement());
	this->useLocalRegistration(mOptions.getElement());
	this->createMaxLocalRegistrationDistance(mOptions.getElement());

//	PropertyPtr maxLocalRegistrationDistance = mProjectionCenterlinePtr->getMaxLocalRegistrationDistanceOption();

	mVerticalLayout->addWidget(new CheckBoxWidget(this, mUseSubsetOfGenerations));
	mVerticalLayout->addWidget(createDataWidget(mServices->view(), mServices->patient(), this, mMaxNumberOfGenerations));
	mVerticalLayout->addWidget(mProcessCenterlineButton);
	mVerticalLayout->addWidget(mRecordTrackingWidget);
	mVerticalLayout->addWidget(new CheckBoxWidget(this, mUseLocalRegistration));
	mVerticalLayout->addWidget(createDataWidget(mServices->view(), mServices->patient(), this, mMaxLocalRegistrationDistance));
	mVerticalLayout->addWidget(mRegisterButton);

	mVerticalLayout->addStretch();
}
开发者ID:SINTEFMedtek,项目名称:CustusX,代码行数:49,代码来源:cxBronchoscopyRegistrationWidget.cpp


示例19: profile

void KImportDlg::slotBrowse()
{
  // determine what the browse prefix should be from the current profile

  MyMoneyQifProfile tmpprofile;
  tmpprofile.loadProfile("Profile-" + profile());

  QUrl file = QFileDialog::getOpenFileUrl(this, i18n("Import File..."), QUrl("kfiledialog:///kmymoney-import"),
      i18n("Import files (%1);;All files (%2)", tmpprofile.filterFileType(), "*")
  );

  if (!file.isEmpty()) {
    m_qlineeditFile->setText(file.toDisplayString(QUrl::PreferLocalFile));
  }
}
开发者ID:KDE,项目名称:kmymoney,代码行数:15,代码来源:kimportdlg.cpp


示例20: profile

//---------------------------------------------------------------------
void line_profile_aa::set(double center_width, double smoother_width) {
  double base_val = 1.0;
  if (center_width == 0.0) center_width = 1.0 / subpixel_scale;
  if (smoother_width == 0.0) smoother_width = 1.0 / subpixel_scale;

  double width = center_width + smoother_width;
  if (width < m_min_width) {
    double k = width / m_min_width;
    base_val *= k;
    center_width /= k;
    smoother_width /= k;
  }

  value_type* ch = profile(center_width + smoother_width);

  unsigned subpixel_center_width = unsigned(center_width * subpixel_scale);
  unsigned subpixel_smoother_width = unsigned(smoother_width * subpixel_scale);

  value_type* ch_center = ch + subpixel_scale * 2;
  value_type* ch_smoother = ch_center + subpixel_center_width;

  unsigned i;

  unsigned val = m_gamma[unsigned(base_val * aa_mask)];
  ch = ch_center;
  for (i = 0; i < subpixel_center_width; i++) {
    *ch++ = (value_type)val;
  }

  for (i = 0; i < subpixel_smoother_width; i++) {
    *ch_smoother++ = m_gamma[unsigned(
        (base_val - base_val * (double(i) / subpixel_smoother_width)) *
        aa_mask)];
  }

  unsigned n_smoother = profile_size() - subpixel_smoother_width -
                        subpixel_center_width - subpixel_scale * 2;

  val = m_gamma[0];
  for (i = 0; i < n_smoother; i++) {
    *ch_smoother++ = (value_type)val;
  }

  ch = ch_center;
  for (i = 0; i < subpixel_scale * 2; i++) {
    *--ch = *ch_center++;
  }
}
开发者ID:UIKit0,项目名称:agg,代码行数:49,代码来源:agg_line_profile_aa.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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