• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_LIB_MESSAGE_BUILDER_H_
6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_MESSAGE_BUILDER_H_
7 
8 #include <stddef.h>
9 #include <stdint.h>
10 
11 #include "base/macros.h"
12 #include "mojo/public/cpp/bindings/bindings_export.h"
13 #include "mojo/public/cpp/bindings/message.h"
14 
15 namespace mojo {
16 
17 class Message;
18 
19 namespace internal {
20 
21 class Buffer;
22 
23 class MOJO_CPP_BINDINGS_EXPORT MessageBuilder {
24  public:
25   MessageBuilder(uint32_t name,
26                  uint32_t flags,
27                  size_t payload_size,
28                  size_t payload_interface_id_count);
29   ~MessageBuilder();
30 
buffer()31   Buffer* buffer() { return message_.buffer(); }
message()32   Message* message() { return &message_; }
33 
34  private:
35   void InitializeMessage(size_t size);
36 
37   Message message_;
38 
39   DISALLOW_COPY_AND_ASSIGN(MessageBuilder);
40 };
41 
42 }  // namespace internal
43 }  // namespace mojo
44 
45 #endif  // MOJO_PUBLIC_CPP_BINDINGS_LIB_MESSAGE_BUILDER_H_
46