YSTest  PreAlpha_b400_20130424
The YSLib Test Project
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义  
MemoryMapping.h
浏览该文件的文档.
1 /*
2  Copyright (C) by Franksoft 2012.
3 
4  This file is part of the YSLib project, and may only be used,
5  modified, and distributed under the terms of the YSLib project
6  license, LICENSE.TXT. By continuing to use, modify, or distribute
7  this file you indicate that you have read the license and
8  understand and accept it fully.
9 */
10 
28 #ifndef YCL_INC_MEMORYMAPPING_H_
29 #define YCL_INC_MEMORYMAPPING_H_ 1
30 
31 #include "ycommon.h"
32 #include "FileSystem.h" // for const_path_t;
33 
34 namespace platform
35 {
36 
42 {
43 private:
44  int fd;
45  struct ::stat st;
47 
48 public:
50 
51  explicit
54  template<class _tString>
55  explicit
56  MappedFile(const _tString& filename)
57  : MappedFile(filename.c_str())
58  {}
60  ~MappedFile();
61 
63  GetPtr() const
64  {
65  return addr;
66  }
67  size_t
68  GetSize() const;
69 };
70 
71 } // namespace platform;
72 
73 #endif
74