#ifndef IPC_IPC_MESSAGE_TEMPLATES_H_
#define IPC_IPC_MESSAGE_TEMPLATES_H_
#include <stdint.h>
#include <tuple>
#include <type_traits>
#include <utility>
#include "base/check.h"
#include "base/notreached.h"
#include "base/trace_event/trace_event.h"
#include "base/tuple.h"
#include "build/build_config.h"
#include "ipc/ipc_message.h"
#include "ipc/ipc_message_utils.h"
#include "ipc/ipc_sync_message.h"
namespace IPC {
template <typename Tuple, size_t... Ns>
auto TupleForwardImpl(Tuple&& tuple, std::index_sequence<Ns...>) -> decltype(
std::forward_as_tuple(std::get<Ns>(std::forward<Tuple>(tuple))...)) { … }
template <typename Tuple>
auto TupleForward(Tuple&& tuple) -> decltype(TupleForwardImpl(
std::forward<Tuple>(tuple),
std::make_index_sequence<std::tuple_size<std::decay_t<Tuple>>::value>())) { … }
template <typename ObjT, typename Method, typename P, typename Tuple>
void DispatchToMethod(ObjT* obj, Method method, P*, Tuple&& tuple) { … }
template <typename ObjT,
typename Method,
typename P,
typename Tuple,
size_t... Ns>
void DispatchToMethodImpl(ObjT* obj,
Method method,
P* parameter,
Tuple&& tuple,
std::index_sequence<Ns...>) { … }
template <typename ObjT, typename P, typename... Args, typename Tuple>
std::enable_if_t<sizeof...(Args) == std::tuple_size<std::decay_t<Tuple>>::value>
DispatchToMethod(ObjT* obj,
void (ObjT::*method)(P*, Args...),
P* parameter,
Tuple&& tuple) { … }
enum class MessageKind { … };
struct Routing { … };
#define IPC_MESSAGET_SFINAE(x) …
template <typename Meta,
typename InTuple = typename Meta::InTuple,
typename OutTuple = typename Meta::OutTuple>
class MessageT;
MessageT<Meta, std::tuple<Ins...>, void>;
MessageT<Meta, std::tuple<Ins...>, std::tuple<Outs...>>;
}
#if defined(IPC_MESSAGE_IMPL)
#include "ipc/ipc_message_templates_impl.h"
#endif
#endif