15 #ifndef FOXXLL_IO_REQUEST_OPERATIONS_HEADER 16 #define FOXXLL_IO_REQUEST_OPERATIONS_HEADER 32 template <
class RequestIterator>
33 void wait_all(RequestIterator reqs_begin, RequestIterator reqs_end)
35 for ( ; reqs_begin != reqs_end; ++reqs_begin)
44 wait_all(req_array, req_array + count);
55 template <
class RequestIterator>
56 typename std::iterator_traits<RequestIterator>::difference_type
57 cancel_all(RequestIterator reqs_begin, RequestIterator reqs_end)
59 typename std::iterator_traits<RequestIterator>::difference_type num_canceled = 0;
60 while (reqs_begin != reqs_end)
73 template <
class RequestIterator>
74 RequestIterator
poll_any(RequestIterator reqs_begin, RequestIterator reqs_end)
76 while (reqs_begin != reqs_end)
95 index =
static_cast<size_t>(res - req_array);
96 return res != (req_array + count);
103 template <
class RequestIterator>
104 RequestIterator
wait_any(RequestIterator reqs_begin, RequestIterator reqs_end)
110 RequestIterator cur = reqs_begin, result = reqs_end;
112 for ( ; cur != reqs_end; cur++)
119 if (cur != reqs_begin)
121 while (--cur != reqs_begin)
135 for (cur = reqs_begin; cur != reqs_end; cur++)
138 if (result == reqs_end && (
request_ptr(*cur))->poll())
152 return static_cast<size_t>(
wait_any(req_array, req_array + count) - req_array);
159 #endif // !FOXXLL_IO_REQUEST_OPERATIONS_HEADER void wait_for_on()
wait for switch to turn ON
std::iterator_traits< RequestIterator >::difference_type cancel_all(RequestIterator reqs_begin, RequestIterator reqs_end)
tlx::counting_ptr< request > request_ptr
A reference counting pointer for request.
void wait_all(RequestIterator reqs_begin, RequestIterator reqs_end)
Collection of functions to track statuses of a number of requests.
High-performance smart pointer used as a wrapping reference counting pointer.
RequestIterator wait_any(RequestIterator reqs_begin, RequestIterator reqs_end)
RequestIterator poll_any(RequestIterator reqs_begin, RequestIterator reqs_end)