public final class MemoryDeviceWrapper extends java.lang.Object implements MemoryDevice
MemoryDeviceWrapper class adapts a Memory object to
the MemoryDevice interface. This might be required to map an
external (created by a plugin) object modeling a memory storage to
a Memory object.| Constructor and Description |
|---|
MemoryDeviceWrapper(Memory memory) |
| Modifier and Type | Method and Description |
|---|---|
int |
getAddressBitSize()
Returns the size of address used to perform an access to the memory device.
|
int |
getDataBitSize()
Returns the size of data unit that can be read or written from
the memory device at once.
|
boolean |
isInitialized(ru.ispras.fortress.data.types.bitvector.BitVector address)
Checks whether the specified address location has been initialized.
|
ru.ispras.fortress.data.types.bitvector.BitVector |
load(ru.ispras.fortress.data.types.bitvector.BitVector address)
Loads data from the given address.
|
void |
store(ru.ispras.fortress.data.types.bitvector.BitVector address,
ru.ispras.fortress.data.types.bitvector.BitVector data)
Stores the specified data at the given address.
|
void |
useTemporaryContext(boolean value)
Switches the device from main context to temporary context or vice versa.
|
public MemoryDeviceWrapper(Memory memory)
public int getAddressBitSize()
MemoryDevicegetAddressBitSize in interface MemoryDevicepublic int getDataBitSize()
MemoryDevicegetDataBitSize in interface MemoryDevicepublic ru.ispras.fortress.data.types.bitvector.BitVector load(ru.ispras.fortress.data.types.bitvector.BitVector address)
MemoryDeviceload in interface MemoryDeviceaddress - Load address.MemoryDevice.getDataBitSize().public void store(ru.ispras.fortress.data.types.bitvector.BitVector address,
ru.ispras.fortress.data.types.bitvector.BitVector data)
MemoryDevicestore in interface MemoryDeviceaddress - Store address.data - Data of size equal to returned by MemoryDevice.getDataBitSize().public boolean isInitialized(ru.ispras.fortress.data.types.bitvector.BitVector address)
MemoryDeviceisInitialized in interface MemoryDeviceaddress - Address to be checked.true is the address location is initialized or false otherwise.public void useTemporaryContext(boolean value)
MemoryDeviceuseTemporaryContext in interface MemoryDevicevalue - true to switch from main context to temporary context
or false to switch from temporary context to main context.