wibble  0.1.28
mmap.h
Go to the documentation of this file.
00001 #ifndef WIBBLE_SYS_MMAP_H
00002 #define WIBBLE_SYS_MMAP_H
00003 
00008 /*
00009  * Copyright (C) 2006--2008  Enrico Zini <enrico@enricozini.org>
00010  *
00011  * This program is free software; you can redistribute it and/or modify
00012  * it under the terms of the GNU General Public License as published by
00013  * the Free Software Foundation; either version 2 of the License, or
00014  * (at your option) any later version.
00015  *
00016  * This program is distributed in the hope that it will be useful,
00017  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019  * GNU General Public License for more details.
00020  *
00021  * You should have received a copy of the GNU General Public License
00022  * along with this program; if not, write to the Free Software
00023  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00024  */
00025 
00026 #include <wibble/sys/macros.h>
00027 #include <string>
00028 
00029 namespace wibble {
00030 namespace sys {
00031 
00039 struct MMap
00040 {
00041 public:
00042     MMap();
00043     MMap(const MMap& mmap);
00044     MMap(const std::string& filename);
00045     ~MMap();
00046     
00047     MMap& operator=(const MMap& mmap);
00048 
00049     void map(const std::string& filename);
00050     void unmap();
00051     
00052     std::string filename;
00053     size_t size;
00054     int fd;
00055     const char* buf;
00056 
00057 };
00058 
00059 }
00060 }
00061 
00062 // vim:set ts=4 sw=4:
00063 #endif