Home » U++ Library support » U++ Callbacks and Timers » A new [Ctrl] timer id strategy
A new [Ctrl] timer id strategy [message #14613] |
Tue, 04 March 2008 16:07  |
huanghuan
Messages: 10 Registered: December 2007
|
Promising Member |
|
|
Ctrl::~Ctrl() {
...
KillTimeCallbacks(this, (byte *) this + sizeof(Ctrl));
[COLOR=red]KillTimeCallbacks(this, (byte *) this + sizeof(this));[/COLOR]
}
How can red code implement its mean ? I don't know.
Why? reasons as follow:
1. lazy coder write a new ctrl inherit from some deep inherited ctrl classes. lazyer don't want read the all classes in inherit tree.
class ACtrl : public SomeDeepInheritedClassBySomeOthers
{
...
Ctrl::SetTimeCallback(..., id? );
...
} 2. In big inherit tree. timer id is managed by increment. But sometimes we forget or mistake the last id. The follow code is safe. So Ctrl::SetTimeCallback is desperate.
class A : public Ctrl
{
char dummy;
public:
...
Upp::SetTimeCallback(..., &dummy);
...
};
class AA : public A
{
char dummy;
public:
...
Upp::SetTimeCallback(..., &dummy);
...
};
|
|
|
|
Goto Forum:
Current Time: Fri Apr 25 12:25:07 CEST 2025
Total time taken to generate the page: 0.00542 seconds
|