[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [CPROG] ANSI C++ og events



On Mon, 2 Jul 2001, Peter Aagaard Kristensen wrote:

> Jeg sidder og bikser med et C++ program som skal bruge events(callbacks).
> Ideen er at jeg har en klasse som har en public variabel som brugeren af
> klassen kan sætte til at pege på en funktion, som bliver kaldt af klassen
> når noget bestemt sker.

Jeg har gjort noget lidt simplere (tror jeg); klasser der skal kunne
kaldes (altså modtage en event) nedarver alle fra en baseklasse, der har
en public "modtag event" funktion, som er parametriseret med en event.
De klasser der skal kalde en anden klasse, sættes så til at pege på den
klasse de skal kalde, og kalder den veldefinerede metode i klassen.

Mads

-- 
Mads Bondo Dydensborg.                               sslug@sslug
Any attempt to brew coffee with a teapot should result in the error
code "418 I'm a teapot". The resulting entity body MAY be short and
stout.
                                 - rfc2324. Go look it up... :-)



 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 20:08 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *