avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ram C" <ra...@mybc.com>
Subject Changes to TimeTrigger.
Date Fri, 16 Mar 2001 06:40:40 GMT
---- Peter Donald <donaldp@apache.org> wrote:
> Hi,
> 
> Just regarding these changes - I am not sure why you added in m_triggerTime
> or made it clonable. 
> 
> BTW I just renamed the passed in variable startTime to offset in CVS
> as
> that is what it was meant to be ;)

Thanks, I was thinking about it...but hey, my first time and I didn't
want to mess up with your variable name defs...I just wanted to get it
to work first.

> 
> As far as I can see m_triggerTime is the same as m_startTime except
> that
> m_startTime is passed on to "cloned" objects. However in the old code
> when
> offset was passed in constructor as -1, m_startTime would be set to
> the
> current time. However the way you changed it now new "cloned" objects
> are
> passed the original offset (-1 in this case) which will mean that the
> trigger will be reset everytime it is cloned.

That was exactly the problem...
In the original code, the 'offset' is lost because the m_startTime was
either the current time or (current time + offset). The PeriodicTimeTrigger
had a time sensitive information (current time) within itself.

Whenever a trigger is reset, i have to reset this time sensitive information
in PeriodicTimeTrigger.

I had two choice.....
1) Update the original trigger to somehow reset this time sensitive information.


I could have saved the original offset(just like the way i did now) and
recalculated the trigger time again. But i still had problems with updating
a trigger if it were to be active..and other issues with the binary heap..and
again i cannot invalidate this trigger.

2) Clone the original trigger in such a way that the time sensitive information
will be reset. 

I thought this was much easier. I can now invalidate the original trigger
and work with the new clonned trigger which has the trigger time recalculated
based on the time the trigger was reset.

I'm sure there are better ways of doing this....This was the best way
i could think of...without major changes to your existing code..

Cheers,
Ram.

___________________________________________________________
FREE voicemail, email and fax, all in one place.  Sign Up Now! http://www.mybc.com


---------------------------------------------------------------------
To unsubscribe, e-mail: avalon-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: avalon-dev-help@jakarta.apache.org


Mime
View raw message