Class VFakeMappedMemory
java.lang.Object
com.io7m.jcoronado.fake.VFakeMappedMemory
- All Implemented Interfaces:
VulkanMappedMemoryType, com.io7m.jmulticlose.core.CloseableType, AutoCloseable
A fake mapped memory object. Provides a real
ByteBuffer backing store
so that tests can write to and read from the memory.-
Constructor Summary
ConstructorsConstructorDescriptionVFakeMappedMemory(long inSize) A fake mapped memory object.VFakeMappedMemory(long inOffset, long inSize) A fake mapped memory object. -
Method Summary
-
Constructor Details
-
VFakeMappedMemory
public VFakeMappedMemory(long inSize) A fake mapped memory object.- Parameters:
inSize- The size of the mapped region, in bytes
-
VFakeMappedMemory
public VFakeMappedMemory(long inOffset, long inSize) A fake mapped memory object.- Parameters:
inOffset- The offset of the mapped regioninSize- The size of the mapped region, in bytes
-
-
Method Details
-
offset
public long offset()- Returns:
- The offset of the mapped region
-
size
public long size()- Returns:
- The size of the mapped region
-
isMapped
public boolean isMapped()- Specified by:
isMappedin interfaceVulkanMappedMemoryType- Returns:
trueiffVulkanMappedMemoryType.close()has not been called
-
flushRange
public void flushRange(long inOffset, long inSize) Description copied from interface:VulkanMappedMemoryTypeFlush the given memory range.- Specified by:
flushRangein interfaceVulkanMappedMemoryType- Parameters:
inOffset- The offsetinSize- The size- See Also:
-
flush
public void flush()Description copied from interface:VulkanMappedMemoryTypeFlush this mapped memory.- Specified by:
flushin interfaceVulkanMappedMemoryType- See Also:
-
close
public void close()Description copied from interface:VulkanMappedMemoryTypeUnmap the memory.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceVulkanMappedMemoryType
-
isClosed
public boolean isClosed()- Specified by:
isClosedin interfacecom.io7m.jmulticlose.core.CloseableType
-
asByteBuffer
- Specified by:
asByteBufferin interfaceVulkanMappedMemoryType- Returns:
- The mapped memory as a byte buffer
-