Boost logo

Boost :

Subject: Re: [boost] Thoughts for a GUI (Primitives) Library
From: Yakov Galka (ybungalobill_at_[hidden])
Date: 2010-09-26 07:00:48


On Sat, Sep 25, 2010 at 21:04, Gwenio <urulokiurae_at_[hidden]> wrote:

> [...]
> enum events {
> // contains ids for events that can be stored with the "set" function
> };
>
This approach is intrinsically not extensible. You should be able to attach
arbitrary events, probably identified by 'event_type' - an objects holding
the information about the event.

> template<class Func,events evt> void set(Func f); // Sets how to handle a
> specific type of event
>
set() function allows attaching event handlers at run-time, however I'm not
sure this is a correct approach. Maybe generating a table at compile time
would be better. This is the static vs dynamic dilemma. As a C++ programmer
I honor the static approach.

Q: Who owns control_event_handler? Is it O(NM) or O(N+M) approach? It looks
like O(NM) because you perform a call on f without specifying the target of
the event. As a O(NM) I'm not going to use it.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk