YSTest: MemoryMapping.h 源文件

YSTest PreAlpha_b500_20140530 The YSLib Test Project

- 首页
- 相关页面
- 模块
- 命名空间
- 类
- 文件

- 文件列表
- 文件成员

全部 类 命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义 组 页
MemoryMapping.h
浏览该文件的文档.
1 /*
2 © 2012-2014 FrankHB.
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 "YModules.h"
32 #include YFM_YCLib_YCommon
33
34 namespace platform
35 {
36
42 class YF_API MappedFile
43 {
44 private:
45 int fd;
46 std::uint64_t size;
47 ystdex::byte* addr;
48
49 public:
51
52 explicit
54 MappedFile(const char*);
56 template<class _tString>
57 explicit
58 MappedFile(const _tString& filename)
59 : MappedFile(filename.c_str())
60 {}
62 ~MappedFile();
63
65 DefGetter(const ynothrow, ystdex::byte*, Ptr, addr)
67 DefGetter(const ynothrow, std::uint64_t, Size, size)
68 };
69
70 } // namespace platform;
71
72 #endif
73
YModules.h
YF_API
#define YF_API
Definition: Platform.h:64
ystdex::byte
unsigned char byte
字节类型。
Definition: ydef.h:555
platform::addr
if(p==MAP_FAILED) throw std addr
Definition: MemoryMapping.cpp:97
platform::MappedFile
只读内存映射文件。
Definition: MemoryMapping.h:42
platform::DefGetter
yconstfn Integer &Trait::AMask Trait::XYZBitsN yconstfn DefGetter(const ynothrow, typename Trait::BType, B, Integer &Trait::XMask) yconstfn DefGetter(const ynothrow
platform::ynothrow
std::size_t size ynothrow
Definition: YCLib/FileSystem.h:256
platform::MappedFile::size
std::uint64_t size
Definition: MemoryMapping.h:46
platform::MappedFile::fd
int fd
Definition: MemoryMapping.h:45
platform::MappedFile::addr
ystdex::byte * addr
Definition: MemoryMapping.h:47
platform::MappedFile::MappedFile
MappedFile(const _tString &filename)
Definition: MemoryMapping.h:58