本文整理汇总了C++中sigc::signal::connect方法的典型用法代码示例。如果您正苦于以下问题:C++ signal::connect方法的具体用法?C++ signal::connect怎么用?C++ signal::connect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sigc::signal
的用法示例。
在下文中一共展示了signal::connect方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
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));
}
示例2: 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();
}
示例3: 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());
}
示例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 ) );
}
示例5: 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;
}
示例6:
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");
}
示例7: 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);
}
示例8: 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);
}
示例9: 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));
}
示例10: connectCtrlSizeChanged
sigc::connection ControlManagerImpl::connectCtrlSizeChanged(const sigc::slot<void> &slot)
{
return _sizeChangedSignal.connect(slot);
}
示例11:
AfterTerrainUpdateListener(sigc::signal<void, const std::vector<WFMath::AxisBox<2>>&, const std::set<TerrainPage*>&>& event)
{
event.connect(sigc::mem_fun(*this, &AfterTerrainUpdateListener::eventListener));
}
示例12: connect
template<class Res, class... Args> XBT_ALWAYS_INLINE
void connect(Res(*slot)(Args...))
{
sig_.connect(sigc::ptr_fun(slot));
}
示例13: h
//.........这里部分代码省略.........
tabs[1]->labelsize(16);
tabs[1]->align(FL_ALIGN_INSIDE | FL_ALIGN_TOP);
tabs[1]->box(FL_UP_FRAME);
tabs[1]->begin();
browser_directories = new Fl_Select_Browser(220, 40, w() - 235, 160, 0);
browser_directories->type(FL_HOLD_BROWSER);
browser_directories->color(context->configuration->background());
browser_directories->color2(context->configuration->foreground());
browser_directories->textcolor(context->configuration->textcolor());
Fl_Button* button_add = new Fl_Button(220, 205, 70, 25, _("Add"));
util_adjust_width(button_add, 10);
button_add->clear_visible_focus();
button_add->callback([](Fl_Widget *w, void *u) { SignalAddDir.emit(); });
Fl_Button* button_remove = new Fl_Button(220 + button_add->w() + 5, 205, 70, 25, _("Remove"));
util_adjust_width(button_remove, 10);
button_remove->clear_visible_focus();
button_remove->callback([](Fl_Widget *w, void *u) { SignalRemoveDir.emit(); });
tabs[1]->end();
// TAB NETWORK
tabs[2] = new Fl_Group(215, 10, w() - 225, h() - 20, _("Network"));
tabs[2]->labelsize(16);
tabs[2]->align(FL_ALIGN_INSIDE | FL_ALIGN_TOP);
tabs[2]->box(FL_UP_FRAME);
tabs[2]->begin();
Fl_Box* label_proxy = new Fl_Box(220, 40, w() - 235, 22, _("Proxy:"));
util_adjust_width(label_proxy);
input_proxy = new Fl_Input(215 + 8 + label_proxy->w(), 40, w() - 240 - label_proxy->w(), 22, 0);
input_proxy->tooltip(_("Complete proxy URL, ex: http://192.168.1.1:3128"));
input_proxy->value(context->dao->open_get_key("proxy").c_str());
input_proxy->callback([](Fl_Widget*, void*) {
SignalUpdateProxy.emit();
});
tabs[2]->end();
// TAB LANGUAGE
tabs[3] = new Fl_Group(215, 10, w() - 225, h() - 20, _("Language"));
#ifdef WIN32
tabs[3]->labelsize(16);
tabs[3]->align(FL_ALIGN_INSIDE | FL_ALIGN_TOP);
tabs[3]->box(FL_UP_FRAME);
tabs[3]->begin();
lang_choice = new Fl_Choice(220, 40, 200, 25);
lang_choice->clear_visible_focus();
lang_choice->callback([](Fl_Widget*, void*) {
SignalChangeLanguage.emit();
});
Language** languages = context->locale->getDefinedLanguages();
for (int i = 0; languages[i]; i++) {
lang_choice->add(languages[i]->description.c_str());
}
int index = context->dao->open_get_key_int("lang_index");
lang_choice->value((index < 0 ? 0 : index));
#endif
tabs[3]->end();
// CLOSE BUTTON
Fl_Button* button_close = new Fl_Button(0, h() - 40, 60, 25, _("Close"));
util_adjust_width(button_close, 10);
button_close->position(tabs[0]->x() + (tabs[0]->w() / 2) - (button_close->w() / 2), button_close->y());
button_close->clear_visible_focus();
button_close->callback([](Fl_Widget *w, void *u) { SignalClose.emit(); });
updateDirList();
tab_selector->select(1);
tab_selector->callback([](Fl_Widget* w, void*) {
if (tab_selector->value() == 0) {
return;
}
for (unsigned int t = 0; t < sizeof(tabs) / sizeof(tabs[0]); t++) {
if ((int) t == (tab_selector->value() - 1)) {
tabs[t]->show();
} else {
tabs[t]->hide();
}
}
});
tab_selector->do_callback();
set_modal();
callback([](Fl_Widget *w, void *u) { SignalClose.emit(); });
SignalClose.connect(sigc::mem_fun(this, &WindowSettings::close));
SignalUpdateColors.connect(sigc::mem_fun(this, &WindowSettings::updateColors));
SignalUpdateProxy.connect(sigc::mem_fun(this, &WindowSettings::updateProxy));
SignalAddDir.connect(sigc::mem_fun(this, &WindowSettings::addDir));
SignalRemoveDir.connect(sigc::mem_fun(this, &WindowSettings::removeDir));
SignalChangeLanguage.connect(sigc::mem_fun(this, &WindowSettings::changeLanguage));
}