Mir
anonymous_shm_file.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 Lesser General Public License version 2 or 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 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 
17 #ifndef MIR_CORE_ANONYMOUS_SHM_FILE_H_
18 #define MIR_CORE_ANONYMOUS_SHM_FILE_H_
19 
20 #include "shm_file.h"
21 #include "mir/fd.h"
22 
23 namespace mir
24 {
25 
26 namespace detail
27 {
28 }
29 
30 class AnonymousShmFile : public ShmFile
31 {
32 public:
33  AnonymousShmFile(size_t size);
34  ~AnonymousShmFile() noexcept;
35 
36  void* base_ptr() const override;
37  int fd() const override;
38 
39 private:
40  Fd const fd_;
41  class MapHandle;
42  std::unique_ptr<MapHandle> const mapping;
43 };
44 
45 }
46 
47 #endif /* MIR_CORE_ANONYMOUS_SHM_FILE_H_ */

Copyright © 2012-2022 Canonical Ltd.
Generated on Tue Sep 13 03:20:30 UTC 2022
This documentation is licensed under the GPL version 2 or 3.