void InvokeSignal(const std::string& name, typename boost::function<Fn_Tp>::arg1_type arg1, typename boost::function<Fn_Tp>::arg2_type arg2, typename boost::function<Fn_Tp>::arg3_type arg3){
		if(HasSignal(name)){
			//std::cout<<"Signalbroker invokoing signal: "<<name<<std::endl;
			//std::cout.flush();
			GetSignal<Fn_Tp>(name)(arg1, arg2, arg3);
			GetSignal<GenericHandler>(name+"-generic")((ArgsList(), arg1, arg2, arg3));
		}
	}
	void InvokeSignal(const std::string& name){
		if(HasSignal(name)){
			//std::cout<<"Signalbroker invokoing signal: "<<name<<std::endl;
			//std::cout.flush();
			GetSignal<Fn_Tp>(name)();
			GetSignal<GenericHandler>(name+"-generic")(ArgsList());
		}
	}
	Signal<Sig_Tp>& EnsureSignal(const std::string& name){
		if(HasSignal(name)){
			return signals.find(name)->second->GetSignal<Sig_Tp>();
		}
		else{
			Signal<Sig_Tp>* signal = new Signal<Sig_Tp>();
			signals.insert(Signals::value_type(name, static_cast<SignalBase*>(signal)));

			Signal<GenericHandler>* genericsignal = new Signal<GenericHandler>();
			SignalBase* genericsignalbase = static_cast<SignalBase*>(genericsignal);
			signals.insert(Signals::value_type(name+"-generic", genericsignalbase));
			return *signal;
		}
	}
	void InvokeSignal(const std::string& name, typename boost::function<Fn_Tp>::arg1_type arg1, typename boost::function<Fn_Tp>::arg2_type arg2, typename boost::function<Fn_Tp>::arg3_type arg3, typename boost::function<Fn_Tp>::arg4_type arg4, typename boost::function<Fn_Tp>::arg5_type arg5){
		if(HasSignal(name)){
			GetSignal<Fn_Tp>(name)(arg1, arg2, arg3, arg4, arg5);
			GetSignal<GenericHandler>(name+"-generic")((ArgsList(), arg1, arg2, arg3, arg4, arg5));
		}
	}
Example #5
0
    return _basicSignals();
}

std::list<TWidget::Slot> TWidget::_enumSlots() const {
    return std::list<Slot>();
}


void TWidget::Connect(const TWidgetWeakRef& signalOwnerRef,
    Signal& signal, const TWidgetWeakRef& slotOwnerRef, const Slot& slot)
{
    GUI_ASSERT(signalOwnerRef.expired() == false, "Signal owner is not specified.")
    GUI_ASSERT(slotOwnerRef.expired() == false, "Slot owner is not specified.")

    const auto signalOwner = signalOwnerRef.lock();
    GUI_ASSERT(signalOwner->HasSignal(signal) == true,
        "Object '" + signalOwner->GetName() + "' does not send this signal.")

    const auto slotOwner = slotOwnerRef.lock();
    GUI_ASSERT(slotOwner->HasSlot(slot) == true,
        "Object '" + slotOwner->GetName() + "' does not have this slot.")

    signal.AddListener(slot);
}

void TWidget::Disconnect(const TWidgetWeakRef& signalOwnerRef,
    Signal& signal, const TWidgetWeakRef& slotOwnerRef, const Slot& slot)
{
    GUI_ASSERT(signalOwnerRef.expired() == false, "Signal owner is not specified.")
    GUI_ASSERT(slotOwnerRef.expired() == false, "Slot owner is not specified.")