[videodb] remove unused seasons table from episode_view
[xbmc.git] / xbmc / platform / posix / utils / Mmap.h
blob2470d60012cfa1077a0c01644ea79ec051941f91
1 /*
2 * Copyright (C) 2017-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
7 */
9 #pragma once
11 #include <cstddef>
13 #include <sys/mman.h>
15 namespace KODI
17 namespace UTILS
19 namespace POSIX
22 /**
23 * Wrapper for mapped memory that automatically calls munmap on destruction
25 class CMmap
27 public:
28 /**
29 * See mmap(3p) for parameter description
31 CMmap(void* addr, std::size_t length, int prot, int flags, int fildes, off_t offset);
32 ~CMmap();
34 void* Data() const
36 return m_memory;
38 std::size_t Size() const
40 return m_size;
43 private:
44 CMmap(CMmap const& other) = delete;
45 CMmap& operator=(CMmap const& other) = delete;
47 std::size_t m_size;
48 void* m_memory;