bug-commoncpp
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Signals/Slots for CommonC++


From: Alex Pavloff
Subject: RE: Signals/Slots for CommonC++
Date: Tue, 13 Jan 2004 16:49:41 -0800

For signals/slots, I would suggest just folding in the libsgic++ library that 
the gtkmm people created for help with making the C++ bindings for gtk.

http://libsigc.sourceforge.net/

Alex Pavloff - address@hidden
ESA Technology ---- www.esatechnology.com
------- Linux-based industrial HMI ------
-------- www.esatechnology.com/5k -------

> -----Original Message-----
> From: "Marc Boris Dürner" [mailto:address@hidden 
> Sent: Tuesday, January 13, 2004 10:13 AM
> To: address@hidden
> Subject: Signals/Slots for CommonC++
> 
> 
> Hi,  
> A signal/slot implementation for CommonC++ is attached. This 
> is a preview and not yet 
> thread-safe(need help for this). It works as follows:  
>   
> class MyClass {  
>       Signal<int> signal;  // a signal carrying an int  
>       void printInt(int i) {  
>               std::cout << i << std::endl;  
>       }  
>       public:  
>       MyClass() {  
>               signal.connect(this, &MyClass::printInt);  
> //connect signal  
>               signal(100); // emit signal  
>       }  
> };   
>   
> The template class Signal takes the type of data it carries 
> as template type. Currently  
> Signals can transport no data or one parameter. It can be 
> connected/disconnected to  
> functions matching the type of parameter. Signals can be 
> connected to multiple slots and  
> other signals.   
>   
> Source is attached with a a simple test case.  
>   
> regards,  
> Marc  
>   
>   
>   
>   
>   
>   
> 
> -- 
> +++ GMX - die erste Adresse für Mail, Message, More +++
> Neu: Preissenkung für MMS und FreeMMS! http://www.gmx.net
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]