ObjFW  Diff

Differences From Artifact [50dd4708f7]:

To Artifact [3854375363]:


19
20
21
22
23
24
25
26
27


28
29
30
31
32
33
34
35
36
37


38
39

40
41
42
43
44


45
46

47
48
49
50
51
52
53
19
20
21
22
23
24
25


26
27
28
29
30
31
32
33
34
35


36
37
38

39
40
41
42


43
44
45

46
47
48
49
50
51
52
53







-
-
+
+








-
-
+
+

-
+



-
-
+
+

-
+







#import "OFStreamObserver.h"
#import "OFTCPSocket.h"

@class OFSortedList;
@class OFTimer;
@class OFMutableDictionary;

/**
 * \brief A class providing a run loop for the application and its processes.
/*!
 * @brief A class providing a run loop for the application and its processes.
 */
@interface OFRunLoop: OFObject
{
	OFSortedList *timersQueue;
	OFStreamObserver *streamObserver;
	OFMutableDictionary *readQueues;
}

/**
 * \brief Returns the main run loop.
/*!
 * @brief Returns the main run loop.
 *
 * \return The main run loop
 * @return The main run loop
 */
+ (OFRunLoop*)mainRunLoop;

/**
 * \brief Returns the run loop for the current thread.
/*!
 * @brief Returns the run loop for the current thread.
 *
 * \return The run loop for the current thread
 * @return The run loop for the current thread
 */
+ (OFRunLoop*)currentRunLoop;

+ (void)OF_setMainRunLoop;
+ (void)OF_addAsyncReadForStream: (OFStream*)stream
			  buffer: (void*)buffer
			  length: (size_t)length
77
78
79
80
81
82
83
84
85


86
87

88
89
90
91
92


93
94
95
77
78
79
80
81
82
83


84
85
86

87
88
89
90


91
92
93
94
95







-
-
+
+

-
+



-
-
+
+



+ (void)OF_addAsyncReadLineForStream: (OFStream*)stream
			    encoding: (of_string_encoding_t)encoding
			       block: (of_stream_async_read_line_block_t)block;
+ (void)OF_addAsyncAcceptForTCPSocket: (OFTCPSocket*)socket
				block: (of_tcpsocket_async_accept_block_t)block;
#endif

/**
 * \brief Adds an OFTimer to the run loop.
/*!
 * @brief Adds an OFTimer to the run loop.
 *
 * \param timer The timer to add
 * @param timer The timer to add
 */
- (void)addTimer: (OFTimer*)timer;

/**
 * \brief Starts the run loop.
/*!
 * @brief Starts the run loop.
 */
- (void)run;
@end