wibble  0.1.28
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 
39 struct MMap
40 {
41 public:
42  MMap();
43  MMap(const MMap& mmap);
44  MMap(const std::string& filename);
45  ~MMap();
46 
47  MMap& operator=(const MMap& mmap);
48 
49  void map(const std::string& filename);
50  void unmap();
51 
52  std::string filename;
53  size_t size;
54  int fd;
55  const char* buf;
56 
57 };
58 
59 }
60 }
61 
62 // vim:set ts=4 sw=4:
63 #endif