Class DBTraceMemoryBufferEntry
-
Field Summary
FieldsFields inherited from class ghidra.program.database.DatabaseObject
key -
Constructor Summary
ConstructorsConstructorDescriptionDBTraceMemoryBufferEntry(DBHandle dbh, DBCachedObjectStore<?> store, DBRecord record) -
Method Summary
Modifier and TypeMethodDescriptionintvoidacquireBlock(int blockNum) intcmpBytes(ByteBuffer buf, int blkOffset, int len, int blockNum) voidcompress()voidcopyFrom(int dstBlockNum, DBTraceMemoryBufferEntry srcBuf, int srcBlockNum) voidprotected intdoCmpCompressedBytes(ByteBuffer buf, int blkOffset, int len, int blockNum) protected voiddoGetBlock(int blockNum, byte[] data) protected voiddoGetCompressedBlock(int blockNum, byte[] data) protected intdoGetCompressedBytes(ByteBuffer buf, int srcOffset, int len, int blockNum) protected voidfresh(boolean created) Extension point: Called when the object's fields are populated.intgetBytes(ByteBuffer buf, int srcOffset, int len, int blockNum) protected booleanbooleanisEmpty()booleanisInUse(int blockNum) protected booleanisSane(int offset, int len, int blockNum) voidreleaseBlock(int blockNum) intsetBytes(ByteBuffer buf, int dstOffset, int len, int blockNum) Methods inherited from class ghidra.util.database.DBAnnotatedObject
doRefresh, doUpdateAll, doUpdated, doWrite, getObjectKey, getTableName, isDeleted, refresh, refresh, update, update, update, updateMethods inherited from class ghidra.program.database.DatabaseObject
checkDeleted, checkIsValid, checkIsValid, getKey, isDeleted, isInvalid, keyChanged, setDeleted, setInvalid, validate
-
Field Details
-
dbh
-
-
Constructor Details
-
DBTraceMemoryBufferEntry
-
-
Method Details
-
isCompressed
protected boolean isCompressed() -
fresh
Description copied from class:DBAnnotatedObjectExtension point: Called when the object's fields are populated.This provides an opportunity for the object to initialize any non-database-backed fields that depend on the database-backed fields. Note that its use may indicate a situation better solved by a custom
DBCachedObjectStoreFactory.DBFieldCodec. If both the database-backed and non-database-backed fields are used frequently, then a codec may not be indicated. If the database-backed fields are only used in this method or to encode another frequently-used field, then a codec is likely better.For a new object, the database-backed fields remain at their initial values. They will be saved after this method returns, so they may be further initialized with custom logic.
For an object loaded from the database, the database-backed fields are already populated from the record when this method is called. They are not automatically saved after this method returns. This method should not further initialize database-backed fields in this case.
- Overrides:
freshin classDBAnnotatedObject- Parameters:
created-truewhen object is being created, orfalsewhen it is being loaded.- Throws:
IOException- if further initialization fails.
-
compress
- Throws:
IOException
-
decompress
- Throws:
IOException
-
isSane
protected boolean isSane(int offset, int len, int blockNum) -
setBytes
public int setBytes(ByteBuffer buf, int dstOffset, int len, int blockNum) throws IndexOutOfBoundsException, IOException - Throws:
IndexOutOfBoundsExceptionIOException
-
getBytes
public int getBytes(ByteBuffer buf, int srcOffset, int len, int blockNum) throws IndexOutOfBoundsException, IOException - Throws:
IndexOutOfBoundsExceptionIOException
-
doGetCompressedBytes
protected int doGetCompressedBytes(ByteBuffer buf, int srcOffset, int len, int blockNum) throws IOException - Throws:
IOException
-
doGetBlock
- Throws:
IndexOutOfBoundsExceptionIOException
-
doGetCompressedBlock
- Throws:
IOException
-
copyFrom
public void copyFrom(int dstBlockNum, DBTraceMemoryBufferEntry srcBuf, int srcBlockNum) throws IndexOutOfBoundsException, IOException - Throws:
IndexOutOfBoundsExceptionIOException
-
cmpBytes
public int cmpBytes(ByteBuffer buf, int blkOffset, int len, int blockNum) throws IndexOutOfBoundsException, IOException - Throws:
IndexOutOfBoundsExceptionIOException
-
doCmpCompressedBytes
protected int doCmpCompressedBytes(ByteBuffer buf, int blkOffset, int len, int blockNum) throws IOException - Throws:
IOException
-
isInUse
public boolean isInUse(int blockNum) -
acquireBlock
public int acquireBlock() -
acquireBlock
public void acquireBlock(int blockNum) -
releaseBlock
public void releaseBlock(int blockNum) -
isEmpty
public boolean isEmpty()
-