Package ghidra.trace.database.memory

# Class DBTraceMemoryBufferEntry

java.lang.Object
ghidra.program.database.DatabaseObject
ghidra.util.database.DBAnnotatedObject
ghidra.trace.database.memory.DBTraceMemoryBufferEntry

public class DBTraceMemoryBufferEntry extends DBAnnotatedObject

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected final DBHandle`
  `dbh`

  ### Fields inherited from class ghidra.program.database.DatabaseObject

  `key`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DBTraceMemoryBufferEntry(DBHandle dbh, DBCachedObjectStore<?> store, DBRecord record)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `acquireBlock()`
  `void`
  `acquireBlock(int blockNum)`
  `int`
  `cmpBytes(ByteBuffer buf, int blkOffset, int len, int blockNum)`
  `void`
  `compress()`
  `void`
  `copyFrom(int dstBlockNum, DBTraceMemoryBufferEntry srcBuf, int srcBlockNum)`
  `void`
  `decompress()`
  `protected int`
  `doCmpCompressedBytes(ByteBuffer buf, int blkOffset, int len, int blockNum)`
  `protected void`
  `doGetBlock(int blockNum, byte[] data)`
  `protected void`
  `doGetCompressedBlock(int blockNum, byte[] data)`
  `protected int`
  `doGetCompressedBytes(ByteBuffer buf, int srcOffset, int len, int blockNum)`
  `protected void`
  `fresh(boolean created)`
  Extension point: Called when the object's fields are populated.
  `int`
  `getBytes(ByteBuffer buf, int srcOffset, int len, int blockNum)`
  `protected boolean`
  `isCompressed()`
  `boolean`
  `isEmpty()`
  `boolean`
  `isInUse(int blockNum)`
  `protected boolean`
  `isSane(int offset, int len, int blockNum)`
  `void`
  `releaseBlock(int blockNum)`
  `int`
  `setBytes(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, update`

  ### Methods inherited from class ghidra.program.database.DatabaseObject

  `checkDeleted, checkIsValid, checkIsValid, getKey, isDeleted, isInvalid, keyChanged, setDeleted, setInvalid, validate`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### dbh

    protected final DBHandle dbh

- ## Constructor Details

  - ### DBTraceMemoryBufferEntry

    public DBTraceMemoryBufferEntry(DBHandle dbh, DBCachedObjectStore<?> store, DBRecord record)

- ## Method Details

  - ### isCompressed

    protected boolean isCompressed()

  - ### fresh

    protected void fresh(boolean created) throws IOException
    Description copied from class: `DBAnnotatedObject`
    Extension 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:
      `fresh` in class `DBAnnotatedObject`
    Parameters:
      `created` - `true` when object is being created, or `false` when it is being loaded.
    Throws:
      `IOException` - if further initialization fails.

  - ### compress

    public void compress() throws IOException
    Throws:
      `IOException`

  - ### decompress

    public void decompress() throws IOException
    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:
      `IndexOutOfBoundsException`
      `IOException`

  - ### getBytes

    public int getBytes(ByteBuffer buf, int srcOffset, int len, int blockNum) throws IndexOutOfBoundsException, IOException
    Throws:
      `IndexOutOfBoundsException`
      `IOException`

  - ### doGetCompressedBytes

    protected int doGetCompressedBytes(ByteBuffer buf, int srcOffset, int len, int blockNum) throws IOException
    Throws:
      `IOException`

  - ### doGetBlock

    protected void doGetBlock(int blockNum, byte[] data) throws IndexOutOfBoundsException, IOException
    Throws:
      `IndexOutOfBoundsException`
      `IOException`

  - ### doGetCompressedBlock

    protected void doGetCompressedBlock(int blockNum, byte[] data) throws IOException
    Throws:
      `IOException`

  - ### copyFrom

    public void copyFrom(int dstBlockNum, DBTraceMemoryBufferEntry srcBuf, int srcBlockNum) throws IndexOutOfBoundsException, IOException
    Throws:
      `IndexOutOfBoundsException`
      `IOException`

  - ### cmpBytes

    public int cmpBytes(ByteBuffer buf, int blkOffset, int len, int blockNum) throws IndexOutOfBoundsException, IOException
    Throws:
      `IndexOutOfBoundsException`
      `IOException`

  - ### 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()