Mir
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
client_buffer_depository.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2012 Canonical Ltd.
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License version 3 as
6  * 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 Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * Authored by:
17  * Kevin DuBois <kevin.dubois@canonical.com>
18  */
19 
20 #ifndef MIR_CLIENT_PRIVATE_MIR_CLIENT_BUFFER_DEPOSITORY_H_
21 #define MIR_CLIENT_PRIVATE_MIR_CLIENT_BUFFER_DEPOSITORY_H_
22 
23 #include <list>
24 #include <memory>
25 
27 #include "mir/geometry/size.h"
28 
29 namespace mir
30 {
31 
32 namespace client
33 {
34 class ClientBuffer;
35 class ClientBufferFactory;
36 
38 
45 {
46 public:
48 
55  ClientBufferDepository(std::shared_ptr<ClientBufferFactory> const& factory, int max_buffers);
56 
58 
61  void deposit_package(std::shared_ptr<MirBufferPackage> const&, int id,
63  std::shared_ptr<ClientBuffer> current_buffer();
64  uint32_t current_buffer_id() const;
65 
66 private:
67  std::shared_ptr<ClientBufferFactory> const factory;
68  std::list<std::pair<int, std::shared_ptr<ClientBuffer>>> buffers;
69  unsigned int const max_buffers;
70 };
71 }
72 }
73 #endif /* MIR_CLIENT_PRIVATE_MIR_CLIENT_BUFFER_DEPOSITORY_H_ */

Copyright © 2012,2013 Canonical Ltd.
Generated on Tue Oct 15 00:23:28 UTC 2013