Interface DBTraceDefinedDataAdapter

All Superinterfaces:
CodeUnit, Data, DataAdapterFromDataType, DataAdapterFromSettings, DataAdapterMinimal, DBTraceCodeUnitAdapter, DBTraceDataAdapter, MemBuffer, MemBufferMixin, PropertySet, Settings, TraceCodeUnit, TraceData
All Known Implementing Classes:
AbstractDBTraceDataComponent, DBTraceData, DBTraceDataArrayElementComponent, DBTraceDataCompositeFieldComponent

public interface DBTraceDefinedDataAdapter extends DBTraceDataAdapter
A base interface for implementations of TraceData

This behaves somewhat like a mixin, allowing it to be used on defined data units as well as data components, e.g., fields of a struct data unit.

  • Method Details

    • isDefined

      default boolean isDefined()
      Description copied from interface: Data
      Returns true if the data type is defined. Any address that has not been defined to be code or data is treated as undefined data.
      Specified by:
      isDefined in interface Data
      Returns:
      true if is defined
    • doGetComponentCache

      AbstractDBTraceDataComponent[] doGetComponentCache()
      TODO: Document me Note this will always be called with the write lock
      Returns:
      the new or existing component cache
    • getNumComponents

      default int getNumComponents()
      Description copied from interface: Data
      Return the number of components that make up this data item. if this is an Array, return the number of elements in the array.
      Specified by:
      getNumComponents in interface Data
      Returns:
      the number of components
    • getRoot

      DBTraceData getRoot()
      Description copied from interface: Data
      Get the highest level Data item in a hierarchy of structures containing this component.
      Specified by:
      getRoot in interface Data
      Specified by:
      getRoot in interface DBTraceDataAdapter
      Returns:
      the data
    • getParent

      Description copied from interface: Data
      Get the immediate parent data item of this data item or null if this data item is not contained in another data item.
      Specified by:
      getParent in interface Data
      Returns:
      the data
    • getPathName

      StringBuilder getPathName(StringBuilder builder, boolean includeRootSymbol)
    • getComponent

      default DBTraceDefinedDataAdapter getComponent(int index)
      Description copied from interface: Data
      Returns the immediate n'th component or null if none exists.
      Specified by:
      getComponent in interface Data
      Specified by:
      getComponent in interface TraceData
      Parameters:
      index - the index of the component to get.
      Returns:
      the component
    • getComponentAt

      @Deprecated default DBTraceDefinedDataAdapter getComponentAt(int offset)
      Deprecated.
      Description copied from interface: Data
      Return the first immediate child component that contains the byte at the given offset. It is important to note that with certain datatypes there may be more than one component containing the specified offset (see Data.getComponentsContaining(int)).
      Specified by:
      getComponentAt in interface Data
      Specified by:
      getComponentAt in interface TraceData
      Parameters:
      offset - the amount to add to this data items address to get the address of the requested data item.
      Returns:
      first data component containing offset or null
    • getComponentContaining

      default DBTraceDefinedDataAdapter getComponentContaining(int offset)
      Description copied from interface: Data
      Return the first immediate child component that contains the byte at the given offset. It is important to note that with certain datatypes there may be more than one component containing the specified offset (see Data.getComponentsContaining(int)).
      Specified by:
      getComponentContaining in interface Data
      Specified by:
      getComponentContaining in interface TraceData
      Parameters:
      offset - the amount to add to this data items address to get the
      Returns:
      first data component containing offset or null address of the requested data item.
    • getComponentsContaining

      default List<Data> getComponentsContaining(int offset)
      Description copied from interface: Data
      Returns a list of all the immediate child components that contain the byte at the given offset.

      For a union, this will return all the components (if the offset is 0). The presence of bit-fields or zero-length components may cause multiple components to be returned.

      Specified by:
      getComponentsContaining in interface Data
      Parameters:
      offset - the amount to add to this data items address to get the address of the requested data item.
      Returns:
      a list of all the immediate child components that contain the byte at the given offset or null if offset is out of bounds.
    • getPrimitiveAt

      default DBTraceDefinedDataAdapter getPrimitiveAt(int offset)
      Description copied from interface: Data
      Returns the primitive component containing this offset (i.e., one that does not have sub-components). This is useful for data items which are made up of multiple layers of other data items. This method immediately goes to the lowest level data item. If the minimum offset of a component is specified, the only first component containing the offset will be considered (e.g., 0-element array).
      Specified by:
      getPrimitiveAt in interface Data
      Specified by:
      getPrimitiveAt in interface DBTraceDataAdapter
      Specified by:
      getPrimitiveAt in interface TraceData
      Parameters:
      offset - the offset
      Returns:
      primitive component containing this offset
    • doGetComponent

      default DBTraceDefinedDataAdapter doGetComponent(int[] componentPath, int level)
    • getComponent

      default DBTraceDefinedDataAdapter getComponent(int[] componentPath)
      Get a data item given the index path. Each integer in the array represents an index into the data item at that level. This implementation differs in that the path is relative to this unit, even if it is not the root. In DataDB, it appears the behavior is undefined if you call this on a non-root component.
      Specified by:
      getComponent in interface Data
      Specified by:
      getComponent in interface TraceData
      Parameters:
      componentPath - the array of indexes to use to find the requested data item.
      Returns:
      the component