wibble  1.1
mmap.h
Go to the documentation of this file.
1 #ifndef WIBBLE_SYS_MMAP_H
2 #define WIBBLE_SYS_MMAP_H
3 
8 /*
9  * Copyright (C) 2006--2008 Enrico Zini <enrico@enricozini.org>
10  *
11  * This program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; either version 2 of the License, or
14  * (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software
23  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24  */
25 
26 #include <wibble/sys/macros.h>
27 #include <string>
28 
29 namespace wibble {
30 namespace sys {
31 #if __cplusplus >= 201103L
32 inline namespace v1 {
33 #endif
34 
44 struct MMap
45 {
46 public:
47  MMap();
48  MMap(const MMap& mmap);
49  MMap(const std::string& filename);
50  ~MMap();
51 
52  MMap& operator=(const MMap& mmap);
53 
54  void map(const std::string& filename);
55  void unmap();
56 
57  std::string filename;
58  size_t size;
59  int fd;
60  const char* buf;
61 
62 };
63 
64 #if __cplusplus >= 201103L
65 }
66 #endif
67 }
68 }
69 
70 // vim:set ts=4 sw=4:
71 #endif