ObjFW  Diff

Differences From Artifact [91db3a9035]:

To Artifact [7d93190810]:


15
16
17
18
19
20
21

22
23
24
25
26
27
28
 */

#import "OFObject.h"

@class OFTimer;
@class OFDate;
@class OFCondition;


#ifdef OF_HAVE_BLOCKS
typedef void (^of_timer_block_t)(OFTimer*);
#endif

/*!
 * @brief A class for creating and firing timers.







>







15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
 */

#import "OFObject.h"

@class OFTimer;
@class OFDate;
@class OFCondition;
@class OFRunLoop;

#ifdef OF_HAVE_BLOCKS
typedef void (^of_timer_block_t)(OFTimer*);
#endif

/*!
 * @brief A class for creating and firing timers.
36
37
38
39
40
41
42

43
44
45
46
47
48
49
50
51
52
53
	uint8_t arguments;
	BOOL repeats;
#ifdef OF_HAVE_BLOCKS
	of_timer_block_t block;
#endif
	BOOL isValid, done;
	OFCondition *condition;

}

#ifdef OF_HAVE_PROPERTIES
@property (readonly, retain) OFDate *fireDate;
#endif

/*!
 * @brief Creates and schedules a new timer with the specified time interval.
 *
 * @param interval The time interval after which the timer should be executed
 *		   when fired







>



|







37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
	uint8_t arguments;
	BOOL repeats;
#ifdef OF_HAVE_BLOCKS
	of_timer_block_t block;
#endif
	BOOL isValid, done;
	OFCondition *condition;
	OFRunLoop *inRunLoop;
}

#ifdef OF_HAVE_PROPERTIES
@property (retain) OFDate *fireDate;
#endif

/*!
 * @brief Creates and schedules a new timer with the specified time interval.
 *
 * @param interval The time interval after which the timer should be executed
 *		   when fired
271
272
273
274
275
276
277












278
279
280
281
282
283
284
/*!
 * @brief Returns the next date at which the timer will fire.
 *
 * @return The next date at which the timer will fire
 */
- (OFDate*)fireDate;













/*!
 * @brief Invalidates the timer, preventing it from firing.
 */
- (void)invalidate;

/*!
 * @brief Returns whether the timer is valid.







>
>
>
>
>
>
>
>
>
>
>
>







273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
/*!
 * @brief Returns the next date at which the timer will fire.
 *
 * @return The next date at which the timer will fire
 */
- (OFDate*)fireDate;

/*!
 * @brief Sets the next date at which the timer will fire.
 *
 * If the timer is already scheduled in a run loop, it will be rescheduled.
 * Note that rescheduling is an expensive operation, though it still might be
 * preferrable to reschedule instead of invalidating the timer and creating a
 * new one.
 *
 * @param fireDate The next date at which the timer will fire
 */
- (void)setFireDate: (OFDate*)fireDate;

/*!
 * @brief Invalidates the timer, preventing it from firing.
 */
- (void)invalidate;

/*!
 * @brief Returns whether the timer is valid.
296
297
298
299
300
301
302


303
 */
- (double)timeInterval;

/*!
 * @brief Waits until the timer fired.
 */
- (void)waitUntilDone;


@end







>
>

310
311
312
313
314
315
316
317
318
319
 */
- (double)timeInterval;

/*!
 * @brief Waits until the timer fired.
 */
- (void)waitUntilDone;

- (void)OF_setInRunLoop: (OFRunLoop*)inRunLoop;
@end