18 #ifndef LUNCHBOX_REQUESTHANDLER_H 19 #define LUNCHBOX_REQUESTHANDLER_H 22 #include <lunchbox/thread.h> 24 #include <servus/uint128_t.h> 28 namespace detail {
class RequestHandler; }
51 LUNCHBOX_API ~RequestHandler();
60 template<
class T >
Request< T > registerRequest(
void* data = 0 );
82 LUNCHBOX_API
void unregisterRequest(
const uint32_t requestID );
98 LUNCHBOX_API
bool waitRequest(
const uint32_t requestID,
void*& result,
102 LUNCHBOX_API
bool waitRequest(
const uint32_t requestID, uint32_t& result,
105 LUNCHBOX_API
bool waitRequest(
const uint32_t requestID,
bool& result,
108 LUNCHBOX_API
bool waitRequest(
const uint32_t requestID,
109 servus::uint128_t& result,
112 LUNCHBOX_API
bool waitRequest(
const uint32_t requestID );
121 LUNCHBOX_API
void* getRequestData(
const uint32_t requestID );
130 LUNCHBOX_API
void serveRequest(
const uint32_t requestID,
133 LUNCHBOX_API
void serveRequest(
const uint32_t requestID,
136 LUNCHBOX_API
void serveRequest(
const uint32_t requestID,
bool result );
138 LUNCHBOX_API
void serveRequest(
const uint32_t requestID,
139 const servus::uint128_t& result );
144 LUNCHBOX_API
bool hasPendingRequests()
const;
146 LUNCHBOX_API
bool isRequestReady(
const uint32_t )
const;
149 detail::RequestHandler*
const _impl;
150 friend LUNCHBOX_API std::ostream&
operator << ( std::ostream&,
151 const RequestHandler& );
152 LUNCHBOX_API uint32_t _register(
void* data );
153 LB_TS_VAR( _thread );
159 #include <lunchbox/request.h> 163 template<
class T >
inline 170 #endif //LUNCHBOX_REQUESTHANDLER_H Defines export visibility macros for library Lunchbox.
Basic type definitions not provided by the operating system.
uint32_t registerRequest(void *data=0)
Register a request.
#define LB_TIMEOUT_INDEFINITE
Constant defining 'wait forever' in methods with wait parameters.
A Future implementation for a RequestHandler request.
Abstraction layer and common utilities for multi-threaded programming.
std::ostream & operator<<(std::ostream &os, const Array< T > &array)
Pretty-print all members of the array.
A thread-safe request handler.
Request< T > registerRequest(void *data=0)
Register a request.