当前位置: 首页>>代码示例>>C++>>正文


C++ profile函数代码示例

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


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


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