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


C++ rp函数代码示例

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


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

示例1: pannel_spectra_vs_centrality

void pannel_spectra_vs_centrality( string energy = "14.5" ){
	gStyle->SetTitleSize( 0.25, "t" );
	gStyle->SetTitleX( 0.92 );

	Reporter rp( "_tmp.pdf", 1100, 800 );
	rp.newPage( 3, 2, 0, 0 );

	
	
	
	rp.cd( 1, 1 );

	for ( string charge : { "p", "n" } ){
		for ( string plc : { "Pi", "K", "P" } ){
			
			if ( "Pi" == plc ){
				gPad->SetLeftMargin( 0.19 );
			}
			if ( "n" == charge ){
				gPad->SetBottomMargin( 0.19 );
			}

			draw_spectra_vs_centrality( energy, plc, charge );
			
			if ( plc == "P" && charge == "n" )
				rp.saveImage( "img/pannel_spectra_" + energy + ".pdf" );

			rp.next();
		}
	}

}
开发者ID:jdbrice,项目名称:rcpMaker,代码行数:32,代码来源:pannel_spectra_vs_centrality.C

示例2: qDebug

void ScriptResolver::handleMsg( const QByteArray& msg )
{
    qDebug() << Q_FUNC_INFO << msg.size() << QString::fromAscii(msg);
    bool ok;
    QVariant v = m_parser.parse( msg, &ok );
    if( !ok || v.type() != QVariant::Map )
    {
        Q_ASSERT(false);
        return;
    }
    QVariantMap m = v.toMap();
    const QString& msgtype = m.value( "_msgtype" ).toString();

    if( msgtype == "settings" )
    {
        doSetup( m );
        return;
    }

    if( msgtype == "results" )
    {
        QList< Tomahawk::result_ptr > results;
        const QString& qid = m.value( "qid" ).toString();
        const QVariantList& reslist = m.value( "results" ).toList();
        Tomahawk::collection_ptr coll = SourceList::instance()->getLocal()->collection();
        foreach( const QVariant& rv, reslist )
        {
            qDebug() << "RES" << rv;
            Tomahawk::result_ptr rp( new Tomahawk::Result() );
            rp->setCollection( coll );
            results << rp;
        }
开发者ID:hatstand,项目名称:tomahawk,代码行数:32,代码来源:scriptresolver.cpp

示例3: rp

void Module::Interface::StopCommunication(Kernel::HLERequestContext& ctx) {
    IPC::RequestParser rp(ctx, 0x04, 0, 0);

    IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
    rb.Push(RESULT_SUCCESS);
    LOG_WARNING(Service_NFC, "(STUBBED) called");
}
开发者ID:DaMan69,项目名称:citra,代码行数:7,代码来源:nfc.cpp

示例4: LoximException

	void SignalRouter::spawn_and_register(StartableSignalReceiver
			&recv, const sigset_t &mask, const vector<int>
			&signals)
	{
		sigset_t block_mask;
		int lerror;
		if (sigfillset(&block_mask))
			throw new LoximException(errno);
		shared_ptr<Receiver> r(new Receiver(recv, mask, signals));
		auto_ptr<shared_ptr<Receiver> > rp(new
				shared_ptr<Receiver>(r));
		Mutex::Locker l(r->mutex);
		{
			Masker m(block_mask);
			if ((lerror = pthread_create(&(recv.get_thread()),
							NULL,
							SignalRouter::starter,
							rp.get()))) {
				throw LoximException(lerror);
			}

		}
		l.wait(r->cond);
		if (r->error)
			throw LoximException(r->error);
	}
开发者ID:ptryfon,项目名称:loxim-stats,代码行数:26,代码来源:SignalRouter.cpp

示例5: p

void bv_simplifier_params::updt_params(params_ref const & _p) {
    bv_simplifier_params_helper p(_p);
    bv_rewriter_params rp(_p);
    m_hi_div0 = rp.hi_div0();
    m_bv2int_distribute = p.bv_bv2int_distribute();

}
开发者ID:AleksandarZeljic,项目名称:z3,代码行数:7,代码来源:bv_simplifier_params.cpp

示例6: rp

void GSP_GPU::RegisterInterruptRelayQueue(Kernel::HLERequestContext& ctx) {
    IPC::RequestParser rp(ctx, 0x13, 1, 2);
    u32 flags = rp.Pop<u32>();

    auto interrupt_event = rp.PopObject<Kernel::Event>();
    // TODO(mailwl): return right error code instead assert
    ASSERT_MSG((interrupt_event != nullptr), "handle is not valid!");

    interrupt_event->SetName("GSP_GSP_GPU::interrupt_event");

    SessionData* session_data = GetSessionData(ctx.Session());
    session_data->interrupt_event = std::move(interrupt_event);
    session_data->registered = true;

    IPC::RequestBuilder rb = rp.MakeBuilder(2, 2);

    if (first_initialization) {
        // This specific code is required for a successful initialization, rather than 0
        first_initialization = false;
        rb.Push(RESULT_FIRST_INITIALIZATION);
    } else {
        rb.Push(RESULT_SUCCESS);
    }

    rb.Push(session_data->thread_id);
    rb.PushCopyObjects(shared_memory);

    LOG_DEBUG(Service_GSP, "called, flags=0x{:08X}", flags);
}
开发者ID:citra-emu,项目名称:citra,代码行数:29,代码来源:gsp_gpu.cpp

示例7: rp

void Module::Interface::UnscrambleLocalFriendCode(Kernel::HLERequestContext& ctx) {
    const std::size_t scrambled_friend_code_size = 12;
    const std::size_t friend_code_size = 8;

    IPC::RequestParser rp(ctx, 0x1C, 1, 2);
    const u32 friend_code_count = rp.Pop<u32>();
    std::vector<u8> scrambled_friend_codes = rp.PopStaticBuffer();
    ASSERT_MSG(scrambled_friend_codes.size() == (friend_code_count * scrambled_friend_code_size),
               "Wrong input buffer size");

    std::vector<u8> unscrambled_friend_codes(friend_code_count * friend_code_size, 0);
    // TODO(B3N30): Unscramble the codes and compare them against the friend list
    //              Only write 0 if the code isn't in friend list, otherwise write the
    //              unscrambled one
    //
    // Code for unscrambling (should be compared to HW):
    // std::array<u16, 6> scambled_friend_code;
    // Memory::ReadBlock(scrambled_friend_codes+(current*scrambled_friend_code_size),
    // scambled_friend_code.data(), scrambled_friend_code_size); std::array<u16, 4>
    // unscrambled_friend_code; unscrambled_friend_code[0] = scambled_friend_code[0] ^
    // scambled_friend_code[5]; unscrambled_friend_code[1] = scambled_friend_code[1] ^
    // scambled_friend_code[5]; unscrambled_friend_code[2] = scambled_friend_code[2] ^
    // scambled_friend_code[5]; unscrambled_friend_code[3] = scambled_friend_code[3] ^
    // scambled_friend_code[5];

    LOG_WARNING(Service_FRD, "(STUBBED) called");
    IPC::RequestBuilder rb = rp.MakeBuilder(1, 2);
    rb.Push(RESULT_SUCCESS);
    rb.PushStaticBuffer(unscrambled_friend_codes, 0);
}
开发者ID:Dragios,项目名称:Citra,代码行数:30,代码来源:frd.cpp

示例8: fromHistoryItem

LRESULT CHistoryWindow::OnViewBBCode(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
{
	TreeItem* item = m_treeView.selectedItem();
	if(!item) return 0;
	CAtlArray<CUrlListItem> items;

	if(item->level()==0)
	{
		CHistorySession* ses = reinterpret_cast<CHistorySession*>(item->userData());
		for(int i=0; i<ses->entriesCount(); i++)
		{
			CUrlListItem it  =fromHistoryItem(ses->entry(i));
			items.Add(it);
		}
	}
	else
	{
		HistoryItem* hit = reinterpret_cast<HistoryItem*>(item->userData());
		CUrlListItem it  = fromHistoryItem(*hit);
		items.Add(it);
	}
	CResultsWindow rp( pWizardDlg, items,false);
	rp.DoModal(m_hWnd);
	return 0;
}
开发者ID:wchingwei,项目名称:image-uploader,代码行数:25,代码来源:HistoryWindow.cpp

示例9: ptr

    bool
    KeyToKey::call_remap_with_VK_PSEUDO_KEY(EventType eventType)
    {
      bool result = false;

      // ----------------------------------------
      if (eventType == EventType::DOWN) {
        FlagStatus::globalFlagStatus().lazy_enable();
      } else {
        FlagStatus::globalFlagStatus().lazy_disable_if_off();
      }

      // ----------------------------------------
      Params_KeyboardEventCallBack::auto_ptr ptr(Params_KeyboardEventCallBack::alloc(eventType,
                                                                                     FlagStatus::globalFlagStatus().makeFlags(),
                                                                                     KeyCode::VK_PSEUDO_KEY,
                                                                                     CommonData::getcurrent_keyboardType(),
                                                                                     false));
      if (! ptr) return false;
      Params_KeyboardEventCallBack& params = *ptr;

      ParamsUnion paramsUnion(params);
      RemapParams rp(paramsUnion);
      result = remap(rp);

      return result;
    }
开发者ID:rjocoleman,项目名称:Karabiner,代码行数:27,代码来源:KeyToKey.cpp

示例10: SpectralStatistics

void SpectralStatistics(std::vector<PointSet> &sets, int npoints, Statistics *stats) {
    // We need the full radial power spectrum, so for performance reasons, we
    // derive the radial power spectrum directly from full RDFs here
    const int nsets = (int) sets.size();
    const int nbins = 100 * sqrtf(npoints);
    Curve avgrp(nbins, 0, 0.5f * npoints);
    Curve rdf(nbins, 0, 0.5f);
    Curve rp(nbins, 0, 0.5f * npoints);
    
    if (nsets > 1) PrintProgress("Stats", 0);
    for (int i = 0; i < nsets; ++i) {
        rdf.SetZero();
        sets[i].RDF(&rdf);
        
        rp.SetZero();
        RDFtoRP(rdf, npoints, &rp);
        avgrp.Accumulate(rp);
        
        if (nsets > 1) PrintProgress("Stats", (i+1) / (float) nsets);
    }
    avgrp.Divide(sets.size());
    if (nsets > 1) std::cout << std::endl;
    
    stats->effnyquist = EffectiveNyquist(avgrp, npoints);
    stats->oscillations = OscillationsMetric(avgrp, npoints);
}
开发者ID:joeedh,项目名称:psa,代码行数:26,代码来源:statistics.cpp

示例11: lmNew

    BitmapData* BitmapData::diff(const BitmapData* a, const BitmapData* b)
    {
        if (a->w != b->w || a->h != b->h)
            return NULL;

        BitmapData* result = lmNew(NULL) BitmapData(
            (size_t)a->w,
            (size_t)a->h
        );

        if (result == NULL) {
            lmLogError(gGFXLogGroup, "Unable to allocate memory for BitmapData diff result");
            return NULL;
        }

        rgba_t* pixelptr_a = reinterpret_cast<rgba_t*>(a->data);
        rgba_t* pixelptr_b = reinterpret_cast<rgba_t*>(b->data);
        rgba_t* resultptr = reinterpret_cast<rgba_t*>(result->data);

        for (size_t i = 0; i < a->w * a->h; i++)
        {
            Color ap(convertHostToBEndian(pixelptr_a[i]));
            Color bp(convertHostToBEndian(pixelptr_b[i]));
            Color rp(fabsf(ap.r - bp.r), fabsf(ap.g - bp.g), fabsf(ap.b - bp.b), 1.0f);
            rgba_t a = rp.getHex();
            resultptr[i] = convertBEndianToHost(a);
        }

        return result;
    }
开发者ID:Y-way,项目名称:LoomSDK,代码行数:30,代码来源:gfxBitmapData.cpp

示例12: SetDitheringWeightParams

static void SetDitheringWeightParams(Interface* self) {
    IPC::RequestParser rp(Kernel::GetCommandBuffer(), 0x24, 8, 0); // 0x240200
    rp.PopRaw(dithering_weight_params);
    IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
    rb.Push(RESULT_SUCCESS);

    LOG_DEBUG(Service_Y2R, "called");
}
开发者ID:emmauss,项目名称:citra,代码行数:8,代码来源:y2r_u.cpp

示例13: run

 void run() {
     ReplPair rp( "a", "b" );
     rp.setMaster( ReplPair::State_CantArb, "foo" );
     ASSERT( rp.state == ReplPair::State_CantArb );
     ASSERT_EQUALS( rp.info , "foo" );
     rp.setMaster( ReplPair::State_Confused, "foo" );
     ASSERT( rp.state == ReplPair::State_Confused );
 }
开发者ID:BendustiK,项目名称:mongo,代码行数:8,代码来源:pairingtests.cpp

示例14: qDebug

void
ScriptEngine::resolve( const Tomahawk::query_ptr& query )
{
    qDebug() << Q_FUNC_INFO << query->toString();
    QString eval = QString( "resolve( '%1', '%2', '%3', '%4' );" )
                      .arg( query->id().replace( "'", "\\'" ) )
                      .arg( query->artist().replace( "'", "\\'" ) )
                      .arg( query->album().replace( "'", "\\'" ) )
                      .arg( query->track().replace( "'", "\\'" ) );

    QList< Tomahawk::result_ptr > results;

    QVariantMap m = mainFrame()->evaluateJavaScript( eval ).toMap();
    qDebug() << "JavaScript Result:" << m;

    const QString qid = query->id();
    const QVariantList reslist = m.value( "results" ).toList();

    foreach( const QVariant& rv, reslist )
    {
        QVariantMap m = rv.toMap();
        qDebug() << "RES" << m;

        Tomahawk::result_ptr rp( new Tomahawk::Result() );
        Tomahawk::artist_ptr ap = Tomahawk::Artist::get( 0, m.value( "artist" ).toString() );
        rp->setArtist( ap );
        rp->setAlbum( Tomahawk::Album::get( 0, m.value( "album" ).toString(), ap ) );
        rp->setTrack( m.value( "track" ).toString() );
        rp->setBitrate( m.value( "bitrate" ).toUInt() );
        rp->setUrl( m.value( "url" ).toString() );
        rp->setSize( m.value( "size" ).toUInt() );
        rp->setScore( m.value( "score" ).toFloat() * ( (float)m_parent->weight() / 100.0 ) );
        rp->setRID( uuid() );
        rp->setFriendlySource( m_parent->name() );

        if ( m.contains( "year" ) )
        {
            QVariantMap attr;
            attr[ "releaseyear" ] = m.value( "year" );
            rp->setAttributes( attr );
        }

        rp->setDuration( m.value( "duration", 0 ).toUInt() );
        if ( rp->duration() <= 0 && m.contains( "durationString" ) )
        {
            QTime time = QTime::fromString( m.value( "durationString" ).toString(), "hh:mm:ss" );
            rp->setDuration( time.secsTo( QTime( 0, 0 ) ) * -1 );
        }

        rp->setMimetype( m.value( "mimetype" ).toString() );
        if ( rp->mimetype().isEmpty() )
        {
            rp->setMimetype( TomahawkUtils::extensionToMimetype( m.value( "extension" ).toString() ) );
            Q_ASSERT( !rp->mimetype().isEmpty() );
        }

        results << rp;
    }
开发者ID:tdfischer,项目名称:tomahawk,代码行数:58,代码来源:qtscriptresolver.cpp

示例15: rp

void Module::Interface::GetTotalStepCount(Kernel::HLERequestContext& ctx) {
    IPC::RequestParser rp(ctx, 0xC, 0, 0);

    IPC::RequestBuilder rb = rp.MakeBuilder(2, 0);
    rb.Push(RESULT_SUCCESS);
    rb.Push<u32>(0);

    LOG_WARNING(Service_PTM, "(STUBBED) called");
}
开发者ID:Dragios,项目名称:Citra,代码行数:9,代码来源:ptm.cpp


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