avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Donald <pe...@apache.org>
Subject Re: active monitor
Date Sun, 21 Apr 2002 21:13:15 GMT
On Mon, 22 Apr 2002 00:32, Torsten Curdt wrote:
> > Which is not much likely to happen... ;-)
> > Shouldn't it be:
> >
> >   if ( file.lastModified() > m_previousModified ) {
> >     // fire event
> >     m_previousModified = file.lastModified()
> >   }
> >
> > But then the "time" argument wouldn't make much sense...

yep ;)

> One way to solve this is to replace this:
>
> in ActiveMonitor:
>
>    for( int i = 0; i < resources.length; i++ )
>    {
>         resources[ i ].testModifiedAfter( currentTestTime );
>                                           ~~~~~~~~~~~~~~~
>    }
>
> by this:
>
>    for( int i = 0; i < resources.length; i++ )
>    {
>         resources[ i ].testModifiedAfter( resources[i].m_previousModified
> ); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ }
>
> question is only if this is really desired...

I am not sure thats the way to do it. Personally I would still pass 
currentTestTime in through method but test a m_previosModified inside method 
(ie ignore the input parameter). As I imagine some resources using the 
current time as parameter - just not this one ;)

-- 
Cheers,

Peter Donald


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


Mime
View raw message