oaMapFileWindow
模块: oapy._oa._base
导入: from oapy._oa import _base
概览
oaMapFileWindow 在 oapy 中可用,可通过 _base 模块访问。
本页汇总 oaMapFileWindow 当前在 oapy 中可用的 Python 接口。
详细说明
The oaMapFileWindow utility class reads data from and writes data to a memory-mapped disk file。 The oaMapFileWindow class derives from oaMapWindow , associating the window with an oaMapFile as the backing storage。 This class includes byte-swapping support for files moved between big-endian and little-endian computers。 This class supports files with sizes larger than 32 bits。 As part of this support, the API allows any 32-bit window of the file to map at a time。 The usage of oaMapFileWindow is primarily internal to OpenAccess。 It is public because pcell evaluators may use it to store private data in a pcell supermaster。 See oaPackedData for a discussion。 Such callers will get an oaMapFileWindow from oaPcellDataCallback::onPcellRead or oaPcellDataCallback::onPcellWrite。 They do not need to call any functions on oaMapFileWindow except the inherited call oaMapWindow::data() 。
构造函数
_base.oaMapFileWindow(dataIn, sizeIn, offsetIn, mapFileIn)
obj = _base.oaMapFileWindow(dataIn, sizeIn, offsetIn, mapFileIn)
方法总览
| 状态 | Python 调用 |
|---|---|
| ✅ | obj.map(sizeIn=0, offsetIn=0, mapLoc=NULL) |
| ✅ | obj.unmap() |
| ✅ | obj.move(sizeIn, offsetIn, resize=false) |
| ✅ | obj.extend(sizeIn) |
| ✅ | obj.getMapFile() |
| ✅ | obj.getMapFile() |
| ✅ | obj.getNext() |
| ✅ | obj.setMapFile(mapFileIn) |
| ✅ | obj.reset() |
| ✅ | obj.writeSwapCheck(loc) |
| ✅ | obj.readSwapCheck(loc) |
| ✅ | obj.getSwap() |
方法说明
obj.map(sizeIn=0, offsetIn=0, mapLoc=NULL)
绑定状态: 已绑定
Python 调用: obj.map(sizeIn=0, offsetIn=0, mapLoc=NULL)
This function creates a memory-mapped window of sizeIn bytes, starting at offsetIn in this file。 If mapLoc is not NULL, it is used as a suggested address for the start of the mapping in memory。
参数
sizeIn: The size of the memory-mapped window to create。offsetIn: The starting location in the file for this memory-mapped window。mapLoc: The suggested starting address for the memory mapping; no starting location is provided by default。
Python 示例
from oapy._oa import _base
# assume obj is a oaMapFileWindow
obj.map(sizeIn=0, offsetIn=0, mapLoc=NULL)
obj.unmap()
绑定状态: 已绑定
Python 调用: obj.unmap()
This function removes the current memory-mapped window if one exists。
Python 示例
from oapy._oa import _base
# assume obj is a oaMapFileWindow
obj.unmap()
obj.move(sizeIn, offsetIn, resize=false)
绑定状态: 已绑定
Python 调用: obj.move(sizeIn, offsetIn, resize=false)
This function moves the memory-mapped window from the current offset in the file to offsetIn, changing the size of the window to sizeIn。
参数
sizeIn: The new size of the memory-mapped window。offsetIn: The new starting location in the file for this memory-mapped window。resize:
Python 示例
from oapy._oa import _base
# assume obj is a oaMapFileWindow
obj.move(sizeIn, offsetIn, resize=false)
obj.extend(sizeIn)
绑定状态: 已绑定
Python 调用: obj.extend(sizeIn)
This function ensures that the size of the memory-mapped window is at least sizeIn, extending the memory-mapped window if necessary without changing the window offset。 The new window size that is returned may be somewhat larger than sizeIn due to memory-mapping granularity。 In write mode, the file is also extended, if necessary。
参数
sizeIn: The minimum size of the memory-mapped window。
Python 示例
from oapy._oa import _base
# assume obj is a oaMapFileWindow
obj.extend(sizeIn)
obj.getMapFile()
绑定状态: 已绑定
Python 调用: obj.getMapFile()
This function returns the mapFile associated with this mapFileWindow。
Python 示例
from oapy._oa import _base
# assume obj is a oaMapFileWindow
obj.getMapFile()
obj.getMapFile()
绑定状态: 已绑定
Python 调用: obj.getMapFile()
This function returns the mapFile associated with this mapFileWindow。
Python 示例
from oapy._oa import _base
# assume obj is a oaMapFileWindow
obj.getMapFile()
obj.getNext()
绑定状态: 已绑定
Python 调用: obj.getNext()
This function returns the next mapFileWindow associated with the same mapFile as this mapFileWindow。
Python 示例
from oapy._oa import _base
# assume obj is a oaMapFileWindow
obj.getNext()
obj.setMapFile(mapFileIn)
绑定状态: 已绑定
Python 调用: obj.setMapFile(mapFileIn)
This function changes the underlying file to use for subsequent mapping。
参数
mapFileIn: The map file to use。
异常
oacInvalidSetMapWindowFile。
Python 示例
from oapy._oa import _base
# assume obj is a oaMapFileWindow
obj.setMapFile(mapFileIn)
obj.reset()
绑定状态: 已绑定
Python 调用: obj.reset()
Python 示例
from oapy._oa import _base
# assume obj is a oaMapFileWindow
obj.reset()
obj.writeSwapCheck(loc)
绑定状态: 已绑定
Python 调用: obj.writeSwapCheck(loc)
This function writes an integer to this file。 This test integer determines if subsequent reads from this file must be done using byte-swapping。
参数
loc: The location in the file where to write the integer。
Python 示例
from oapy._oa import _base
# assume obj is a oaMapFileWindow
obj.writeSwapCheck(loc)
obj.readSwapCheck(loc)
绑定状态: 已绑定
Python 调用: obj.readSwapCheck(loc)
This function reads an integer from this file。 This test integer determines if subsequent reads from this file must be done using byte-swapping。
参数
loc: The location in the file from which to read the integer。
Python 示例
from oapy._oa import _base
# assume obj is a oaMapFileWindow
obj.readSwapCheck(loc)
obj.getSwap()
绑定状态: 已绑定
Python 调用: obj.getSwap()
This function returns a boolean indicating if this file requires byte-swapping。
返回
- true or false。
Python 示例
from oapy._oa import _base
# assume obj is a oaMapFileWindow
obj.getSwap()