76class ARCCORE_MESSAGEPASSING_EXPORT
Request
101 m_request = null_request;
106 ARCCORE_DEPRECATED_2020(
"Use overload with IRequestCreator pointer")
107 Request(
int return_value,
void* arequest)
108 : m_return_value(return_value)
111 m_request.v = arequest;
114 ARCCORE_DEPRECATED_2020(
"Use overload with IRequestCreator pointer")
115 Request(
int return_value,
const void* arequest)
116 : m_return_value(return_value)
119 m_request.cv = arequest;
122 ARCCORE_DEPRECATED_2020(
"Use overload with IRequestCreator pointer")
123 Request(
int return_value,
int arequest)
124 : m_return_value(return_value)
127 m_request.i = arequest;
130 ARCCORE_DEPRECATED_2020(
"Use overload with IRequestCreator pointer")
131 Request(
int return_value,
long arequest)
132 : m_return_value(return_value)
135 m_request.l = arequest;
138 ARCCORE_DEPRECATED_2020(
"Use overload with IRequestCreator pointer")
139 Request(
int return_value,std::size_t arequest)
140 : m_return_value(return_value)
143 m_request.st = arequest;
149 : m_return_value(return_value), m_creator(creator)
152 m_request.v = arequest;
156 : m_return_value(return_value), m_creator(creator)
159 m_request.cv = arequest;
163 : m_return_value(return_value), m_creator(creator)
166 m_request.i = arequest;
170 : m_return_value(return_value), m_creator(creator)
173 m_request.l = arequest;
177 : m_return_value(return_value), m_creator(creator)
180 m_request.st = arequest;
186 operator const T*()
const {
return (
const T*)m_request.cv; }
188 operator T*()
const {
return (T*)m_request.v; }
189 operator int()
const {
return m_request.i; }
190 operator long()
const {
return m_request.l; }
191 operator size_t()
const {
return m_request.st; }
195 int returnValue()
const {
return m_return_value; }
203 if (m_type!=null_request_type)
206 return m_request.i!=null_request.i;
208 return m_request.l!=null_request.l;
210 return m_request.st!=null_request.st;
212 return m_request.cv!=null_request.cv;
215 void* requestAsVoidPtr()
const {
return m_request.v; }
217 static void setNullRequest(
Request r)
219 null_request = r.m_request;
220 null_request_type = r.m_type;
225 m_request = null_request;
226 m_sub_request.reset();
229 Ref<ISubRequest> subRequest()
const {
return m_sub_request; }
230 bool hasSubRequest()
const {
return !m_sub_request.isNull(); }
231 void setSubRequest(Ref<ISubRequest> s) { m_sub_request = s; }
236 void print(std::ostream& o)
const;
238 friend inline std::ostream& operator<<(std::ostream& o,
const Request& prequest)
245 Int32 _type()
const {
return m_type; }
249 int m_return_value = 0;
252 Ref<ISubRequest> m_sub_request;
253 IRequestCreator* m_creator =
nullptr;
254 static _Request null_request;
255 static int null_request_type;