| Index: ipc/ipc_message_generated.cc
|
| ===================================================================
|
| --- ipc/ipc_message_generated.cc (revision 0)
|
| +++ ipc/ipc_message_generated.cc (revision 0)
|
| @@ -0,0 +1,86 @@
|
| +// Copyright (c) 2010 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "chrome/common/common_param_traits.h"
|
| +
|
| +#define IPC_MESSAGE_IMPL
|
| +#include "ipc/ipc_message_tree.h"
|
| +
|
| +// Null out all the macros that need nulling.
|
| +#include "ipc/ipc_message_null_macros.h"
|
| +
|
| +// Generate constructors.
|
| +#undef IPC_STRUCT_FIRST
|
| +#undef IPC_STRUCT_NEXT
|
| +#undef IPC_STRUCT_LAST
|
| +#define IPC_STRUCT_FIRST(type, name, init) IPC_STRUCT_FIRST_##init(type,name)
|
| +#define IPC_STRUCT_NEXT(type, name, init) IPC_STRUCT_NEXT_##init(type, name)
|
| +#define IPC_STRUCT_LAST(type, name, init) IPC_STRUCT_LAST_##init(type, name)
|
| +#define IPC_STRUCT_FIRST_INIT(type, name) \
|
| + IPC_STRUCT_NAME::IPC_STRUCT_NAME () : name(0)
|
| +#define IPC_STRUCT_NEXT_INIT(type, name) , name(0)
|
| +#define IPC_STRUCT_LAST_INIT(type, name) , name(0) {}
|
| +#define IPC_STRUCT_FIRST_NOINIT(type, name) \
|
| + error "first member must be initialized"
|
| +#define IPC_STRUCT_NEXT_NOINIT(type, name)
|
| +#define IPC_STRUCT_LAST_NOINIT(type, name) {}
|
| +#include "ipc/ipc_message_tree.h"
|
| +
|
| +// Generate destructors.
|
| +#undef IPC_STRUCT_FIRST
|
| +#undef IPC_STRUCT_NEXT
|
| +#undef IPC_STRUCT_LAST
|
| +#define IPC_STRUCT_FIRST(type, name, init) \
|
| + IPC_STRUCT_NAME::~IPC_STRUCT_NAME () {}
|
| +#define IPC_STRUCT_NEXT(type, name, init)
|
| +#define IPC_STRUCT_LAST(type, name, init)
|
| +#include "ipc/ipc_message_tree.h"
|
| +
|
| +namespace IPC {
|
| +
|
| +// Generate param traits write methods.
|
| +#undef IPC_STRUCT_FIRST
|
| +#undef IPC_STRUCT_NEXT
|
| +#undef IPC_STRUCT_LAST
|
| +#undef IPC_STRUCT_MEMBER
|
| +#define IPC_STRUCT_FIRST(type, name, init) \
|
| + void ParamTraits<IPC_STRUCT_NAME>:: \
|
| + Write(Message* m, const param_type& p) { \
|
| + IPC_STRUCT_MEMBER(type, name)
|
| +#define IPC_STRUCT_NEXT(type, name, init) IPC_STRUCT_MEMBER(type, name)
|
| +#define IPC_STRUCT_LAST(type, name, init) IPC_STRUCT_MEMBER(type, name) }
|
| +#define IPC_STRUCT_MEMBER(type, name) WriteParam(m, p.name);
|
| +#include "ipc/ipc_message_tree.h"
|
| +
|
| +// Generate param traits read methods.
|
| +#undef IPC_STRUCT_FIRST
|
| +#undef IPC_STRUCT_NEXT
|
| +#undef IPC_STRUCT_LAST
|
| +#undef IPC_STRUCT_MEMBER
|
| +#define IPC_STRUCT_FIRST(type, name, init) \
|
| + bool ParamTraits<IPC_STRUCT_NAME>:: \
|
| + Read(const Message* m, void** iter, param_type* p) { \
|
| + return IPC_STRUCT_MEMBER(type, name)
|
| +#define IPC_STRUCT_NEXT(type, name, init) && IPC_STRUCT_MEMBER(type, name)
|
| +#define IPC_STRUCT_LAST(type, name, init) && IPC_STRUCT_MEMBER(type, name); }
|
| +#define IPC_STRUCT_MEMBER(type, name) ReadParam(m, iter, &p->name)
|
| +#include "ipc/ipc_message_tree.h"
|
| +
|
| +// Generate param traits log methods.
|
| +#undef IPC_STRUCT_FIRST
|
| +#undef IPC_STRUCT_NEXT
|
| +#undef IPC_STRUCT_LAST
|
| +#undef IPC_STRUCT_MEMBER
|
| +#define IPC_STRUCT_FIRST(type, name, init) \
|
| + void ParamTraits<IPC_STRUCT_NAME>:: \
|
| + Log(const param_type& p, std::string* l) { \
|
| + l->append("("); IPC_STRUCT_MEMBER(type, name)
|
| +#define IPC_STRUCT_NEXT(type, name, init) \
|
| + l->append(", "); IPC_STRUCT_MEMBER(type, name)
|
| +#define IPC_STRUCT_LAST(type, name, init) \
|
| + IPC_STRUCT_NEXT(type, name, init) l->append(")"); }
|
| +#define IPC_STRUCT_MEMBER(type, name) LogParam(p.name, l);
|
| +#include "ipc/ipc_message_tree.h"
|
| +
|
| +} // namespace IPC
|
|
|