Mir
protobuf_buffer_packer.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2013 Canonical Ltd.
3  *
4  * This program is free software: you can redistribute it and/or modify it
5  * under the terms of the GNU General Public License version 3,
6  * as published by the Free Software Foundation.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * Authored by: Kevin DuBois <kevin.dubois@canonical.com>
17  */
18 
19 #ifndef MIR_FRONTEND_PROTOBUF_BUFFER_PACKER_H_
20 #define MIR_FRONTEND_PROTOBUF_BUFFER_PACKER_H_
21 
23 #include <memory>
24 
25 namespace mir
26 {
27 namespace protobuf
28 {
29 class Buffer;
30 class DisplayConfiguration;
31 }
32 
33 namespace graphics
34 {
35 class DisplayConfiguration;
36 }
37 
38 namespace frontend
39 {
40 namespace detail
41 {
42 
43 void pack_protobuf_display_configuration(protobuf::DisplayConfiguration& protobuf_config,
44  graphics::DisplayConfiguration const& display_config);
45 
47 {
48 public:
49  ProtobufBufferPacker(protobuf::Buffer*);
50  void pack_fd(Fd const&);
51  void pack_data(int);
53  void pack_flags(unsigned int);
54  void pack_size(geometry::Size const& size);
55 
56  std::vector<Fd> fds();
57  std::vector<int> data();
58 private:
59  std::vector<mir::Fd> fds_;
60  protobuf::Buffer* buffer_response;
61 };
62 
63 }
64 }
65 }
66 
67 #endif /* MIR_FRONTEND_PROTOBUF_BUFFER_PACKER_H_ */
Definition: size.h:30
All things Mir.
Definition: atomic_callback.h:25
Definition: buffer_ipc_message.h:32
Definition: fd.h:33
void pack_size(geometry::Size const &size)
void pack_protobuf_display_configuration(protobuf::DisplayConfiguration &protobuf_config, graphics::DisplayConfiguration const &display_config)
Definition: protobuf_buffer_packer.h:46
Definition: dimensions.h:36
int const size
Definition: make_socket_rpc_channel.cpp:51

Copyright © 2012-2015 Canonical Ltd.
Generated on Thu Oct 8 16:20:16 UTC 2015