Differences From Artifact [00fc6ba68c]:
- File
src/OFRunLoop.h
— part of check-in
[df53f06922]
at
2012-09-12 06:11:46
on branch trunk
— Run loops have a stream observer now.
This makes async I/O possible! (user: js, size: 1303) [annotate] [blame] [check-ins using]
To Artifact [2b4f887c3c]:
- File src/OFRunLoop.h — part of check-in [a2b309b38a] at 2012-09-14 05:20:07 on branch trunk — Implement async reading (into buffers and lines). (user: js, size: 1783) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
11 12 13 14 15 16 17 18 19 | * Alternatively, it may be distributed under the terms of the GNU General * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #import "OFObject.h" @class OFSortedList; | > > | | > > > > > > > > > > > > > | 11 12 13 14 15 16 17 18 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 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | * Alternatively, it may be distributed under the terms of the GNU General * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #import "OFObject.h" #import "OFStream.h" #import "OFStreamObserver.h" @class OFSortedList; @class OFTimer; @class OFMutableDictionary; /** * \brief A class providing a run loop for the application and its processes. */ @interface OFRunLoop: OFObject #ifdef OF_RUNLOOP_M <OFStreamObserverDelegate> #endif { OFSortedList *timersQueue; OFStreamObserver *streamObserver; OFMutableDictionary *readQueues; } /** * \brief Returns the main run loop. * * \return The main run loop */ + (OFRunLoop*)mainRunLoop; /** * \brief Returns the run loop for the current thread. * * \return The run loop for the current thread */ + (OFRunLoop*)currentRunLoop; + (void)_setMainRunLoop: (OFRunLoop*)mainRunLoop; #ifdef OF_HAVE_BLOCKS + (void)_addAsyncReadForStream: (OFStream*)stream buffer: (void*)buffer length: (size_t)length block: (of_stream_async_read_block_t)block; + (void)_addAsyncReadLineForStream: (OFStream*)stream encoding: (of_string_encoding_t)encoding block: (of_stream_async_read_line_block_t)block; #endif /** * \brief Adds an OFTimer to the run loop. * * \param timer The timer to add */ - (void)addTimer: (OFTimer*)timer; /** * \brief Starts the run loop. */ - (void)run; @end |