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

C++ sigc::signal类代码示例

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

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



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

示例1: Gui_DisplayFrame

 Gui_DisplayFrame(Gui_ProcessorHandler& processor_hand,sigc::signal<void,bool,double> signal_show_decor,sigc::signal<void,bool> signal_show_mask):
 m_display(processor_hand){
     DEV_INFOS("building graphical display frame");
     this->add(m_display);
     signal_show_decor.connect( sigc::mem_fun(this,&Gui_DisplayFrame::on_show_deco));
     signal_show_mask.connect( sigc::mem_fun(this,&Gui_DisplayFrame::on_show_mask));
 }
开发者ID:IsaacLuo,项目名称:OpenCFU,代码行数:7,代码来源:Gui_Display.hpp


示例2: test_customMonitorOperation_monitorin

void Admintest::test_customMonitorOperation_monitorin()
{
    // Check that Dispatching in not yet connected
    assert(m_server->m_world.Dispatching.slots().begin() ==
                 m_server->m_world.Dispatching.slots().end());

    // Set it up so it is already monitoring
    m_account->m_monitorConnection =
          null_signal.connect(sigc::mem_fun(this, &Admintest::null_method));
    ASSERT_TRUE(m_account->m_monitorConnection.connected());

    Atlas::Objects::Operation::Monitor op;
    OpVector res;

    Root arg;
    op->setArgs1(arg);

    m_account->customMonitorOperation(op, res);

    ASSERT_TRUE(m_account->m_monitorConnection.connected());

    // Check that Dispatching in not been connected
    assert(m_server->m_world.Dispatching.slots().begin() ==
                 m_server->m_world.Dispatching.slots().end());

}
开发者ID:cyclefusion,项目名称:cyphesis,代码行数:26,代码来源:Admintest.cpp


示例3: on_limits_changed

      void on_limits_changed()
      {
	magnet::gtk::forceNumericEntry(_minValue);
	try { _min = boost::lexical_cast<GLfloat>(_minValue.get_text()); } catch(...) {}
	magnet::gtk::forceNumericEntry(_maxValue);
	try { _max = boost::lexical_cast<GLfloat>(_maxValue.get_text()); } catch(...) {}
	_signal_changed.emit();
      }
开发者ID:armando-2011,项目名称:DynamO,代码行数:8,代码来源:colorMapSelector.hpp


示例4: mMode

ObjectManager::ObjectManager( Mode mode, RakNet::RakNetGUID ownGUID, RakNet::RakNetGUID serverGUID,
    sigc::signal<void>& rUpdateSignal, sigc::signal<void>& rLateUpdateSignal, 
    ObjectTemplateManager& rObjectTemplateManager, RakNet::ReplicaManager3& rReplicaManager, 
    RakNet::NetworkIDManager& rNetworkIDManager, RakNet::RPC3& rRPC3, bool offlineMode /*= false*/ ): 
    mMode( mode ),
    mOfflineMode( offlineMode ),
    mOwnGUID( ownGUID ),
    mServerGUID( serverGUID ),
    mUpdateSignal( rUpdateSignal ),
    mObjectTemplateManager( rObjectTemplateManager ),
    mReplicaManager( rReplicaManager ),
    mNetworkIDManager( rNetworkIDManager ),
    mRPC3( rRPC3 )
{
    mUpdateConnection = rUpdateSignal.connect( sigc::mem_fun( this, &ObjectManager::update ) );
    mUpdateConnection.block( true );
    rLateUpdateSignal.connect( sigc::mem_fun( this, &ObjectManager::lateUpdate ) );
}
开发者ID:Gohla,项目名称:Diversia,代码行数:18,代码来源:ObjectManager.cpp


示例5:

/** \brief  A function to respond to the value_changed signal from the
            adjustment.

    This function just grabs the value from the adjustment and writes
    it to the parameter.  Very simple, but yet beautiful.
*/
void
ParamFloatAdjustment::val_changed (void)
{
    //std::cout << "Value Changed to: " << this->get_value() << std::endl;
    _pref->set(this->get_value(), _doc, _node);
    if (_changeSignal != NULL) {
        _changeSignal->emit();
    }
    return;
}
开发者ID:loveq369,项目名称:DoonSketch,代码行数:16,代码来源:float.cpp


示例6: mRakPeer

