18 #ifndef LUNCHBOX_REQUESTHANDLER_H
19 #define LUNCHBOX_REQUESTHANDLER_H
22 #include <lunchbox/thread.h>
27 namespace detail {
class RequestHandler; }
72 {
return _register( data ); }
100 LUNCHBOX_API
bool waitRequest(
const uint32_t requestID,
void*& result,
104 LUNCHBOX_API
bool waitRequest(
const uint32_t requestID, uint32_t& result,
107 LUNCHBOX_API
bool waitRequest(
const uint32_t requestID,
bool& result,
113 LUNCHBOX_API
bool waitRequest(
const uint32_t requestID );
122 {
return isRequestReady(
id ); }
140 LUNCHBOX_API
void serveRequest(
const uint32_t requestID,
143 LUNCHBOX_API
void serveRequest(
const uint32_t requestID,
146 LUNCHBOX_API
void serveRequest(
const uint32_t requestID,
bool result );
148 LUNCHBOX_API
void serveRequest(
const uint32_t requestID,
156 LUNCHBOX_API
bool isRequestReady(
const uint32_t )
const;
159 detail::RequestHandler*
const _impl;
160 friend LUNCHBOX_API std::ostream& operator << ( std::ostream&,
161 const RequestHandler& );
162 LUNCHBOX_API uint32_t _register(
void* data );
163 LB_TS_VAR( _thread );
166 LUNCHBOX_API std::ostream&
operator << ( std::ostream&,
const RequestHandler& );
169 #include <lunchbox/request.h>
173 template<
class T >
inline
180 #endif //LUNCHBOX_REQUESTHANDLER_H
bool isRequestServed(const uint32_t id) const LB_DEPRECATED
Poll for the completion of a request.
Defines export visibility macros for Lunchbox.
Basic type definitions not provided by the operating system.
LUNCHBOX_API bool waitRequest(const uint32_t requestID, void *&result, const uint32_t timeout=LB_TIMEOUT_INDEFINITE)
Wait a given time for the completion of a request.
#define LB_TIMEOUT_INDEFINITE
Constant defining 'wait forever' in methods with wait parameters.
LUNCHBOX_API void serveRequest(const uint32_t requestID, void *result=0)
Serve a request with a void* result.
LUNCHBOX_API bool hasPendingRequests() const
A Future implementation for a RequestHandler request.
uint32_t registerRequest(void *data=0) LB_DEPRECATED
Register a request.
LUNCHBOX_API ~RequestHandler()
Destruct the request handler.
std::ostream & operator<<(std::ostream &os, const Array< T > &array)
Pretty-print all members of the array.
A thread-safe request handler.
A base type for 128 bit unsigned integer values.
Request< T > registerRequest(void *data=0)
Register a request.
LUNCHBOX_API void unregisterRequest(const uint32_t requestID)
Unregister a request.
LUNCHBOX_API RequestHandler()
Construct a new request handler.
LUNCHBOX_API void * getRequestData(const uint32_t requestID)
Retrieve the user-specific data for a request.