diff options
author | tsepez@chromium.org <tsepez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-01 20:35:47 +0000 |
---|---|---|
committer | tsepez@chromium.org <tsepez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-01 20:35:47 +0000 |
commit | 8a8c9c721173aa8a66173e49c498490b1f615616 (patch) | |
tree | d3a550d0a4861607b8e42abf42dad4867ea13f6c /ipc/ipc_message_macros.h | |
parent | 9fdf2e44e43e827da5a75a79363fd5d3f665e937 (diff) | |
download | chromium_src-8a8c9c721173aa8a66173e49c498490b1f615616.zip chromium_src-8a8c9c721173aa8a66173e49c498490b1f615616.tar.gz chromium_src-8a8c9c721173aa8a66173e49c498490b1f615616.tar.bz2 |
Attempt to reduce the amount of cut n paste needed to maintain these.
Review URL: http://codereview.chromium.org/6581046
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76417 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ipc/ipc_message_macros.h')
-rw-r--r-- | ipc/ipc_message_macros.h | 1362 |
1 files changed, 368 insertions, 994 deletions
diff --git a/ipc/ipc_message_macros.h b/ipc/ipc_message_macros.h index c8cdf38..de1132e 100644 --- a/ipc/ipc_message_macros.h +++ b/ipc/ipc_message_macros.h @@ -164,320 +164,13 @@ #ifndef IPC_IPC_MESSAGE_MACROS_H_ #define IPC_IPC_MESSAGE_MACROS_H_ -// Can use #pragma once all XXX_messages.h files clean up IPC_MESSAGE_START #include "ipc/ipc_message_utils.h" #include "ipc/param_traits_macros.h" #if defined(IPC_MESSAGE_IMPL) -#include "ipc/ipc_message_impl_macros.h" -#elif defined(IPC_MESSAGE_MACROS_LOG_ENABLED) - -#ifndef IPC_LOG_TABLE_CREATED -#define IPC_LOG_TABLE_CREATED - -#include "base/hash_tables.h" - -typedef void (*LogFunction)(std::string* name, - const IPC::Message* msg, - std::string* params); - -typedef base::hash_map<uint32, LogFunction > LogFunctionMap; -LogFunctionMap g_log_function_mapping; - -#endif // IPC_LOG_TABLE_CREATED - - -#define IPC_MESSAGE_LOG(msg_class) \ - class LoggerRegisterHelper##msg_class { \ - public: \ - LoggerRegisterHelper##msg_class() { \ - g_log_function_mapping[msg_class::ID] = msg_class::Log; \ - } \ - }; \ - LoggerRegisterHelper##msg_class g_LoggerRegisterHelper##msg_class; - -#define IPC_MESSAGE_CONTROL0_EXTRA(msg_class) \ - IPC_MESSAGE_LOG(msg_class) - -#define IPC_MESSAGE_CONTROL1_EXTRA(msg_class, type1) \ - IPC_MESSAGE_LOG(msg_class) - -#define IPC_MESSAGE_CONTROL2_EXTRA(msg_class, type1, type2) \ - IPC_MESSAGE_LOG(msg_class) - -#define IPC_MESSAGE_CONTROL3_EXTRA(msg_class, type1, type2, type3) \ - IPC_MESSAGE_LOG(msg_class) - -#define IPC_MESSAGE_CONTROL4_EXTRA(msg_class, type1, type2, type3, type4) \ - IPC_MESSAGE_LOG(msg_class) - -#define IPC_MESSAGE_CONTROL5_EXTRA(msg_class, type1, type2, type3, type4, type5) \ - IPC_MESSAGE_LOG(msg_class) - -#define IPC_MESSAGE_ROUTED0_EXTRA(msg_class) \ - IPC_MESSAGE_LOG(msg_class) - -#define IPC_MESSAGE_ROUTED1_EXTRA(msg_class, type1) \ - IPC_MESSAGE_LOG(msg_class) - -#define IPC_MESSAGE_ROUTED2_EXTRA(msg_class, type1, type2) \ - IPC_MESSAGE_LOG(msg_class) - -#define IPC_MESSAGE_ROUTED3_EXTRA(msg_class, type1, type2, type3) \ - IPC_MESSAGE_LOG(msg_class) - -#define IPC_MESSAGE_ROUTED4_EXTRA(msg_class, type1, type2, type3, type4) \ - IPC_MESSAGE_LOG(msg_class) - -#define IPC_MESSAGE_ROUTED5_EXTRA(msg_class, type1, type2, type3, type4, type5) \ - IPC_MESSAGE_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_CONTROL0_0_EXTRA(msg_class) \ - IPC_MESSAGE_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_CONTROL0_1_EXTRA(msg_class, type1_out) \ - IPC_MESSAGE_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_CONTROL0_2_EXTRA(msg_class, type1_out, type2_out) \ - IPC_MESSAGE_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_CONTROL0_3_EXTRA(msg_class, type1_out, type2_out, type3_out) \ - IPC_MESSAGE_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_CONTROL0_4_EXTRA(msg_class, type1_out, type2_out, type3_out, type4_out) \ - IPC_MESSAGE_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_CONTROL1_0_EXTRA(msg_class, type1_in) \ - IPC_MESSAGE_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_CONTROL1_1_EXTRA(msg_class, type1_in, type1_out) \ - IPC_MESSAGE_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_CONTROL1_2_EXTRA(msg_class, type1_in, type1_out, type2_out) \ - IPC_MESSAGE_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_CONTROL1_3_EXTRA(msg_class, type1_in, type1_out, type2_out, type3_out) \ - IPC_MESSAGE_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_CONTROL1_4_EXTRA(msg_class, type1_in, type1_out, type2_out, type3_out, type4_out) \ - IPC_MESSAGE_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_CONTROL2_0_EXTRA(msg_class, type1_in, type2_in) \ - IPC_MESSAGE_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_CONTROL2_1_EXTRA(msg_class, type1_in, type2_in, type1_out) \ - IPC_MESSAGE_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_CONTROL2_2_EXTRA(msg_class, type1_in, type2_in, type1_out, type2_out) \ - IPC_MESSAGE_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_CONTROL2_3_EXTRA(msg_class, type1_in, type2_in, type1_out, type2_out, type3_out) \ - IPC_MESSAGE_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_CONTROL2_4_EXTRA(msg_class, type1_in, type2_in, type1_out, type2_out, type3_out, type4_out) \ - IPC_MESSAGE_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_CONTROL3_1_EXTRA(msg_class, type1_in, type2_in, type3_in, type1_out) \ - IPC_MESSAGE_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_CONTROL3_2_EXTRA(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out) \ - IPC_MESSAGE_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_CONTROL3_3_EXTRA(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out, type3_out) \ - IPC_MESSAGE_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_CONTROL3_4_EXTRA(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out, type3_out, type4_out) \ - IPC_MESSAGE_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_CONTROL4_1_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out) \ - IPC_MESSAGE_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_CONTROL4_2_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out, type2_out) \ - IPC_MESSAGE_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_CONTROL4_3_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out, type2_out, type3_out) \ - IPC_MESSAGE_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_CONTROL4_4_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out, type2_out, type3_out, type4_out) \ - IPC_MESSAGE_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_CONTROL5_1_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in, type1_out) \ - IPC_MESSAGE_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_CONTROL5_2_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in, type1_out, type2_out) \ - IPC_MESSAGE_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_CONTROL5_3_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in, type1_out, type2_out, type3_out) \ - IPC_MESSAGE_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_CONTROL5_4_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in, type1_out, type2_out, type3_out, type4_out) \ - IPC_MESSAGE_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_ROUTED0_0_EXTRA(msg_class) \ - IPC_MESSAGE_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_ROUTED0_1_EXTRA(msg_class, type1_out) \ - IPC_MESSAGE_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_ROUTED0_2_EXTRA(msg_class, type1_out, type2_out) \ - IPC_MESSAGE_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_ROUTED0_3_EXTRA(msg_class, type1_out, type2_out, type3_out) \ - IPC_MESSAGE_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_ROUTED0_4_EXTRA(msg_class, type1_out, type2_out, type3_out, type4_out) \ - IPC_MESSAGE_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_ROUTED1_0_EXTRA(msg_class, type1_in) \ - IPC_MESSAGE_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_ROUTED1_1_EXTRA(msg_class, type1_in, type1_out) \ - IPC_MESSAGE_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_ROUTED1_2_EXTRA(msg_class, type1_in, type1_out, type2_out) \ - IPC_MESSAGE_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_ROUTED1_3_EXTRA(msg_class, type1_in, type1_out, type2_out, type3_out) \ - IPC_MESSAGE_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_ROUTED1_4_EXTRA(msg_class, type1_in, type1_out, type2_out, type3_out, type4_out) \ - IPC_MESSAGE_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_ROUTED2_0_EXTRA(msg_class, type1_in, type2_in) \ - IPC_MESSAGE_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_ROUTED2_1_EXTRA(msg_class, type1_in, type2_in, type1_out) \ - IPC_MESSAGE_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_ROUTED2_2_EXTRA(msg_class, type1_in, type2_in, type1_out, type2_out) \ - IPC_MESSAGE_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_ROUTED2_3_EXTRA(msg_class, type1_in, type2_in, type1_out, type2_out, type3_out) \ - IPC_MESSAGE_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_ROUTED2_4_EXTRA(msg_class, type1_in, type2_in, type1_out, type2_out, type3_out, type4_out) \ - IPC_MESSAGE_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_ROUTED3_0_EXTRA(msg_class, type1_in, type2_in, type3_in) \ - IPC_MESSAGE_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_ROUTED3_1_EXTRA(msg_class, type1_in, type2_in, type3_in, type1_out) \ - IPC_MESSAGE_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_ROUTED3_2_EXTRA(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out) \ - IPC_MESSAGE_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_ROUTED3_3_EXTRA(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out, type3_out) \ - IPC_MESSAGE_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_ROUTED3_4_EXTRA(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out, type3_out, type4_out) \ - IPC_MESSAGE_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_ROUTED4_0_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in) \ - IPC_MESSAGE_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_ROUTED4_1_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out) \ - IPC_MESSAGE_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_ROUTED4_2_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out, type2_out) \ - IPC_MESSAGE_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_ROUTED4_3_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out, type2_out, type3_out) \ - IPC_MESSAGE_LOG(msg_class) - - -#define IPC_SYNC_MESSAGE_ROUTED4_4_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out, type2_out, type3_out, type4_out) \ - IPC_MESSAGE_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_ROUTED5_0_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in) \ - IPC_MESSAGE_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_ROUTED5_1_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in, type1_out) \ - IPC_MESSAGE_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_ROUTED5_2_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in, type1_out, type2_out) \ - IPC_MESSAGE_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_ROUTED5_3_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in, type1_out, type2_out, type3_out) \ - IPC_MESSAGE_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_ROUTED5_4_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in, type1_out, type2_out, type3_out, type4_out) \ - IPC_MESSAGE_LOG(msg_class) - -#else // defined(IPC_MESSAGE_MACROS_LOG_ENABLED) - -#define IPC_MESSAGE_CONTROL0_EXTRA(msg_class) -#define IPC_MESSAGE_CONTROL1_EXTRA(msg_class, type1) -#define IPC_MESSAGE_CONTROL2_EXTRA(msg_class, type1, type2) -#define IPC_MESSAGE_CONTROL3_EXTRA(msg_class, type1, type2, type3) -#define IPC_MESSAGE_CONTROL4_EXTRA(msg_class, type1, type2, type3, type4) -#define IPC_MESSAGE_CONTROL5_EXTRA(msg_class, type1, type2, type3, type4, type5) -#define IPC_MESSAGE_ROUTED0_EXTRA(msg_class) -#define IPC_MESSAGE_ROUTED1_EXTRA(msg_class, type1) -#define IPC_MESSAGE_ROUTED2_EXTRA(msg_class, type1, type2) -#define IPC_MESSAGE_ROUTED3_EXTRA(msg_class, type1, type2, type3) -#define IPC_MESSAGE_ROUTED4_EXTRA(msg_class, type1, type2, type3, type4) -#define IPC_MESSAGE_ROUTED5_EXTRA(msg_class, type1, type2, type3, type4, type5) -#define IPC_SYNC_MESSAGE_CONTROL0_0_EXTRA(msg_class) -#define IPC_SYNC_MESSAGE_CONTROL0_1_EXTRA(msg_class, type1_out) -#define IPC_SYNC_MESSAGE_CONTROL0_2_EXTRA(msg_class, type1_out, type2_out) -#define IPC_SYNC_MESSAGE_CONTROL0_3_EXTRA(msg_class, type1_out, type2_out, type3_out) -#define IPC_SYNC_MESSAGE_CONTROL0_4_EXTRA(msg_class, type1_out, type2_out, type3_out, type4_out) -#define IPC_SYNC_MESSAGE_CONTROL1_0_EXTRA(msg_class, type1_in) -#define IPC_SYNC_MESSAGE_CONTROL1_1_EXTRA(msg_class, type1_in, type1_out) -#define IPC_SYNC_MESSAGE_CONTROL1_2_EXTRA(msg_class, type1_in, type1_out, type2_out) -#define IPC_SYNC_MESSAGE_CONTROL1_3_EXTRA(msg_class, type1_in, type1_out, type2_out, type3_out) -#define IPC_SYNC_MESSAGE_CONTROL1_4_EXTRA(msg_class, type1_in, type1_out, type2_out, type3_out, type4_out) -#define IPC_SYNC_MESSAGE_CONTROL2_0_EXTRA(msg_class, type1_in, type2_in) -#define IPC_SYNC_MESSAGE_CONTROL2_1_EXTRA(msg_class, type1_in, type2_in, type1_out) -#define IPC_SYNC_MESSAGE_CONTROL2_2_EXTRA(msg_class, type1_in, type2_in, type1_out, type2_out) -#define IPC_SYNC_MESSAGE_CONTROL2_3_EXTRA(msg_class, type1_in, type2_in, type1_out, type2_out, type3_out) -#define IPC_SYNC_MESSAGE_CONTROL2_4_EXTRA(msg_class, type1_in, type2_in, type1_out, type2_out, type3_out, type4_out) -#define IPC_SYNC_MESSAGE_CONTROL3_1_EXTRA(msg_class, type1_in, type2_in, type3_in, type1_out) -#define IPC_SYNC_MESSAGE_CONTROL3_2_EXTRA(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out) -#define IPC_SYNC_MESSAGE_CONTROL3_3_EXTRA(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out, type3_out) -#define IPC_SYNC_MESSAGE_CONTROL3_4_EXTRA(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out, type3_out, type4_out) -#define IPC_SYNC_MESSAGE_CONTROL4_1_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out) -#define IPC_SYNC_MESSAGE_CONTROL4_2_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out, type2_out) -#define IPC_SYNC_MESSAGE_CONTROL4_3_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out, type2_out, type3_out) -#define IPC_SYNC_MESSAGE_CONTROL4_4_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out, type2_out, type3_out, type4_out) -#define IPC_SYNC_MESSAGE_CONTROL5_1_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in, type1_out) -#define IPC_SYNC_MESSAGE_CONTROL5_2_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in, type1_out, type2_out) -#define IPC_SYNC_MESSAGE_CONTROL5_3_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in, type1_out, type2_out, type3_out) -#define IPC_SYNC_MESSAGE_CONTROL5_4_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in, type1_out, type2_out, type3_out, type4_out) -#define IPC_SYNC_MESSAGE_ROUTED0_0_EXTRA(msg_class) -#define IPC_SYNC_MESSAGE_ROUTED0_1_EXTRA(msg_class, type1_out) -#define IPC_SYNC_MESSAGE_ROUTED0_2_EXTRA(msg_class, type1_out, type2_out) -#define IPC_SYNC_MESSAGE_ROUTED0_3_EXTRA(msg_class, type1_out, type2_out, type3_out) -#define IPC_SYNC_MESSAGE_ROUTED0_4_EXTRA(msg_class, type1_out, type2_out, type3_out, type4_out) -#define IPC_SYNC_MESSAGE_ROUTED1_0_EXTRA(msg_class, type1_in) -#define IPC_SYNC_MESSAGE_ROUTED1_1_EXTRA(msg_class, type1_in, type1_out) -#define IPC_SYNC_MESSAGE_ROUTED1_2_EXTRA(msg_class, type1_in, type1_out, type2_out) -#define IPC_SYNC_MESSAGE_ROUTED1_3_EXTRA(msg_class, type1_in, type1_out, type2_out, type3_out) -#define IPC_SYNC_MESSAGE_ROUTED1_4_EXTRA(msg_class, type1_in, type1_out, type2_out, type3_out, type4_out) -#define IPC_SYNC_MESSAGE_ROUTED2_0_EXTRA(msg_class, type1_in, type2_in) -#define IPC_SYNC_MESSAGE_ROUTED2_1_EXTRA(msg_class, type1_in, type2_in, type1_out) -#define IPC_SYNC_MESSAGE_ROUTED2_2_EXTRA(msg_class, type1_in, type2_in, type1_out, type2_out) -#define IPC_SYNC_MESSAGE_ROUTED2_3_EXTRA(msg_class, type1_in, type2_in, type1_out, type2_out, type3_out) -#define IPC_SYNC_MESSAGE_ROUTED2_4_EXTRA(msg_class, type1_in, type2_in, type1_out, type2_out, type3_out, type4_out) -#define IPC_SYNC_MESSAGE_ROUTED3_0_EXTRA(msg_class, type1_in, type2_in, type3_in) -#define IPC_SYNC_MESSAGE_ROUTED3_1_EXTRA(msg_class, type1_in, type2_in, type3_in, type1_out) -#define IPC_SYNC_MESSAGE_ROUTED3_2_EXTRA(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out) -#define IPC_SYNC_MESSAGE_ROUTED3_3_EXTRA(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out, type3_out) -#define IPC_SYNC_MESSAGE_ROUTED3_4_EXTRA(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out, type3_out, type4_out) -#define IPC_SYNC_MESSAGE_ROUTED4_0_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in) -#define IPC_SYNC_MESSAGE_ROUTED4_1_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out) -#define IPC_SYNC_MESSAGE_ROUTED4_2_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out, type2_out) -#define IPC_SYNC_MESSAGE_ROUTED4_3_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out, type2_out, type3_out) -#define IPC_SYNC_MESSAGE_ROUTED4_4_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out, type2_out, type3_out, type4_out) -#define IPC_SYNC_MESSAGE_ROUTED5_0_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in) -#define IPC_SYNC_MESSAGE_ROUTED5_1_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in, type1_out) -#define IPC_SYNC_MESSAGE_ROUTED5_2_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in, type1_out, type2_out) -#define IPC_SYNC_MESSAGE_ROUTED5_3_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in, type1_out, type2_out, type3_out) -#define IPC_SYNC_MESSAGE_ROUTED5_4_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in, type1_out, type2_out, type4_out) - -#endif // defined(IPC_MESSAGE_MACROS_LOG_ENABLED) +#include "ipc/ipc_message_utils_impl.h" +#endif // Macros for defining structs. May be subsequently redefined. #define IPC_STRUCT_BEGIN(struct_name) \ @@ -490,810 +183,491 @@ LogFunctionMap g_log_function_mapping; #define IPC_STRUCT_MEMBER(type, name) type name; #define IPC_STRUCT_END() }; -// Note: we currently use __LINE__ to give unique IDs to messages within a file. -// They're globally unique since each file defines its own IPC_MESSAGE_START. -// Ideally, we wouldn't use line numbers, but instead use the __COUNTER__ macro, -// but it needs gcc 4.3 and xcode doesn't use it yet. When that happens, switch -// to it. - +// Message macros collect specific numbers of arguments and funnel them into +// the common message generation macro. #define IPC_MESSAGE_CONTROL0(msg_class) \ - class msg_class : public IPC::Message { \ - public: \ - enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ - msg_class() \ - : IPC::Message(MSG_ROUTING_CONTROL, \ - ID, \ - PRIORITY_NORMAL) {} \ - }; \ - IPC_MESSAGE_CONTROL0_EXTRA(msg_class) + IPC_MESSAGE_DECL(EMPTY, CONTROL, msg_class, 0, 0, (), ()) #define IPC_MESSAGE_CONTROL1(msg_class, type1) \ - class msg_class : public IPC::MessageWithTuple< Tuple1<type1> > { \ - public: \ - enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ - msg_class(const type1& arg1); \ - ~msg_class(); \ - static void Log(std::string* name, const Message* msg, std::string* l); \ - }; \ - IPC_MESSAGE_CONTROL1_EXTRA(msg_class, type1) - -#define IPC_MESSAGE_CONTROL2(msg_class, type1, type2) \ - class msg_class : public IPC::MessageWithTuple< Tuple2<type1, type2> > { \ - public: \ - enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ - msg_class(const type1& arg1, const type2& arg2); \ - ~msg_class(); \ - static void Log(std::string* name, const Message* msg, std::string* l); \ - }; \ - IPC_MESSAGE_CONTROL2_EXTRA(msg_class, type1, type2) - -#define IPC_MESSAGE_CONTROL3(msg_class, type1, type2, type3) \ - class msg_class : \ - public IPC::MessageWithTuple< Tuple3<type1, type2, type3> > { \ - public: \ - enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ - msg_class(const type1& arg1, const type2& arg2, const type3& arg3); \ - ~msg_class(); \ - static void Log(std::string* name, const Message* msg, std::string* l); \ - }; \ - IPC_MESSAGE_CONTROL3_EXTRA(msg_class, type1, type2, type3) - -#define IPC_MESSAGE_CONTROL4(msg_class, type1, type2, type3, type4) \ - class msg_class : \ - public IPC::MessageWithTuple< Tuple4<type1, type2, type3, type4> > { \ - public: \ - enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ - msg_class(const type1& arg1, const type2& arg2, const type3& arg3, \ - const type4& arg4); \ - ~msg_class(); \ - static void Log(std::string* name, const Message* msg, std::string* l); \ - }; \ - IPC_MESSAGE_CONTROL4_EXTRA(msg_class, type1, type2, type3, type4) + IPC_MESSAGE_DECL(ASYNC, CONTROL, msg_class, 1, 0, (type1), ()) + +#define IPC_MESSAGE_CONTROL2(msg_class, type1, type2) \ + IPC_MESSAGE_DECL(ASYNC, CONTROL, msg_class, 2, 0, (type1, type2), ()) + +#define IPC_MESSAGE_CONTROL3(msg_class, type1, type2, type3) \ + IPC_MESSAGE_DECL(ASYNC, CONTROL, msg_class, 3, 0, (type1, type2, type3), ()) + +#define IPC_MESSAGE_CONTROL4(msg_class, type1, type2, type3, type4) \ + IPC_MESSAGE_DECL(ASYNC, CONTROL, msg_class, 4, 0, (type1, type2, type3, type4), ()) #define IPC_MESSAGE_CONTROL5(msg_class, type1, type2, type3, type4, type5) \ - class msg_class : \ - public IPC::MessageWithTuple< Tuple5<type1, type2, type3, type4, \ - type5> > { \ - public: \ - enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ - msg_class(const type1& arg1, const type2& arg2, \ - const type3& arg3, const type4& arg4, const type5& arg5); \ - ~msg_class(); \ - static void Log(std::string* name, const Message* msg, std::string* l); \ - }; \ - IPC_MESSAGE_CONTROL5_EXTRA(msg_class, type1, type2, type3, type4, type5) + IPC_MESSAGE_DECL(ASYNC, CONTROL, msg_class, 5, 0, (type1, type2, type3, type4, type5), ()) #define IPC_MESSAGE_ROUTED0(msg_class) \ - class msg_class : public IPC::Message { \ - public: \ - enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ - msg_class(int32 routing_id) \ - : IPC::Message(routing_id, ID, PRIORITY_NORMAL) {} \ - }; \ - IPC_MESSAGE_ROUTED0_EXTRA(msg_class) + IPC_MESSAGE_DECL(EMPTY, ROUTED, msg_class, 0, 0, (), ()) #define IPC_MESSAGE_ROUTED1(msg_class, type1) \ - class msg_class : public IPC::MessageWithTuple< Tuple1<type1> > { \ - public: \ - enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ - msg_class(int32 routing_id, const type1& arg1); \ - ~msg_class(); \ - static void Log(std::string* name, const Message* msg, std::string* l); \ - }; \ - IPC_MESSAGE_ROUTED1_EXTRA(msg_class, type1) - -#define IPC_MESSAGE_ROUTED2(msg_class, type1, type2) \ - class msg_class \ - : public IPC::MessageWithTuple< Tuple2<type1, type2> > { \ - public: \ - enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ - msg_class(int32 routing_id, const type1& arg1, const type2& arg2); \ - ~msg_class(); \ - static void Log(std::string* name, const Message* msg, std::string* l); \ - }; \ - IPC_MESSAGE_ROUTED2_EXTRA(msg_class, type1, type2) - -#define IPC_MESSAGE_ROUTED3(msg_class, type1, type2, type3) \ - class msg_class \ - : public IPC::MessageWithTuple< Tuple3<type1, type2, type3> > { \ - public: \ - enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ - msg_class(int32 routing_id, const type1& arg1, const type2& arg2, \ - const type3& arg3); \ - ~msg_class(); \ - static void Log(std::string* name, const Message* msg, std::string* l); \ - }; \ - IPC_MESSAGE_ROUTED3_EXTRA(msg_class, type1, type2, type3) - -#define IPC_MESSAGE_ROUTED4(msg_class, type1, type2, type3, type4) \ - class msg_class \ - : public IPC::MessageWithTuple< Tuple4<type1, type2, type3, type4> > { \ - public: \ - enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ - msg_class(int32 routing_id, const type1& arg1, const type2& arg2, \ - const type3& arg3, const type4& arg4); \ - ~msg_class(); \ - static void Log(std::string* name, const Message* msg, std::string* l); \ - }; \ - IPC_MESSAGE_ROUTED4_EXTRA(msg_class, type1, type2, type3, type4) + IPC_MESSAGE_DECL(ASYNC, ROUTED, msg_class, 1, 0, (type1), ()) + +#define IPC_MESSAGE_ROUTED2(msg_class, type1, type2) \ + IPC_MESSAGE_DECL(ASYNC, ROUTED, msg_class, 2, 0, (type1, type2), ()) + +#define IPC_MESSAGE_ROUTED3(msg_class, type1, type2, type3) \ + IPC_MESSAGE_DECL(ASYNC, ROUTED, msg_class, 3, 0, (type1, type2, type3), ()) + +#define IPC_MESSAGE_ROUTED4(msg_class, type1, type2, type3, type4) \ + IPC_MESSAGE_DECL(ASYNC, ROUTED, msg_class, 4, 0, (type1, type2, type3, type4), ()) #define IPC_MESSAGE_ROUTED5(msg_class, type1, type2, type3, type4, type5) \ - class msg_class \ - : public IPC::MessageWithTuple< Tuple5<type1, type2, type3, type4, \ - type5> > { \ - public: \ - enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ - msg_class(int32 routing_id, const type1& arg1, const type2& arg2, \ - const type3& arg3, const type4& arg4, const type5& arg5); \ - ~msg_class(); \ - static void Log(std::string* name, const Message* msg, std::string* l); \ - }; \ - IPC_MESSAGE_ROUTED5_EXTRA(msg_class, type1, type2, type3, type4, type5) + IPC_MESSAGE_DECL(ASYNC, ROUTED, msg_class, 5, 0, (type1, type2, type3, type4, type5), ()) #define IPC_SYNC_MESSAGE_CONTROL0_0(msg_class) \ - class msg_class : public IPC::MessageWithReply<Tuple0, Tuple0 > { \ - public: \ - enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ - msg_class(); \ - ~msg_class(); \ - static void Log(std::string* name, const Message* msg, std::string* l); \ - }; \ - IPC_SYNC_MESSAGE_CONTROL0_0_EXTRA(msg_class) - -#define IPC_SYNC_MESSAGE_CONTROL0_1(msg_class, type1_out) \ - class msg_class : public IPC::MessageWithReply<Tuple0, Tuple1<type1_out&> > {\ - public: \ - enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ - msg_class(type1_out* arg1); \ - ~msg_class(); \ - static void Log(std::string* name, const Message* msg, std::string* l); \ - }; \ - IPC_SYNC_MESSAGE_CONTROL0_1_EXTRA(msg_class, type1_out) + IPC_MESSAGE_DECL(SYNC, CONTROL, msg_class, 0, 0, (), ()) + +#define IPC_SYNC_MESSAGE_CONTROL0_1(msg_class, type1_out) \ + IPC_MESSAGE_DECL(SYNC, CONTROL, msg_class, 0, 1, (), (type1_out)) #define IPC_SYNC_MESSAGE_CONTROL0_2(msg_class, type1_out, type2_out) \ - class msg_class : \ - public IPC::MessageWithReply<Tuple0, Tuple2<type1_out&, type2_out&> > { \ - public: \ - enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ - msg_class(type1_out* arg1, type2_out* arg2); \ - ~msg_class(); \ - static void Log(std::string* name, const Message* msg, std::string* l); \ - }; \ - IPC_SYNC_MESSAGE_CONTROL0_2_EXTRA(msg_class, type1_out, type2_out) + IPC_MESSAGE_DECL(SYNC, CONTROL, msg_class, 0, 2, (), (type1_out, type2_out)) #define IPC_SYNC_MESSAGE_CONTROL0_3(msg_class, type1_out, type2_out, type3_out) \ - class msg_class : \ - public IPC::MessageWithReply<Tuple0, \ - Tuple3<type1_out&, type2_out&, type3_out&> >{ \ - public: \ - enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ - msg_class(type1_out* arg1, type2_out* arg2, type3_out* arg3); \ - ~msg_class(); \ - static void Log(std::string* name, const Message* msg, std::string* l); \ - }; \ - IPC_SYNC_MESSAGE_CONTROL0_3_EXTRA(msg_class, type1_out, type2_out, type3_out) + IPC_MESSAGE_DECL(SYNC, CONTROL, msg_class, 0, 3, (), (type1_out, type2_out, type3_out)) #define IPC_SYNC_MESSAGE_CONTROL0_4(msg_class, type1_out, type2_out, type3_out, type4_out) \ - class msg_class : \ - public IPC::MessageWithReply<Tuple0, \ - Tuple4<type1_out&, type2_out&, type3_out&, type4_out&> >{ \ - public: \ - enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ - msg_class(type1_out* arg1, type2_out* arg2, type3_out* arg3, type4_out* arg4); \ - ~msg_class(); \ - static void Log(std::string* name, const Message* msg, std::string* l); \ - }; \ - IPC_SYNC_MESSAGE_CONTROL0_4_EXTRA(msg_class, type1_out, type2_out, type3_out, type4_out) - -#define IPC_SYNC_MESSAGE_CONTROL1_0(msg_class, type1_in) \ - class msg_class : \ - public IPC::MessageWithReply<Tuple1<type1_in>, Tuple0 > { \ - public: \ - enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ - msg_class(const type1_in& arg1); \ - ~msg_class(); \ - static void Log(std::string* name, const Message* msg, std::string* l); \ - }; \ - IPC_SYNC_MESSAGE_CONTROL1_0_EXTRA(msg_class, type1_in) - -#define IPC_SYNC_MESSAGE_CONTROL1_1(msg_class, type1_in, type1_out) \ - class msg_class : \ - public IPC::MessageWithReply<Tuple1<type1_in>, Tuple1<type1_out&> > { \ - public: \ - enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ - msg_class(const type1_in& arg1, type1_out* arg2); \ - ~msg_class(); \ - static void Log(std::string* name, const Message* msg, std::string* l); \ - }; \ - IPC_SYNC_MESSAGE_CONTROL1_1_EXTRA(msg_class, type1_in, type1_out) + IPC_MESSAGE_DECL(SYNC, CONTROL, msg_class, 0, 4, (), (type1_out, type2_out, type3_out, type4_out)) + +#define IPC_SYNC_MESSAGE_CONTROL1_0(msg_class, type1_in) \ + IPC_MESSAGE_DECL(SYNC, CONTROL, msg_class, 1, 0, (type1_in), ()) + +#define IPC_SYNC_MESSAGE_CONTROL1_1(msg_class, type1_in, type1_out) \ + IPC_MESSAGE_DECL(SYNC, CONTROL, msg_class, 1, 1, (type1_in), (type1_out)) #define IPC_SYNC_MESSAGE_CONTROL1_2(msg_class, type1_in, type1_out, type2_out) \ - class msg_class : \ - public IPC::MessageWithReply<Tuple1<type1_in>, Tuple2<type1_out&, type2_out&> > { \ - public: \ - enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ - msg_class(const type1_in& arg1, type1_out* arg2, type2_out* arg3); \ - ~msg_class(); \ - static void Log(std::string* name, const Message* msg, std::string* l); \ - }; \ - IPC_SYNC_MESSAGE_CONTROL1_2_EXTRA(msg_class, type1_in, type1_out, type2_out) + IPC_MESSAGE_DECL(SYNC, CONTROL, msg_class, 1, 2, (type1_in), (type1_out, type2_out)) #define IPC_SYNC_MESSAGE_CONTROL1_3(msg_class, type1_in, type1_out, type2_out, type3_out) \ - class msg_class : \ - public IPC::MessageWithReply<Tuple1<type1_in>, \ - Tuple3<type1_out&, type2_out&, type3_out&> >{ \ - public: \ - enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ - msg_class(const type1_in& arg1, type1_out* arg2, type2_out* arg3, type3_out* arg4); \ - ~msg_class(); \ - static void Log(std::string* name, const Message* msg, std::string* l); \ - }; \ - IPC_SYNC_MESSAGE_CONTROL1_3_EXTRA(msg_class, type1_in, type1_out, type2_out, type3_out) + IPC_MESSAGE_DECL(SYNC, CONTROL, msg_class, 1, 3, (type1_in), (type1_out, type2_out, type3_out)) #define IPC_SYNC_MESSAGE_CONTROL1_4(msg_class, type1_in, type1_out, type2_out, type3_out, type4_out) \ - class msg_class : \ - public IPC::MessageWithReply<Tuple1<type1_in>, \ - Tuple4<type1_out&, type2_out&, type3_out&, type4_out&> >{ \ - public: \ - enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ - msg_class(const type1_in& arg1, type1_out* arg2, type2_out* arg3, type3_out* arg4, type4_out* arg5); \ - ~msg_class(); \ - static void Log(std::string* name, const Message* msg, std::string* l); \ - }; \ - IPC_SYNC_MESSAGE_CONTROL1_4_EXTRA(msg_class, type1_in, type1_out, type2_out, type3_out, type4_out) - -#define IPC_SYNC_MESSAGE_CONTROL2_0(msg_class, type1_in, type2_in) \ - class msg_class : \ - public IPC::MessageWithReply<Tuple2<type1_in, type2_in>, Tuple0 > { \ - public: \ - enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ - msg_class(const type1_in& arg1, const type2_in& arg2); \ - ~msg_class(); \ - static void Log(std::string* name, const Message* msg, std::string* l); \ - }; \ - IPC_SYNC_MESSAGE_CONTROL2_0_EXTRA(msg_class, type1_in, type2_in) + IPC_MESSAGE_DECL(SYNC, CONTROL, msg_class, 1, 4, (type1_in), (type1_out, type2_out, type3_out, type4_out)) + +#define IPC_SYNC_MESSAGE_CONTROL2_0(msg_class, type1_in, type2_in) \ + IPC_MESSAGE_DECL(SYNC, CONTROL, msg_class, 2, 0, (type1_in, type2_in), ()) #define IPC_SYNC_MESSAGE_CONTROL2_1(msg_class, type1_in, type2_in, type1_out) \ - class msg_class : \ - public IPC::MessageWithReply<Tuple2<type1_in, type2_in>, Tuple1<type1_out&> > { \ - public: \ - enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ - msg_class(const type1_in& arg1, const type2_in& arg2, type1_out* arg3); \ - ~msg_class(); \ - static void Log(std::string* name, const Message* msg, std::string* l); \ - }; \ - IPC_SYNC_MESSAGE_CONTROL2_1_EXTRA(msg_class, type1_in, type2_in, type1_out) + IPC_MESSAGE_DECL(SYNC, CONTROL, msg_class, 2, 1, (type1_in, type2_in), (type1_out)) #define IPC_SYNC_MESSAGE_CONTROL2_2(msg_class, type1_in, type2_in, type1_out, type2_out) \ - class msg_class : \ - public IPC::MessageWithReply<Tuple2<type1_in, type2_in>, \ - Tuple2<type1_out&, type2_out&> > { \ - public: \ - enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ - msg_class(const type1_in& arg1, const type2_in& arg2, type1_out* arg3, type2_out* arg4); \ - ~msg_class(); \ - static void Log(std::string* name, const Message* msg, std::string* l); \ - }; \ - IPC_SYNC_MESSAGE_CONTROL2_2_EXTRA(msg_class, type1_in, type2_in, type1_out, type2_out) + IPC_MESSAGE_DECL(SYNC, CONTROL, msg_class, 2, 2, (type1_in, type2_in), (type1_out, type2_out)) #define IPC_SYNC_MESSAGE_CONTROL2_3(msg_class, type1_in, type2_in, type1_out, type2_out, type3_out) \ - class msg_class : \ - public IPC::MessageWithReply<Tuple2<type1_in, type2_in>, \ - Tuple3<type1_out&, type2_out&, type3_out&> > { \ - public: \ - enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ - msg_class(const type1_in& arg1, const type2_in& arg2, type1_out* arg3, type2_out* arg4, type3_out* arg5); \ - ~msg_class(); \ - static void Log(std::string* name, const Message* msg, std::string* l); \ - }; \ - IPC_SYNC_MESSAGE_CONTROL2_3_EXTRA(msg_class, type1_in, type2_in, type1_out, type2_out, type3_out) + IPC_MESSAGE_DECL(SYNC, CONTROL, msg_class, 2, 3, (type1_in, type2_in), (type1_out, type2_out, type3_out)) #define IPC_SYNC_MESSAGE_CONTROL2_4(msg_class, type1_in, type2_in, type1_out, type2_out, type3_out, type4_out) \ - class msg_class : \ - public IPC::MessageWithReply<Tuple2<type1_in, type2_in>, \ - Tuple4<type1_out&, type2_out&, type3_out&, type4_out&> > { \ - public: \ - enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ - msg_class(const type1_in& arg1, const type2_in& arg2, type1_out* arg3, type2_out* arg4, type3_out* arg5, type4_out* arg6); \ - ~msg_class(); \ - static void Log(std::string* name, const Message* msg, std::string* l); \ - }; \ - IPC_SYNC_MESSAGE_CONTROL2_4_EXTRA(msg_class, type1_in, type2_in, type1_out, type2_out, type3_out, type4_out) + IPC_MESSAGE_DECL(SYNC, CONTROL, msg_class, 2, 4, (type1_in, type2_in), (type1_out, type2_out, type3_out, type4_out)) + +#define IPC_SYNC_MESSAGE_CONTROL3_0(msg_class, type1_in, type2_in, type3_in) \ + IPC_MESSAGE_DECL(SYNC, CONTROL, msg_class, 3, 0, (type1_in, type2_in, type3_in), ()) #define IPC_SYNC_MESSAGE_CONTROL3_1(msg_class, type1_in, type2_in, type3_in, type1_out) \ - class msg_class : \ - public IPC::MessageWithReply<Tuple3<type1_in, type2_in, type3_in>, \ - Tuple1<type1_out&> > { \ - public: \ - enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ - msg_class(const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, type1_out* arg4); \ - ~msg_class(); \ - static void Log(std::string* name, const Message* msg, std::string* l); \ - }; \ - IPC_SYNC_MESSAGE_CONTROL3_1_EXTRA(msg_class, type1_in, type2_in, type3_in, type1_out) + IPC_MESSAGE_DECL(SYNC, CONTROL, msg_class, 3, 1, (type1_in, type2_in, type3_in), (type1_out)) #define IPC_SYNC_MESSAGE_CONTROL3_2(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out) \ - class msg_class : \ - public IPC::MessageWithReply<Tuple3<type1_in, type2_in, type3_in>, \ - Tuple2<type1_out&, type2_out&> > { \ - public: \ - enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ - msg_class(const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, type1_out* arg4, type2_out* arg5); \ - ~msg_class(); \ - static void Log(std::string* name, const Message* msg, std::string* l); \ - }; \ - IPC_SYNC_MESSAGE_CONTROL3_2_EXTRA(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out) + IPC_MESSAGE_DECL(SYNC, CONTROL, msg_class, 3, 2, (type1_in, type2_in, type3_in), (type1_out, type2_out)) #define IPC_SYNC_MESSAGE_CONTROL3_3(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out, type3_out) \ - class msg_class : \ - public IPC::MessageWithReply<Tuple3<type1_in, type2_in, type3_in>, \ - Tuple3<type1_out&, type2_out&, type3_out&> > { \ - public: \ - enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ - msg_class(const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, type1_out* arg4, type2_out* arg5, type3_out* arg6); \ - ~msg_class(); \ - static void Log(std::string* name, const Message* msg, std::string* l); \ - }; \ - IPC_SYNC_MESSAGE_CONTROL3_3_EXTRA(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out, type3_out) + IPC_MESSAGE_DECL(SYNC, CONTROL, msg_class, 3, 3, (type1_in, type2_in, type3_in), (type1_out, type2_out, type3_out)) #define IPC_SYNC_MESSAGE_CONTROL3_4(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out, type3_out, type4_out) \ - class msg_class : \ - public IPC::MessageWithReply<Tuple3<type1_in, type2_in, type3_in>, \ - Tuple4<type1_out&, type2_out&, type3_out&, type4_out&> > { \ - public: \ - enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ - msg_class(const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, type1_out* arg4, type2_out* arg5, type3_out* arg6, type4_out* arg7); \ - ~msg_class(); \ - static void Log(std::string* name, const Message* msg, std::string* l); \ - }; \ - IPC_SYNC_MESSAGE_CONTROL3_4_EXTRA(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out, type3_out, type4_out) + IPC_MESSAGE_DECL(SYNC, CONTROL, msg_class, 3, 4, (type1_in, type2_in, type3_in), (type1_out, type2_out, type3_out, type4_out)) + +#define IPC_SYNC_MESSAGE_CONTROL4_0(msg_class, type1_in, type2_in, type3_in, type4_in) \ + IPC_MESSAGE_DECL(SYNC, CONTROL, msg_class, 4, 0, (type1_in, type2_in, type3_in, type4_in), ()) #define IPC_SYNC_MESSAGE_CONTROL4_1(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out) \ - class msg_class : \ - public IPC::MessageWithReply<Tuple4<type1_in, type2_in, type3_in, type4_in>, \ - Tuple1<type1_out&> > { \ - public: \ - enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ - msg_class(const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, const type4_in& arg4, type1_out* arg6); \ - ~msg_class(); \ - static void Log(std::string* name, const Message* msg, std::string* l); \ - }; \ - IPC_SYNC_MESSAGE_CONTROL4_1_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out) + IPC_MESSAGE_DECL(SYNC, CONTROL, msg_class, 4, 1, (type1_in, type2_in, type3_in, type4_in), (type1_out)) #define IPC_SYNC_MESSAGE_CONTROL4_2(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out, type2_out) \ - class msg_class : \ - public IPC::MessageWithReply<Tuple4<type1_in, type2_in, type3_in, type4_in>, \ - Tuple2<type1_out&, type2_out&> > { \ - public: \ - enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ - msg_class(const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, const type4_in& arg4, type1_out* arg5, type2_out* arg6); \ - ~msg_class(); \ - static void Log(std::string* name, const Message* msg, std::string* l); \ - }; \ - IPC_SYNC_MESSAGE_CONTROL4_2_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out, type2_out) + IPC_MESSAGE_DECL(SYNC, CONTROL, msg_class, 4, 2, (type1_in, type2_in, type3_in, type4_in), (type1_out, type2_out)) #define IPC_SYNC_MESSAGE_CONTROL4_3(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out, type2_out, type3_out) \ - class msg_class : \ - public IPC::MessageWithReply<Tuple4<type1_in, type2_in, type3_in, type4_in>, \ - Tuple3<type1_out&, type2_out&, type3_out&> > { \ - public: \ - enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ - msg_class(const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, const type4_in& arg4, type1_out* arg5, type2_out* arg6, type3_out* arg7); \ - ~msg_class(); \ - static void Log(std::string* name, const Message* msg, std::string* l); \ - }; \ - IPC_SYNC_MESSAGE_CONTROL4_3_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out, type2_out, type3_out) + IPC_MESSAGE_DECL(SYNC, CONTROL, msg_class, 4, 3, (type1_in, type2_in, type3_in, type4_in), (type1_out, type2_out, type3_out)) #define IPC_SYNC_MESSAGE_CONTROL4_4(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out, type2_out, type3_out, type4_out) \ - class msg_class : \ - public IPC::MessageWithReply<Tuple4<type1_in, type2_in, type3_in, type4_in>, \ - Tuple4<type1_out&, type2_out&, type3_out&, type4_out&> > { \ - public: \ - enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ - msg_class(const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, const type4_in& arg4, type1_out* arg5, type2_out* arg6, type3_out* arg7, type4_out* arg8); \ - ~msg_class(); \ - static void Log(std::string* name, const Message* msg, std::string* l); \ - }; \ - IPC_SYNC_MESSAGE_CONTROL4_4_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out, type2_out, type3_out, type4_out) + IPC_MESSAGE_DECL(SYNC, CONTROL, msg_class, 4, 4, (type1_in, type2_in, type3_in, type4_in), (type1_out, type2_out, type3_out, type4_out)) + +#define IPC_SYNC_MESSAGE_CONTROL5_0(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in) \ + IPC_MESSAGE_DECL(SYNC, CONTROL, msg_class, 5, 0, (type1_in, type2_in, type3_in, type4_in, type5_in), ())) #define IPC_SYNC_MESSAGE_CONTROL5_1(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in, type1_out) \ - class msg_class : \ - public IPC::MessageWithReply<Tuple5<type1_in, type2_in, type3_in, type4_in, type5_in>, \ - Tuple1<type1_out&> > { \ - public: \ - enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ - msg_class(const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, const type4_in& arg4, const type5_in& arg5, type1_out* arg6); \ - ~msg_class(); \ - static void Log(std::string* name, const Message* msg, std::string* l); \ - }; \ - IPC_SYNC_MESSAGE_CONTROL5_1_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in, type1_out) + IPC_MESSAGE_DECL(SYNC, CONTROL, msg_class, 5, 1, (type1_in, type2_in, type3_in, type4_in, type5_in), (type1_out)) #define IPC_SYNC_MESSAGE_CONTROL5_2(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in, type1_out, type2_out) \ - class msg_class : \ - public IPC::MessageWithReply<Tuple5<type1_in, type2_in, type3_in, type4_in, type5_in>, \ - Tuple2<type1_out&, type2_out&> > { \ - public: \ - enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ - msg_class(const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, const type4_in& arg4, const type5_in& arg5, type1_out* arg6, type2_out* arg7); \ - ~msg_class(); \ - static void Log(std::string* name, const Message* msg, std::string* l); \ - }; \ - IPC_SYNC_MESSAGE_CONTROL5_2_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in, type1_out, type2_out) + IPC_MESSAGE_DECL(SYNC, CONTROL, msg_class, 5, 2, (type1_in, type2_in, type3_in, type4_in, type5_in), (type1_out, type2_out)) #define IPC_SYNC_MESSAGE_CONTROL5_3(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in, type1_out, type2_out, type3_out) \ - class msg_class : \ - public IPC::MessageWithReply<Tuple5<type1_in, type2_in, type3_in, type4_in, type5_in>, \ - Tuple3<type1_out&, type2_out&, type3_out&> > { \ - public: \ - enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ - msg_class(const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, const type4_in& arg4, const type5_in& arg5, type1_out* arg6, type2_out* arg7, type3_out* arg8); \ - ~msg_class(); \ - static void Log(std::string* name, const Message* msg, std::string* l); \ - }; \ - IPC_SYNC_MESSAGE_CONTROL5_3_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in, type1_out, type2_out, type3_out) + IPC_MESSAGE_DECL(SYNC, CONTROL, msg_class, 5, 3, (type1_in, type2_in, type3_in, type4_in, type5_in), (type1_out, type2_out, type3_out)) #define IPC_SYNC_MESSAGE_CONTROL5_4(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in, type1_out, type2_out, type3_out, type4_out) \ - class msg_class : \ - public IPC::MessageWithReply<Tuple5<type1_in, type2_in, type3_in, type4_in, type5_in>, \ - Tuple4<type1_out&, type2_out&, type3_out&, type4_out&> > { \ - public: \ - enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ - msg_class(const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, const type4_in& arg4, const type5_in& arg5, type1_out* arg6, type2_out* arg7, type3_out* arg8, type4_out* arg9); \ - ~msg_class(); \ - static void Log(std::string* name, const Message* msg, std::string* l); \ - }; \ - IPC_SYNC_MESSAGE_CONTROL5_4_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in, type1_out, type2_out, type3_out, type4_out) + IPC_MESSAGE_DECL(SYNC, CONTROL, msg_class, 5, 4, (type1_in, type2_in, type3_in, type4_in, type5_in), (type1_out, type2_out, type3_out, type4_out)) #define IPC_SYNC_MESSAGE_ROUTED0_0(msg_class) \ - class msg_class : public IPC::MessageWithReply<Tuple0, Tuple0 > { \ - public: \ - enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ - msg_class(int routing_id); \ - ~msg_class(); \ - static void Log(std::string* name, const Message* msg, std::string* l); \ - }; \ - IPC_SYNC_MESSAGE_ROUTED0_0_EXTRA(msg_class) + IPC_MESSAGE_DECL(SYNC, ROUTED, msg_class, 0, 0, (), ()) #define IPC_SYNC_MESSAGE_ROUTED0_1(msg_class, type1_out) \ - class msg_class : public IPC::MessageWithReply<Tuple0, Tuple1<type1_out&> > { \ - public: \ - enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ - msg_class(int routing_id, type1_out* arg1); \ - ~msg_class(); \ - static void Log(std::string* name, const Message* msg, std::string* l); \ - }; \ - IPC_SYNC_MESSAGE_ROUTED0_1_EXTRA(msg_class, type1_out) + IPC_MESSAGE_DECL(SYNC, ROUTED, msg_class, 0, 1, (), (type1_out)) #define IPC_SYNC_MESSAGE_ROUTED0_2(msg_class, type1_out, type2_out) \ - class msg_class : \ - public IPC::MessageWithReply<Tuple0, Tuple2<type1_out&, type2_out&> > { \ - public: \ - enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ - msg_class(int routing_id, type1_out* arg1, type2_out* arg2); \ - ~msg_class(); \ - static void Log(std::string* name, const Message* msg, std::string* l); \ - }; \ - IPC_SYNC_MESSAGE_ROUTED0_2_EXTRA(msg_class, type1_out, type2_out) + IPC_MESSAGE_DECL(SYNC, ROUTED, msg_class, 0, 2, (), (type1_out, type2_out)) #define IPC_SYNC_MESSAGE_ROUTED0_3(msg_class, type1_out, type2_out, type3_out) \ - class msg_class : \ - public IPC::MessageWithReply<Tuple0, \ - Tuple3<type1_out&, type2_out&, type3_out&> >{ \ - public: \ - enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ - msg_class(int routing_id, type1_out* arg1, type2_out* arg2, type3_out* arg3); \ - ~msg_class(); \ - static void Log(std::string* name, const Message* msg, std::string* l); \ - }; \ - IPC_SYNC_MESSAGE_ROUTED0_3_EXTRA(msg_class, type1_out, type2_out, type3_out) + IPC_MESSAGE_DECL(SYNC, ROUTED, msg_class, 0, 3, (), (type1_out, type2_out, type3_out)) #define IPC_SYNC_MESSAGE_ROUTED0_4(msg_class, type1_out, type2_out, type3_out, type4_out) \ - class msg_class : \ - public IPC::MessageWithReply<Tuple0, \ - Tuple4<type1_out&, type2_out&, type3_out&, type4_out&> >{ \ - public: \ - enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ - msg_class(int routing_id, type1_out* arg1, type2_out* arg2, type3_out* arg3, type4_out* arg4); \ - ~msg_class(); \ - static void Log(std::string* name, const Message* msg, std::string* l); \ - }; \ - IPC_SYNC_MESSAGE_ROUTED0_4_EXTRA(msg_class, type1_out, type2_out, type3_out, type4_out) + IPC_MESSAGE_DECL(SYNC, ROUTED, msg_class, 0, 4, (), (type1_out, type2_out, type3_out, type4_out)) #define IPC_SYNC_MESSAGE_ROUTED1_0(msg_class, type1_in) \ - class msg_class : \ - public IPC::MessageWithReply<Tuple1<type1_in>, Tuple0 > { \ - public: \ - enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ - msg_class(int routing_id, const type1_in& arg1); \ - ~msg_class(); \ - static void Log(std::string* name, const Message* msg, std::string* l); \ - }; \ - IPC_SYNC_MESSAGE_ROUTED1_0_EXTRA(msg_class, type1_in) + IPC_MESSAGE_DECL(SYNC, ROUTED, msg_class, 1, 0, (type1_in), ()) #define IPC_SYNC_MESSAGE_ROUTED1_1(msg_class, type1_in, type1_out) \ - class msg_class : \ - public IPC::MessageWithReply<Tuple1<type1_in>, Tuple1<type1_out&> > { \ - public: \ - enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ - msg_class(int routing_id, const type1_in& arg1, type1_out* arg2); \ - ~msg_class(); \ - static void Log(std::string* name, const Message* msg, std::string* l); \ - }; \ - IPC_SYNC_MESSAGE_ROUTED1_1_EXTRA(msg_class, type1_in, type1_out) + IPC_MESSAGE_DECL(SYNC, ROUTED, msg_class, 1, 1, (type1_in), (type1_out)) #define IPC_SYNC_MESSAGE_ROUTED1_2(msg_class, type1_in, type1_out, type2_out) \ - class msg_class : \ - public IPC::MessageWithReply<Tuple1<type1_in>, Tuple2<type1_out&, type2_out&> > { \ - public: \ - enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ - msg_class(int routing_id, const type1_in& arg1, type1_out* arg2, type2_out* arg3); \ - ~msg_class(); \ - static void Log(std::string* name, const Message* msg, std::string* l); \ - }; \ - IPC_SYNC_MESSAGE_ROUTED1_2_EXTRA(msg_class, type1_in, type1_out, type2_out) + IPC_MESSAGE_DECL(SYNC, ROUTED, msg_class, 1, 2, (type1_in), (type1_out, type2_out)) #define IPC_SYNC_MESSAGE_ROUTED1_3(msg_class, type1_in, type1_out, type2_out, type3_out) \ - class msg_class : \ - public IPC::MessageWithReply<Tuple1<type1_in>, \ - Tuple3<type1_out&, type2_out&, type3_out&> >{ \ - public: \ - enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ - msg_class(int routing_id, const type1_in& arg1, type1_out* arg2, type2_out* arg3, type3_out* arg4); \ - ~msg_class(); \ - static void Log(std::string* name, const Message* msg, std::string* l); \ - }; \ - IPC_SYNC_MESSAGE_ROUTED1_3_EXTRA(msg_class, type1_in, type1_out, type2_out, type3_out) + IPC_MESSAGE_DECL(SYNC, ROUTED, msg_class, 1, 3, (type1_in), (type1_out, type2_out, type3_out)) #define IPC_SYNC_MESSAGE_ROUTED1_4(msg_class, type1_in, type1_out, type2_out, type3_out, type4_out) \ - class msg_class : \ - public IPC::MessageWithReply<Tuple1<type1_in>, \ - Tuple4<type1_out&, type2_out&, type3_out&, type4_out&> >{ \ - public: \ - enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ - msg_class(int routing_id, const type1_in& arg1, type1_out* arg2, type2_out* arg3, type3_out* arg4, type4_out* arg5); \ - ~msg_class(); \ - static void Log(std::string* name, const Message* msg, std::string* l); \ - }; \ - IPC_SYNC_MESSAGE_ROUTED1_4_EXTRA(msg_class, type1_in, type1_out, type2_out, type3_out, type4_out) + IPC_MESSAGE_DECL(SYNC, ROUTED, msg_class, 1, 4, (type1_in), (type1_out, type2_out, type3_out, type4_out)) #define IPC_SYNC_MESSAGE_ROUTED2_0(msg_class, type1_in, type2_in) \ - class msg_class : \ - public IPC::MessageWithReply<Tuple2<type1_in, type2_in>, Tuple0 > { \ - public: \ - enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ - msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2); \ - ~msg_class(); \ - static void Log(std::string* name, const Message* msg, std::string* l); \ - }; \ - IPC_SYNC_MESSAGE_ROUTED2_0_EXTRA(msg_class, type1_in, type2_in) + IPC_MESSAGE_DECL(SYNC, ROUTED, msg_class, 2, 0, (type1_in, type2_in), ()) #define IPC_SYNC_MESSAGE_ROUTED2_1(msg_class, type1_in, type2_in, type1_out) \ - class msg_class : \ - public IPC::MessageWithReply<Tuple2<type1_in, type2_in>, Tuple1<type1_out&> > { \ - public: \ - enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ - msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, type1_out* arg3); \ - ~msg_class(); \ - static void Log(std::string* name, const Message* msg, std::string* l); \ - }; \ - IPC_SYNC_MESSAGE_ROUTED2_1_EXTRA(msg_class, type1_in, type2_in, type1_out) + IPC_MESSAGE_DECL(SYNC, ROUTED, msg_class, 2, 1, (type1_in, type2_in), (type1_out)) #define IPC_SYNC_MESSAGE_ROUTED2_2(msg_class, type1_in, type2_in, type1_out, type2_out) \ - class msg_class : \ - public IPC::MessageWithReply<Tuple2<type1_in, type2_in>, \ - Tuple2<type1_out&, type2_out&> > { \ - public: \ - enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ - msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, type1_out* arg3, type2_out* arg4); \ - ~msg_class(); \ - static void Log(std::string* name, const Message* msg, std::string* l); \ - }; \ - IPC_SYNC_MESSAGE_ROUTED2_2_EXTRA(msg_class, type1_in, type2_in, type1_out, type2_out) + IPC_MESSAGE_DECL(SYNC, ROUTED, msg_class, 2, 2, (type1_in, type2_in), (type1_out, type2_out)) #define IPC_SYNC_MESSAGE_ROUTED2_3(msg_class, type1_in, type2_in, type1_out, type2_out, type3_out) \ - class msg_class : \ - public IPC::MessageWithReply<Tuple2<type1_in, type2_in>, \ - Tuple3<type1_out&, type2_out&, type3_out&> > { \ - public: \ - enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ - msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, type1_out* arg3, type2_out* arg4, type3_out* arg5); \ - ~msg_class(); \ - static void Log(std::string* name, const Message* msg, std::string* l); \ - }; \ - IPC_SYNC_MESSAGE_ROUTED2_3_EXTRA(msg_class, type1_in, type2_in, type1_out, type2_out, type3_out) + IPC_MESSAGE_DECL(SYNC, ROUTED, msg_class, 2, 3, (type1_in, type2_in), (type1_out, type2_out, type3_out)) #define IPC_SYNC_MESSAGE_ROUTED2_4(msg_class, type1_in, type2_in, type1_out, type2_out, type3_out, type4_out) \ - class msg_class : \ - public IPC::MessageWithReply<Tuple2<type1_in, type2_in>, \ - Tuple4<type1_out&, type2_out&, type3_out&, type4_out&> > { \ - public: \ - enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ - msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, type1_out* arg3, type2_out* arg4, type3_out* arg5, type4_out* arg6); \ - ~msg_class(); \ - static void Log(std::string* name, const Message* msg, std::string* l); \ - }; \ - IPC_SYNC_MESSAGE_ROUTED2_4_EXTRA(msg_class, type1_in, type2_in, type1_out, type2_out, type3_out, type4_out) + IPC_MESSAGE_DECL(SYNC, ROUTED, msg_class, 2, 4, (type1_in, type2_in), (type1_out, type2_out, type3_out, type4_out)) #define IPC_SYNC_MESSAGE_ROUTED3_0(msg_class, type1_in, type2_in, type3_in) \ - class msg_class : \ - public IPC::MessageWithReply<Tuple3<type1_in, type2_in, type3_in>, Tuple0 > { \ - public: \ - enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ - msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3); \ - ~msg_class(); \ - static void Log(std::string* name, const Message* msg, std::string* l); \ - }; \ - IPC_SYNC_MESSAGE_ROUTED3_0_EXTRA(msg_class, type1_in, type2_in, type3_in) + IPC_MESSAGE_DECL(SYNC, ROUTED, msg_class, 3, 0, (type1_in, type2_in, type3_in), ()) #define IPC_SYNC_MESSAGE_ROUTED3_1(msg_class, type1_in, type2_in, type3_in, type1_out) \ - class msg_class : \ - public IPC::MessageWithReply<Tuple3<type1_in, type2_in, type3_in>, \ - Tuple1<type1_out&> > { \ - public: \ - enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ - msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, type1_out* arg4); \ - ~msg_class(); \ - static void Log(std::string* name, const Message* msg, std::string* l); \ - }; \ - IPC_SYNC_MESSAGE_ROUTED3_1_EXTRA(msg_class, type1_in, type2_in, type3_in, type1_out) + IPC_MESSAGE_DECL(SYNC, ROUTED, msg_class, 3, 1, (type1_in, type2_in, type3_in), (type1_out)) #define IPC_SYNC_MESSAGE_ROUTED3_2(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out) \ - class msg_class : \ - public IPC::MessageWithReply<Tuple3<type1_in, type2_in, type3_in>, \ - Tuple2<type1_out&, type2_out&> > { \ - public: \ - enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ - msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, type1_out* arg4, type2_out* arg5); \ - ~msg_class(); \ - static void Log(std::string* name, const Message* msg, std::string* l); \ - }; \ - IPC_SYNC_MESSAGE_ROUTED3_2_EXTRA(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out) + IPC_MESSAGE_DECL(SYNC, ROUTED, msg_class, 3, 2, (type1_in, type2_in, type3_in), (type1_out, type2_out)) #define IPC_SYNC_MESSAGE_ROUTED3_3(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out, type3_out) \ - class msg_class : \ - public IPC::MessageWithReply<Tuple3<type1_in, type2_in, type3_in>, \ - Tuple3<type1_out&, type2_out&, type3_out&> > { \ - public: \ - enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ - msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, type1_out* arg4, type2_out* arg5, type3_out* arg6); \ - ~msg_class(); \ - static void Log(std::string* name, const Message* msg, std::string* l); \ - }; \ - IPC_SYNC_MESSAGE_ROUTED3_3_EXTRA(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out, type3_out) + IPC_MESSAGE_DECL(SYNC, ROUTED, msg_class, 3, 3, (type1_in, type2_in, type3_in), (type1_out, type2_out, type3_out)) #define IPC_SYNC_MESSAGE_ROUTED3_4(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out, type3_out, type4_out) \ - class msg_class : \ - public IPC::MessageWithReply<Tuple3<type1_in, type2_in, type3_in>, \ - Tuple4<type1_out&, type2_out&, type3_out&, type4_out&> > { \ - public: \ - enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ - msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, type1_out* arg4, type2_out* arg5, type3_out* arg6, type4_out* arg7); \ - ~msg_class(); \ - static void Log(std::string* name, const Message* msg, std::string* l); \ - }; \ - IPC_SYNC_MESSAGE_ROUTED3_4_EXTRA(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out, type3_out, type4_out) + IPC_MESSAGE_DECL(SYNC, ROUTED, msg_class, 3, 4, (type1_in, type2_in, type3_in), (type1_out, type2_out, type3_out, type4_out)) #define IPC_SYNC_MESSAGE_ROUTED4_0(msg_class, type1_in, type2_in, type3_in, type4_in) \ - class msg_class : \ - public IPC::MessageWithReply<Tuple4<type1_in, type2_in, type3_in, type4_in>, \ - Tuple0 > { \ - public: \ - enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ - msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, const type4_in& arg4); \ - ~msg_class(); \ - static void Log(std::string* name, const Message* msg, std::string* l); \ - }; \ - IPC_SYNC_MESSAGE_ROUTED4_0_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in) + IPC_MESSAGE_DECL(SYNC, ROUTED, msg_class, 4, 1, (type1_in, type2_in, type3_in, type4_in), ()) #define IPC_SYNC_MESSAGE_ROUTED4_1(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out) \ - class msg_class : \ - public IPC::MessageWithReply<Tuple4<type1_in, type2_in, type3_in, type4_in>, \ - Tuple1<type1_out&> > { \ - public: \ - enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ - msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, const type4_in& arg4, type1_out* arg6); \ - ~msg_class(); \ - static void Log(std::string* name, const Message* msg, std::string* l); \ - }; \ - IPC_SYNC_MESSAGE_ROUTED4_1_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out) + IPC_MESSAGE_DECL(SYNC, ROUTED, msg_class, 4, 1, (type1_in, type2_in, type3_in, type4_in), (type1_out)) #define IPC_SYNC_MESSAGE_ROUTED4_2(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out, type2_out) \ - class msg_class : \ - public IPC::MessageWithReply<Tuple4<type1_in, type2_in, type3_in, type4_in>, \ - Tuple2<type1_out&, type2_out&> > { \ - public: \ - enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ - msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, const type4_in& arg4, type1_out* arg5, type2_out* arg6); \ - ~msg_class(); \ - static void Log(std::string* name, const Message* msg, std::string* l); \ - }; \ - IPC_SYNC_MESSAGE_ROUTED4_2_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out, type2_out) + IPC_MESSAGE_DECL(SYNC, ROUTED, msg_class, 4, 2, (type1_in, type2_in, type3_in, type4_in), (type1_out, type2_out)) #define IPC_SYNC_MESSAGE_ROUTED4_3(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out, type2_out, type3_out) \ - class msg_class : \ - public IPC::MessageWithReply<Tuple4<type1_in, type2_in, type3_in, type4_in>, \ - Tuple3<type1_out&, type2_out&, type3_out&> > { \ - public: \ - enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ - msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, const type4_in& arg4, type1_out* arg5, type2_out* arg6, type3_out* arg7); \ - ~msg_class(); \ - static void Log(std::string* name, const Message* msg, std::string* l); \ - }; \ - IPC_SYNC_MESSAGE_ROUTED4_3_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out, type2_out, type3_out) + IPC_MESSAGE_DECL(SYNC, ROUTED, msg_class, 4, 3, (type1_in, type2_in, type3_in, type4_in), (type1_out, type2_out, type3_out)) #define IPC_SYNC_MESSAGE_ROUTED4_4(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out, type2_out, type3_out, type4_out) \ - class msg_class : \ - public IPC::MessageWithReply<Tuple4<type1_in, type2_in, type3_in, type4_in>, \ - Tuple4<type1_out&, type2_out&, type3_out&, type4_out&> > { \ - public: \ - enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ - msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, const type4_in& arg4, type1_out* arg5, type2_out* arg6, type3_out* arg7, type4_out* arg8); \ - ~msg_class(); \ - static void Log(std::string* name, const Message* msg, std::string* l); \ - }; \ - IPC_SYNC_MESSAGE_ROUTED4_4_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out, type2_out, type3_out, type4_out) + IPC_MESSAGE_DECL(SYNC, ROUTED, msg_class, 4, 4, (type1_in, type2_in, type3_in, type4_in), (type1_out, type2_out, type3_out, type4_out)) #define IPC_SYNC_MESSAGE_ROUTED5_0(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in) \ - class msg_class : \ - public IPC::MessageWithReply<Tuple5<type1_in, type2_in, type3_in, type4_in, type5_in>, \ - Tuple0 > { \ - public: \ - enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ - msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, const type4_in& arg4, const type5_in& arg5); \ - ~msg_class(); \ - static void Log(std::string* name, const Message* msg, std::string* l); \ - }; \ - IPC_SYNC_MESSAGE_ROUTED5_0_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in) + IPC_MESSAGE_DECL(SYNC, ROUTED, msg_class, 5, 1, (type1_in, type2_in, type3_in, type4_in, type5_in), ())) #define IPC_SYNC_MESSAGE_ROUTED5_1(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in, type1_out) \ - class msg_class : \ - public IPC::MessageWithReply<Tuple5<type1_in, type2_in, type3_in, type4_in, type5_in>, \ - Tuple1<type1_out&> > { \ - public: \ - enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ - msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, const type4_in& arg4, const type5_in& arg5, type1_out* arg6); \ - ~msg_class(); \ - static void Log(std::string* name, const Message* msg, std::string* l); \ - }; \ - IPC_SYNC_MESSAGE_ROUTED5_1_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in, type1_out) + IPC_MESSAGE_DECL(SYNC, ROUTED, msg_class, 5, 1, (type1_in, type2_in, type3_in, type4_in, type5_in), (type1_out)) #define IPC_SYNC_MESSAGE_ROUTED5_2(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in, type1_out, type2_out) \ - class msg_class : \ - public IPC::MessageWithReply<Tuple5<type1_in, type2_in, type3_in, type4_in, type5_in>, \ - Tuple2<type1_out&, type2_out&> > { \ - public: \ - enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ - msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, const type4_in& arg4, const type4_in& arg5, type1_out* arg6, type2_out* arg7); \ - ~msg_class(); \ - static void Log(std::string* name, const Message* msg, std::string* l); \ - }; \ - IPC_SYNC_MESSAGE_ROUTED5_2_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in, type1_out, type2_out) + IPC_MESSAGE_DECL(SYNC, ROUTED, msg_class, 5, 2, (type1_in, type2_in, type3_in, type4_in, type5_in), (type1_out, type2_out)) #define IPC_SYNC_MESSAGE_ROUTED5_3(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in, type1_out, type2_out, type3_out) \ - class msg_class : \ - public IPC::MessageWithReply<Tuple5<type1_in, type2_in, type3_in, type4_in, type5_in>, \ - Tuple3<type1_out&, type2_out&, type3_out&> > { \ - public: \ - enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ - msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, const type4_in& arg4, const type4_in& arg5, type1_out* arg6, type2_out* arg7, type3_out* arg8); \ - ~msg_class(); \ - static void Log(std::string* name, const Message* msg, std::string* l); \ - }; \ - IPC_SYNC_MESSAGE_ROUTED5_3_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in, type1_out, type2_out, type3_out) + IPC_MESSAGE_DECL(SYNC, ROUTED, msg_class, 5, 3, (type1_in, type2_in, type3_in, type4_in, type5_in), (type1_out, type2_out, type3_out)) #define IPC_SYNC_MESSAGE_ROUTED5_4(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in, type1_out, type2_out, type3_out, type4_out) \ - class msg_class : \ - public IPC::MessageWithReply<Tuple5<type1_in, type2_in, type3_in, type4_in, type5_in>, \ - Tuple4<type1_out&, type2_out&, type3_out&, type4_out&> > { \ - public: \ - enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ - msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, const type4_in& arg4, const type4_in& arg5, type1_out* arg6, type2_out* arg7, type3_out* arg8, type4_out* arg9); \ - ~msg_class(); \ - static void Log(std::string* name, const Message* msg, std::string* l); \ - }; \ - IPC_SYNC_MESSAGE_ROUTED5_4_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in, type1_out, type2_out, type3_out, type4_out) + IPC_MESSAGE_DECL(SYNC, ROUTED, msg_class, 5, 4, (type1_in, type2_in, type3_in, type4_in, type5_in), (type1_out, type2_out, type3_out, type4_out)) + +// Common message macro which dispatches into one of the 6 (sync x kind) +// routines. There is a way that these 6 cases can be lumped together, +// but the macros get very complicated in that case. +// Note: we currently use __LINE__ to give unique IDs to messages within +// a file. They're globally unique since each file defines its own +// IPC_MESSAGE_START. Ideally, we wouldn't use line numbers (a possibility +// is to instead use the __COUNTER__ macro, but it needs gcc 4.3 and xcode +// doesn't use it yet). +#define IPC_MESSAGE_DECL(sync, kind, msg_class, \ + in_cnt, out_cnt, in_list, out_list) \ + IPC_##sync##_##kind##_DECL(msg_class, in_cnt, out_cnt, in_list, out_list) \ + IPC_MESSAGE_EXTRA(sync, kind, msg_class, in_cnt, out_cnt, in_list, out_list) + +#define IPC_EMPTY_CONTROL_DECL(msg_class, in_cnt, out_cnt, in_list, out_list) \ + class msg_class : public IPC::Message { \ + public: \ + enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ + msg_class() : IPC::Message(MSG_ROUTING_CONTROL, ID, PRIORITY_NORMAL) {} \ + }; + +#define IPC_EMPTY_ROUTED_DECL(msg_class, in_cnt, out_cnt, in_list, out_list) \ + class msg_class : public IPC::Message { \ + public: \ + enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ + msg_class(int32 routing_id) \ + : IPC::Message(routing_id, ID, PRIORITY_NORMAL) {} \ + }; + +#define IPC_ASYNC_CONTROL_DECL(msg_class, in_cnt, out_cnt, in_list, out_list) \ + class msg_class : \ + public IPC::MessageWithTuple<IPC_TUPLE_IN_##in_cnt in_list> { \ + public: \ + enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ + msg_class(IPC_TYPE_IN_##in_cnt in_list); \ + ~msg_class(); \ + static void Log(std::string* name, const Message* msg, std::string* l); \ + }; + +#define IPC_ASYNC_ROUTED_DECL(msg_class, in_cnt, out_cnt, in_list, out_list) \ + class msg_class : \ + public IPC::MessageWithTuple<IPC_TUPLE_IN_##in_cnt in_list> { \ + public: \ + enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ + msg_class(int32 routing_id IPC_COMMA_##in_cnt \ + IPC_TYPE_IN_##in_cnt in_list); \ + ~msg_class(); \ + static void Log(std::string* name, const Message* msg, std::string* l); \ + }; + +#define IPC_SYNC_CONTROL_DECL(msg_class, in_cnt, out_cnt, in_list, out_list) \ + class msg_class : \ + public IPC::MessageWithReply<IPC_TUPLE_IN_##in_cnt in_list, \ + IPC_TUPLE_OUT_##out_cnt out_list> { \ + public: \ + enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ + msg_class(IPC_TYPE_IN_##in_cnt in_list \ + IPC_COMMA_AND_##in_cnt(IPC_COMMA_##out_cnt) \ + IPC_TYPE_OUT_##out_cnt out_list); \ + ~msg_class(); \ + static void Log(std::string* name, const Message* msg, std::string* l); \ + }; + +#define IPC_SYNC_ROUTED_DECL(msg_class, in_cnt, out_cnt, in_list, out_list) \ + class msg_class : \ + public IPC::MessageWithReply<IPC_TUPLE_IN_##in_cnt in_list, \ + IPC_TUPLE_OUT_##out_cnt out_list> { \ + public: \ + enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ + msg_class(int32 routing_id \ + IPC_COMMA_OR_##in_cnt(IPC_COMMA_##out_cnt) \ + IPC_TYPE_IN_##in_cnt in_list \ + IPC_COMMA_AND_##in_cnt(IPC_COMMA_##out_cnt) \ + IPC_TYPE_OUT_##out_cnt out_list); \ + ~msg_class(); \ + static void Log(std::string* name, const Message* msg, std::string* l); \ + }; +#if defined(IPC_MESSAGE_IMPL) + +// "Implementation" inclusion produces constructors, destructors, and +// logging functions, except for the no-arg special cases, where the +// implementation occurs in the declaration, and there is no special +// logging function. +#define IPC_MESSAGE_EXTRA(sync, kind, msg_class, \ + in_cnt, out_cnt, in_list, out_list) \ + IPC_##sync##_##kind##_IMPL(msg_class, in_cnt, out_cnt, in_list, out_list) \ + IPC_##sync##_MESSAGE_LOG(msg_class) + +#define IPC_EMPTY_CONTROL_IMPL(msg_class, in_cnt, out_cnt, in_list, out_list) +#define IPC_EMPTY_ROUTED_IMPL(msg_class, in_cnt, out_cnt, in_list, out_list) + +#define IPC_ASYNC_CONTROL_IMPL(msg_class, in_cnt, out_cnt, in_list, out_list) \ + msg_class::msg_class(IPC_TYPE_IN_##in_cnt in_list) : \ + IPC::MessageWithTuple<IPC_TUPLE_IN_##in_cnt in_list> \ + (MSG_ROUTING_CONTROL, ID, IPC_NAME_IN_##in_cnt in_list) \ + {} \ + msg_class::~msg_class() {} + +#define IPC_ASYNC_ROUTED_IMPL(msg_class, in_cnt, out_cnt, in_list, out_list) \ + msg_class::msg_class(int32 routing_id IPC_COMMA_##in_cnt \ + IPC_TYPE_IN_##in_cnt in_list) : \ + IPC::MessageWithTuple<IPC_TUPLE_IN_##in_cnt in_list> \ + (routing_id, ID, IPC_NAME_IN_##in_cnt in_list) \ + {} \ + msg_class::~msg_class() {} + +#define IPC_SYNC_CONTROL_IMPL(msg_class, in_cnt, out_cnt, in_list, out_list) \ + msg_class::msg_class(IPC_TYPE_IN_##in_cnt in_list \ + IPC_COMMA_AND_##in_cnt(IPC_COMMA_##out_cnt) \ + IPC_TYPE_OUT_##out_cnt out_list) : \ + IPC::MessageWithReply<IPC_TUPLE_IN_##in_cnt in_list, \ + IPC_TUPLE_OUT_##out_cnt out_list> \ + (MSG_ROUTING_CONTROL, ID, \ + IPC_NAME_IN_##in_cnt in_list, \ + IPC_NAME_OUT_##out_cnt out_list) \ + {} \ + msg_class::~msg_class() {} + +#define IPC_SYNC_ROUTED_IMPL(msg_class, in_cnt, out_cnt, in_list, out_list) \ + msg_class::msg_class(int32 routing_id \ + IPC_COMMA_OR_##in_cnt(IPC_COMMA_##out_cnt) \ + IPC_TYPE_IN_##in_cnt in_list \ + IPC_COMMA_AND_##in_cnt(IPC_COMMA_##out_cnt) \ + IPC_TYPE_OUT_##out_cnt out_list) : \ + IPC::MessageWithReply<IPC_TUPLE_IN_##in_cnt in_list, \ + IPC_TUPLE_OUT_##out_cnt out_list> \ + (routing_id, ID, \ + IPC_NAME_IN_##in_cnt in_list, \ + IPC_NAME_OUT_##out_cnt out_list) \ + {} \ + msg_class::~msg_class() {} + +#define IPC_EMPTY_MESSAGE_LOG(msg_class) + +#define IPC_ASYNC_MESSAGE_LOG(msg_class) \ + void msg_class::Log(std::string* name, \ + const Message* msg, \ + std::string* l) { \ + if (name) \ + *name = #msg_class; \ + if (!msg || !l) \ + return; \ + Param p; \ + if (Read(msg, &p)) \ + IPC::LogParam(p, l); \ + } + +#define IPC_SYNC_MESSAGE_LOG(msg_class) \ + void msg_class::Log(std::string* name, \ + const Message* msg, \ + std::string* l) { \ + if (name) \ + *name = #msg_class; \ + if (!msg || !l) \ + return; \ + if (msg->is_sync()) { \ + TupleTypes<SendParam>::ValueTuple p; \ + if (ReadSendParam(msg, &p)) \ + IPC::LogParam(p, l); \ + AddOutputParamsToLog(msg, l); \ + } else { \ + TupleTypes<ReplyParam>::ValueTuple p; \ + if (ReadReplyParam(msg, &p)) \ + IPC::LogParam(p, l); \ + } \ + } + +#elif defined(IPC_MESSAGE_MACROS_LOG_ENABLED) + +#ifndef IPC_LOG_TABLE_CREATED +#define IPC_LOG_TABLE_CREATED + +#include "base/hash_tables.h" + +typedef void (*LogFunction)(std::string* name, + const IPC::Message* msg, + std::string* params); + +typedef base::hash_map<uint32, LogFunction > LogFunctionMap; +LogFunctionMap g_log_function_mapping; + +#endif // IPC_LOG_TABLE_CREATED + +// "Log table" inclusion produces extra logging registration code. +#define IPC_MESSAGE_EXTRA(sync, kind, msg_class, \ + in_cnt, out_cnt, in_list, out_list) \ + class LoggerRegisterHelper##msg_class { \ + public: \ + LoggerRegisterHelper##msg_class() { \ + g_log_function_mapping[msg_class::ID] = msg_class::Log; \ + } \ + }; \ + LoggerRegisterHelper##msg_class g_LoggerRegisterHelper##msg_class; +#else + +// Normal inclusion produces nothing extra. +#define IPC_MESSAGE_EXTRA(sync, kind, msg_class, \ + in_cnt, out_cnt, in_list, out_list) + +#endif // defined(IPC_MESSAGE_IMPL) + +// Handle variable sized argument lists. These are usually invoked by token +// pasting against the argument counts. +#define IPC_TYPE_IN_0() +#define IPC_TYPE_IN_1(t1) const t1& arg1 +#define IPC_TYPE_IN_2(t1, t2) const t1& arg1, const t2& arg2 +#define IPC_TYPE_IN_3(t1, t2, t3) const t1& arg1, const t2& arg2, const t3& arg3 +#define IPC_TYPE_IN_4(t1, t2, t3, t4) const t1& arg1, const t2& arg2, const t3& arg3, const t4& arg4 +#define IPC_TYPE_IN_5(t1, t2, t3, t4, t5) const t1& arg1, const t2& arg2, const t3& arg3, const t4& arg4, const t5& arg5 + +#define IPC_TYPE_OUT_0() +#define IPC_TYPE_OUT_1(t1) t1* arg6 +#define IPC_TYPE_OUT_2(t1, t2) t1* arg6, t2* arg7 +#define IPC_TYPE_OUT_3(t1, t2, t3) t1* arg6, t2* arg7, t3* arg8 +#define IPC_TYPE_OUT_4(t1, t2, t3, t4) t1* arg6, t2* arg7, t3* arg8, t4* arg9 + +#define IPC_TUPLE_IN_0() Tuple0 +#define IPC_TUPLE_IN_1(t1) Tuple1<t1> +#define IPC_TUPLE_IN_2(t1, t2) Tuple2<t1, t2> +#define IPC_TUPLE_IN_3(t1, t2, t3) Tuple3<t1, t2, t3> +#define IPC_TUPLE_IN_4(t1, t2, t3, t4) Tuple4<t1, t2, t3, t4> +#define IPC_TUPLE_IN_5(t1, t2, t3, t4, t5) Tuple5<t1, t2, t3, t4, t5> + +#define IPC_TUPLE_OUT_0() Tuple0 +#define IPC_TUPLE_OUT_1(t1) Tuple1<t1&> +#define IPC_TUPLE_OUT_2(t1, t2) Tuple2<t1&, t2&> +#define IPC_TUPLE_OUT_3(t1, t2, t3) Tuple3<t1&, t2&, t3&> +#define IPC_TUPLE_OUT_4(t1, t2, t3, t4) Tuple4<t1&, t2&, t3&, t4&> + +#define IPC_NAME_IN_0() MakeTuple() +#define IPC_NAME_IN_1(t1) MakeRefTuple(arg1) +#define IPC_NAME_IN_2(t1, t2) MakeRefTuple(arg1, arg2) +#define IPC_NAME_IN_3(t1, t2, t3) MakeRefTuple(arg1, arg2, arg3) +#define IPC_NAME_IN_4(t1, t2, t3, t4) MakeRefTuple(arg1, arg2, arg3, arg4) +#define IPC_NAME_IN_5(t1, t2, t3, t4, t5) MakeRefTuple(arg1, arg2, arg3, arg4, arg5) + +#define IPC_NAME_OUT_0() MakeTuple() +#define IPC_NAME_OUT_1(t1) MakeRefTuple(*arg6) +#define IPC_NAME_OUT_2(t1, t2) MakeRefTuple(*arg6, *arg7) +#define IPC_NAME_OUT_3(t1, t2, t3) MakeRefTuple(*arg6, *arg7, *arg8) +#define IPC_NAME_OUT_4(t1, t2, t3, t4) MakeRefTuple(*arg6, *arg7, *arg8, *arg9) + +// There are places where the syntax requires a comma if there are input args, +// if there are input args and output args, or if there are input args or +// output args. These macros allow generation of the comma as needed; invoke +// by token pasting against the argument counts. +#define IPC_COMMA_0 +#define IPC_COMMA_1 , +#define IPC_COMMA_2 , +#define IPC_COMMA_3 , +#define IPC_COMMA_4 , +#define IPC_COMMA_5 , + +#define IPC_COMMA_AND_0(x) +#define IPC_COMMA_AND_1(x) x +#define IPC_COMMA_AND_2(x) x +#define IPC_COMMA_AND_3(x) x +#define IPC_COMMA_AND_4(x) x +#define IPC_COMMA_AND_5(x) x + +#define IPC_COMMA_OR_0(x) x +#define IPC_COMMA_OR_1(x) , +#define IPC_COMMA_OR_2(x) , +#define IPC_COMMA_OR_3(x) , +#define IPC_COMMA_OR_4(x) , +#define IPC_COMMA_OR_5(x) , // Message crackers and handlers. // Prefer to use the IPC_BEGIN_MESSAGE_MAP_EX to the older macros since they |