Package ghidra.app.util.bin.format.dwarf4.next

# Class DataTypeGraphComparator

java.lang.Object
ghidra.app.util.bin.format.dwarf4.next.DataTypeGraphComparator

public class DataTypeGraphComparator extends Object
Compares two `DataType` directed graphs, calling a `method` that can observe each DataType pair that occupy equivalent positions in each graph.

The first/left DataType graph is assumed to be composed of `DataTypeImpl` instances, and the second/right DataType graph is assumed to be composed of DataType DB instances.

Only DataTypes in the left graph are followed and may lead to a possible match with the right graph.

This class is used to help transfer mappings that point to impl DataTypes to also point them at the resultant 'db' DataTypes that are created by the DataTypeManager.

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static interface`
  `DataTypeGraphComparator.DataTypePairObserver`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static void`
  `compare(DataType preDT, DataType postDT, DataTypeGraphComparator.DataTypePairObserver observer)`
  Compares two `datatypes` graphs, calling the observer callback for each paired DataType that occupy equivalent positions in each graph.

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

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

- ## Method Details

  - ### compare

    public static void compare(DataType preDT, DataType postDT, DataTypeGraphComparator.DataTypePairObserver observer)
    Compares two `datatypes` graphs, calling the observer callback for each paired DataType that occupy equivalent positions in each graph.

    Parameters:
      `preDT` - - Original (impl) DataType from before submitting to DataTypeManager.
      `postDT` - - Result DataType from the DataTypeManager
      `observer` - - Callback called for each position in the preDT graph that has a matching position in the postDT graph.