8 #include<libtransistor/cpp/types.hpp>
21 template<
typename... T>
27 std::vector<ipc_buffer_t*> buffers;
33 template<
typename T,
typename... Extra>
44 *((T*) (((uint8_t*) f.rq.raw_data) + offset)) = arg.value;
62 arg = *((T*) (((uint8_t*) f.rs.raw_data) + offset));
96 template<
typename T,
typename... Extra>
107 arg = f.rs.copy_handles[index];
111 template<
typename T,
typename... Extra>
122 arg = f.rs.move_handles[index];
134 f.rq.
objects[index] = arg.value->object.object;
152 *(arg.value) = T(f.rs.objects[index]);
156 template<
typename T, u
int32_t type>
164 buffer->addr = (
void*) arg.data;
165 buffer->
size = arg.size;
197 template<
typename T,
typename... Extra>
236 template<
typename T,
typename... Extra>
243 template<
typename T,
typename... Extra>
264 template<
typename T, u
int32_t type,
size_t expected_size>
269 buffer->
size = expected_size;
270 fmt.buffers.push_back(buffer);
278 fmt.rq.send_pid =
true;
286 fmt.rs.has_pid =
true;
294 template<
typename Arg0,
typename... Args>
306 return std::make_tuple();
323 template<uint32_t id,
typename... Args>
324 Result<std::nullopt_t> SendSyncRequest(Args &&... args) {
328 fmt.rq.request_id = id;
330 fmt.rq.num_buffers = fmt.buffers.size();
331 fmt.rq.
buffers = fmt.buffers.data();
338 fmt.rs.copy_handles =
new handle_t[fmt.rs.num_copy_handles];
339 fmt.rs.move_handles =
new handle_t[fmt.rs.num_move_handles];
340 fmt.rs.pid = &fmt.pid;
342 Object::HelpPack(fmt, accessors, std::index_sequence_for<Args...>(), args...);
346 return tl::make_unexpected(r);
349 Object::HelpUnpack(fmt, accessors, std::index_sequence_for<Args...>(), args...);
354 template<
typename... Args, std::size_t... I>
356 ((std::get<I>(accessors).Pack(fmt, args)),...);
359 template<
typename... Args, std::size_t... I>
361 ((std::get<I>(accessors).Unpack(fmt, args)),...);
handle_t * copy_handles
Array of num_copy_handles handles to be copied.
Definition: ipc.h:85
ipc_object_t * objects
Array of num_objects objects to be referenced.
Definition: ipc.h:87
size_t raw_data_size
size in bytes of raw_data
Definition: ipc.h:152
ipc_buffer_t ** buffers
This should point to an array of num_buffers buffers.
Definition: ipc.h:77
size_t raw_data_size
Size in bytes of raw_data.
Definition: ipc.h:80
Definition: ipcclient.hpp:173
Definition: ipcclient.hpp:22
ipc_request_t ipc_default_request
An IPC request with default values set.
ipc_response_fmt_t ipc_default_response_fmt
An IPC response format with default values set.
Definition: ipcclient.hpp:310
Represents either an object within an IPC domain or a standalone object.
Definition: ipc.h:32
handle_t * move_handles
Array of num_move_handles handles to be moved.
Definition: ipc.h:86
Describes format expectations for an incoming IPC response.
Definition: ipc.h:144
result_t ipc_send(ipc_object_t object, ipc_request_t *rq, ipc_response_fmt_t *rs)
Send a request described by rq to object and then unpack the response.
uint32_t handle_t
Resource handle.
Definition: types.h:38
Represents an unmarshalled outgoing IPC request.
Definition: ipc.h:74
Buffer for transfer over IPC.
Definition: ipc.h:62
Definition: ipcclient.hpp:34
Definition: ipcclient.hpp:185
Interprocess Communication data structures and functions.
uint64_t size
Size in bytes.
Definition: ipc.h:64