[Click] Default constructor of Timer
Eddie Kohler
kohler at cs.ucla.edu
Thu Dec 10 16:12:05 EST 2009
Hi Erwin,
This is a totally fair point. The default constructor is useful; some
people want arrays of timers, for which a default constructor is
required. But I've made Click generate a warning when a
default-constructed Timer is initialized.
Eddie
Erwin Van de Velde wrote:
> Dear all,
>
> The Timer class has a default constructor, but when you use it (e.g. you
> accidently forget to put fTimer(this) or something like that in your element
> constructor), you are left with a timer that does nothing, even after calling
> the initialize function on the timer. For me this resulted in a bug, which was
> quite hard to find.
>
> So I am suggesting:
> - Removing the default constructor of the timer if it has no use (I do not see
> any)
> - Adding a click_chatter with a warning in the default constructor if it is
> required.
>
> Best regards,
> Erwin
> _______________________________________________
> click mailing list
> click at amsterdam.lcs.mit.edu
> https://amsterdam.lcs.mit.edu/mailman/listinfo/click
More information about the click
mailing list