ClientConnection::ClientConnection( sigc::signal<void>& rUpdateSignal ):
    mRakPeer( *RakNet::RakPeerInterface::GetInstance() )
{
    LOGI << "Initializing client connection";

    rUpdateSignal.connect( sigc::mem_fun( this, &ClientConnection::update ) );

    mRPC3.SetNetworkIDManager( &mNetworkIDManager );
    mReplicaManager.SetNetworkIDManager( &mNetworkIDManager );
    mRakPeer.AttachPlugin( &mRPC3 );
    mRakPeer.AttachPlugin( &mReplicaManager );

    // Initialize plugin manager
    mPluginManager = new ClientPluginManager( SERVER, rUpdateSignal, mRakPeer, 
        mReplicaManager, mNetworkIDManager, mRPC3 );
    mReplicaManager.setPluginManager( *mPluginManager );

    // Initialize user manager
    mSessionManager.reset( new SessionManager( mUserManager, *mPluginManager, 
        rUpdateSignal ) );

    // Initialize permission manager
    PermissionManager& permissionManager = mPluginManager->createPlugin<PermissionManager>();
    permissionManager.setSessionManager( *mSessionManager.get() );

    // Connect to plugin change signal to set the object manager when it's created.
    mPluginChangeConnection = mPluginManager->connect( sigc::mem_fun( this, 
        &ClientConnection::pluginChange ) );

    // Load all other plugins and set configuration for them. Copy vector to set to remove
    // duplicates and fix the load order.
    std::set<ClientServerPluginTypeEnum> plugins;
    std::copy( msSettings.mPlugins.begin(), msSettings.mPlugins.end(), std::inserter( plugins, 
        plugins.end() ) );
    for( std::set<ClientServerPluginTypeEnum>::iterator i = plugins.begin(); i!= plugins.end(); 
        ++i )
    {
        ClientServerPlugin& plugin = mPluginManager->createPlugin( *i );
        LOGI << "Loading client-server plugin: " << plugin.getTypeName();
        Globals::mConfig->registerObject( plugin );
    }
    
    // Load user settings after loading all plugins (PermissionManager), so default permissions get 
    // overridden.
    Globals::mConfig->registerObject( mUserManager );

    Globals::mClient = this;

    Globals::mLua->object( "ClientConnection" ) = this;
}
开发者ID:Gohla,项目名称:Diversia,代码行数:50,代码来源:ClientConnection.cpp


示例7:

Gui_ResultFrame::Gui_ResultFrame(Gui_ProcessorHandler& processor_hand, sigc::signal<void,bool>& signal_set_to_NA, ResultMap& result_map):
    m_result_map(result_map),
    m_processor_hand(processor_hand),
    m_result_display(m_signal_update_result_map, m_result_map),
    m_result_detail(m_signal_update_result_map,m_signal_select_object,m_signal_toggle_object, m_result_map),
    m_user_filter(m_processor_hand)
{
    DEV_INFOS("RESUlt frame");
    this->pack1(m_result_display);
    this->pack2(m_result_detail);
    processor_hand.signal_state().connect( sigc::mem_fun(*this,&Gui_ResultFrame::on_processor_idle));
    signal_set_to_NA.connect( sigc::mem_fun(*this,&Gui_ResultFrame::on_set_current_to_NA));
    m_signal_toggle_object.connect( sigc::mem_fun(m_user_filter,&Gui_UserFilterSetter::on_toggle_object));
//    signal_set_to_NA.connect( sigc::mem_fun(m_result_display,&Gui_ResultListDisplay::on_setToNA));
    DEV_INFOS("RESUlt frame OK");
}
开发者ID:IsaacLuo,项目名称:OpenCFU,代码行数:16,代码来源:Gui_ResultFrame.cpp


示例8: test_opDispatched

void Admintest::test_opDispatched()
{
    Link_sent_called = false;

    m_account->m_monitorConnection =
          null_signal.connect(sigc::mem_fun(this, &Admintest::null_method));
    ASSERT_TRUE(m_account->m_monitorConnection.connected());

    Operation op;

    m_account->opDispatched(op);

    // The account is connected, so calling this should not affect the signal
    ASSERT_TRUE(m_account->m_monitorConnection.connected());

    // The operation should have been sent here
    ASSERT_TRUE(Link_sent_called);
}
开发者ID:cyclefusion,项目名称:cyphesis,代码行数:18,代码来源:Admintest.cpp


示例9: test_opDispatched_unconnected_monitored

void Admintest::test_opDispatched_unconnected_monitored()
{
    m_account->m_connection = 0;

    Link_sent_called = false;

    m_account->m_monitorConnection =
          null_signal.connect(sigc::mem_fun(this, &Admintest::null_method));
    ASSERT_TRUE(m_account->m_monitorConnection.connected());

    Operation op;

    m_account->opDispatched(op);

    // The account is unconnected, so calling opDispatched should not
    // cause the signal to get cut off
    ASSERT_TRUE(!m_account->m_monitorConnection.connected());

    // The operation should not have been sent here
    ASSERT_TRUE(!Link_sent_called);
}
开发者ID:cyclefusion,项目名称:cyphesis,代码行数:21,代码来源:Admintest.cpp


示例10: AfterTerrainUpdateListener

	AfterTerrainUpdateListener(sigc::signal<void, const std::vector<WFMath::AxisBox<2>>&, const std::set<TerrainPage*>&>& event)
	{
		event.connect(sigc::mem_fun(*this, &AfterTerrainUpdateListener::eventListener));
	}
开发者ID:Chimangoo,项目名称:ember,代码行数:4,代码来源:TestTerrain.cpp


示例11: WorldSizeChangedListener

	WorldSizeChangedListener(sigc::signal<void>& event)
	{
		event.connect(sigc::mem_fun(*this, &WorldSizeChangedListener::eventListener));
	}
开发者ID:Chimangoo,项目名称:ember,代码行数:4,代码来源:TestTerrain.cpp


示例12: on_combobox_changed

      void on_combobox_changed()
      {
	::Gtk::TreeModel::iterator iter = _comboBox.get_active();
	if (iter) _mode = ((*iter)[m_Columns.m_col_id]);
	_signal_changed.emit();
      }
开发者ID:armando-2011,项目名称:DynamO,代码行数:6,代码来源:colorMapSelector.hpp


示例13: sleep

void
Transmitter::run(void)
{
    sleep(2);
    m_slot.emit(m_origin); // Emit the signal
}
开发者ID:petesh,项目名称:sigc--2.0-example,代码行数:6,代码来源:example3.cpp


示例14: mMoveAdapter

EntityMoveInstance::EntityMoveInstance(EmberEntity& entity, MovementAdapter& moveAdapter, sigc::signal<void>& eventFinishedMoving, sigc::signal<void>& eventCancelledMoving) :
	EntityObserverBase(entity, true), mMoveAdapter(moveAdapter)
{
	eventCancelledMoving.connect(sigc::mem_fun(*this, &EntityObserverBase::deleteOurselves));
	eventFinishedMoving.connect(sigc::mem_fun(*this, &EntityObserverBase::deleteOurselves));
}
开发者ID:Chimangoo,项目名称:ember,代码行数:6,代码来源:EntityMoveManager.cpp


示例15: loop

void Interactive::loop()
{
    if (rl_bind_keyseq("`", &context_switch) != 0) {
        std::cout << "BINDING FAILED" << std::endl;
    }
    rl_callback_handler_install(m_prompt.c_str(),
                                &Interactive::gotCommand);
    rl_completion_entry_function = &completion_generator;
    CmdLine.connect(sigc::mem_fun(this, &Interactive::runCommand));
    ContextSwitch.connect(sigc::mem_fun(this, &Interactive::switchContext));
    while (select() == 0);
    std::cout << std::endl << std::flush;
    rl_callback_handler_remove();
}
开发者ID:9cat,项目名称:cyphesis,代码行数:14,代码来源:Interactive.cpp


示例16:

/**
 * Respond to the text box changing.
 *
 * This function responds to the box changing by grabbing the value
 * from the text box and putting it in the parameter.
 */
void
ParamComboBoxEntry::changed (void)
{
    Glib::ustring data = this->get_active_text();
    _pref->set(data.c_str(), _doc, _node);
    if (_changeSignal != NULL) {
        _changeSignal->emit();
    }
}
开发者ID:AakashDabas,项目名称:inkscape,代码行数:15,代码来源:enum.cpp


示例17:

/** \brief  Respond to the selected radiobutton changing

    This function responds to the radiobutton selection changing by grabbing the value
    from the text box and putting it in the parameter.
*/
void
ParamRadioButtonWdg::changed (void)
{
    if (this->get_active()) {
        Glib::ustring data = this->get_label();
        _pref->set(data.c_str(), _doc, _node);
    }
    if (_changeSignal != NULL) {
        _changeSignal->emit();
    }
}
开发者ID:wdmchaft,项目名称:DoonSketch,代码行数:16,代码来源:radiobutton.cpp


示例18: setControlSize

void ControlManagerImpl::setControlSize(int size, bool force)
{
    if ((size < 1) || (size > 7)) {
        g_warning("Illegal logical size set: %d", size);
    } else if (force || (size != _size)) {
        _size = size;

        for (std::vector<SPCanvasItem *>::iterator it = _itemList.begin(); it != _itemList.end(); ++it)
        {
            if (*it) {
                updateItem(*it);
            }
        }

        _sizeChangedSignal.emit();
    }
}
开发者ID:Drooids,项目名称:inkscape,代码行数:17,代码来源:control-manager.cpp


示例19: OnClickCancel

	void OnClickCancel() {
		onClickCancel.emit();
	}
开发者ID:johnuk89,项目名称:pioneer,代码行数:3,代码来源:GameMenuView.cpp


示例20: context_switch

static int context_switch(int a, int b)
{
    ContextSwitch.emit(a, b);
    return 0;
}
开发者ID:9cat,项目名称:cyphesis,代码行数:5,代码来源:Interactive.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ silbasicblock::iterator类代码示例发布时间:2022-05-31
下一篇:
C++ sigc::connection类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap