Package ghidra.program.model.data

# Class BuiltInDataTypeManager

java.lang.Object
ghidra.program.database.data.DataTypeManagerDB
ghidra.program.model.data.StandAloneDataTypeManager
ghidra.program.model.data.BuiltInDataTypeManager

All Implemented Interfaces:
  `DataTypeManager`, `Closeable`, `AutoCloseable`

public final class BuiltInDataTypeManager extends StandAloneDataTypeManager
Data type manager for built in types that do not live anywhere except in memory.

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class ghidra.program.model.data.StandAloneDataTypeManager

  `StandAloneDataTypeManager.ArchiveWarning, StandAloneDataTypeManager.ArchiveWarningLevel, StandAloneDataTypeManager.LanguageUpdateOption`

- ## Field Summary

  ### Fields inherited from class ghidra.program.model.data.StandAloneDataTypeManager

  `name`

  ### Fields inherited from class ghidra.program.database.data.DataTypeManagerDB

  `addrMap, dbHandle, DEFAULT_CALLING_CONVENTION_ID, defaultListener, errHandler, lock, readOnlyMode, sourceArchiveAdapter, tablePrefix, universalID, UNKNOWN_CALLING_CONVENTION_ID`

  ### Fields inherited from interface ghidra.program.model.data.DataTypeManager

  `BAD_DATATYPE_ID, BUILT_IN_ARCHIVE_KEY, BUILT_IN_ARCHIVE_UNIVERSAL_ID, BUILT_IN_DATA_TYPES_NAME, DEFAULT_DATATYPE_ID, LOCAL_ARCHIVE_KEY, LOCAL_ARCHIVE_UNIVERSAL_ID, NULL_DATATYPE_ID`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `DataType`
  `addDataType(DataType originalDataType, DataTypeConflictHandler handler)`
  Returns a data type after adding it to this data manager.
  `void`
  `associateDataTypeWithArchive(DataType datatype, SourceArchive archive)`
  Change the given data type and its dependencies so thier source archive is set to given archive.
  `void`
  `close()`
  Closes this dataType manager
  `Category`
  `createCategory(CategoryPath path)`
  Create a category for the given path; returns the current category if it already exits
  `void`
  `endTransaction(int transactionID, boolean commit)`
  Ends the current transaction
  `static BuiltInDataTypeManager`
  `getDataTypeManager()`
  Returns shared instance of built-in data type manager.
  `ArchiveType`
  `getType()`
  Returns this manager's archive type
  `protected final boolean`
  `isArchitectureChangeAllowed()`
  Determine if a program architecture change is permitted
  `protected void`
  `populateBuiltInTypes()`
  Add the built in data types to the default built in folder if they were not found in any other category.
  `boolean`
  `remove(DataType dataType, TaskMonitor monitor)`
  Remove the given datatype from this manager
  `DataType`
  `replaceDataType(DataType existingDt, DataType replacementDt, boolean updateCategoryPath)`
  Replace an existing dataType with another.
  `DataType`
  `resolve(DataType dataType, DataTypeConflictHandler handler)`
  Returns a dataType that is "in" (ie suitable implementation) this Manager, creating a new one if necessary.
  `protected UniversalID`
  `resolveSourceArchiveID(DataType dataType)`
  `void`
  `setName(String name)`
  Sets this data type manager's name
  `protected final void`
  `setProgramArchitecture(ProgramArchitecture programArchitecture, VariableStorageManager variableStorageMgr, boolean force, TaskMonitor monitor)`
  Set the architecture-specific details associated with a new datatype manager.
  `int`
  `startTransaction(String description)`
  Starts a transaction for making changes in this data type manager.

  ### Methods inherited from class ghidra.program.model.data.StandAloneDataTypeManager

  `clearProgramArchitecture, deleteDataTypeIDs, finalize, flushEvents, getDomainFileID, getName, getPath, getProgramArchitectureSummary, getWarning, getWarningDetail, getWarningMessage, handleDataOrganizationChange, initializeOtherAdapters, isProgramArchitectureMissing, isProgramArchitectureUpgradeRequired, logWarning, openTransaction, replaceDataTypeIDs, setProgramArchitecture`

  ### Methods inherited from class ghidra.program.database.data.DataTypeManagerDB

  `addDataTypeManagerListener, addDataTypes, addDataTypeToDelete, addInvalidatedListener, allowsDefaultBuiltInSettings, allowsDefaultComponentSettings, categoryCreated, categoryMoved, categoryRemoved, categoryRenamed, compilerSpecChanged, contains, containsCategory, dataTypeAdded, dataTypeChanged, dataTypeDeleted, dataTypeMoved, dataTypeNameChanged, dataTypeReplaced, dataTypeSettingsChanged, dbError, disassociate, dispose, doSourceArchiveUpdates, favoritesChanged, findDataType, findDataTypeForID, findDataTypes, findDataTypes, findEnumValueNames, fixupComposites, getAddressMap, getAllComposites, getAllDataTypes, getAllDataTypes, getAllFunctionDefinitions, getAllStructures, getCallingConvention, getCallingConventionID, getCallingConventionName, getCategory, getCategory, getCategoryCount, getDataMap, getDataOrganization, getDataType, getDataType, getDataType, getDataType, getDataType, getDataTypeCount, getDataTypes, getDataTypes, getDataTypesContaining, getDefaultCallingConvention, getDefinedCallingConventionNames, getFavorites, getID, getKnownCallingConventionNames, getLastChangeTimeForMyManager, getLocalSourceArchive, getPointer, getPointer, getProgramArchitecture, getProgramArchitectureSummary, getResolvedID, getRootCategory, getSourceArchive, getSourceArchive, getSourceArchives, getUniqueName, getUniversalID, getUnusedConflictName, getUnusedConflictName, getVariableStorageManager, hasDataOrganizationChange, invalidateCache, isChanged, isCreatingDataType, isFavorite, isTransactionActive, isUpdatable, migrateOldFlexArrayComponentsIfRequired, readDataOrganization, removeDataTypeManagerListener, removeInvalidatedListener, removeSourceArchive, replaceSourceArchive, resolveSourceArchive, saveDataOrganization, setFavorite, sourceArchiveAdded, sourceArchiveChanged, updateID, updateLastChangeTime, updateSourceArchiveName, updateSourceArchiveName`

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

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

- ## Method Details

  - ### getDataTypeManager

    public static BuiltInDataTypeManager getDataTypeManager()
    Returns shared instance of built-in data type manager.
    Returns:
      the manager

  - ### setProgramArchitecture

    protected final void setProgramArchitecture(ProgramArchitecture programArchitecture, VariableStorageManager variableStorageMgr, boolean force, TaskMonitor monitor) throws IOException, CancelledException
    Description copied from class: `StandAloneDataTypeManager`
    Set the architecture-specific details associated with a new datatype manager. This method is intended to be used during instantiation of derived implementations.
    Overrides:
      `setProgramArchitecture` in class `StandAloneDataTypeManager`
    Parameters:
      `programArchitecture` - program architecture details (required)
      `variableStorageMgr` - variable storage manager. Must be null.
      `force` - if true database update will occur and datatypes will be updated if any change to the data organization is detected (a stored copy may be used to detect this condition). This should never be passed as true if opened read-only. If true and no variable storage is specified it will be created.
      `monitor` - task monitor
    Throws:
      `IOException` - if IO error occurs
      `CancelledException` - if task cancelled

  - ### isArchitectureChangeAllowed

    protected final boolean isArchitectureChangeAllowed()
    Description copied from class: `StandAloneDataTypeManager`
    Determine if a program architecture change is permitted
    Overrides:
      `isArchitectureChangeAllowed` in class `StandAloneDataTypeManager`
    Returns:
      true if change allowed else false if disallowed

  - ### startTransaction

    public int startTransaction(String description)
    Description copied from interface: `DataTypeManager`
    Starts a transaction for making changes in this data type manager.
    Specified by:
      `startTransaction` in interface `DataTypeManager`
    Overrides:
      `startTransaction` in class `StandAloneDataTypeManager`
    Parameters:
      `description` - a short description of the changes to be made.
    Returns:
      the transaction ID

  - ### endTransaction

    public void endTransaction(int transactionID, boolean commit)
    Description copied from interface: `DataTypeManager`
    Ends the current transaction
    Specified by:
      `endTransaction` in interface `DataTypeManager`
    Overrides:
      `endTransaction` in class `StandAloneDataTypeManager`
    Parameters:
      `transactionID` - id of the transaction to end
      `commit` - true if changes are committed, false if changes in transaction are revoked

  - ### createCategory

    public Category createCategory(CategoryPath path)
    Description copied from interface: `DataTypeManager`
    Create a category for the given path; returns the current category if it already exits
    Specified by:
      `createCategory` in interface `DataTypeManager`
    Overrides:
      `createCategory` in class `DataTypeManagerDB`
    Parameters:
      `path` - the path
    Returns:
      the category

  - ### populateBuiltInTypes

    protected void populateBuiltInTypes()
    Add the built in data types to the default built in folder if they were not found in any other category.

  - ### resolveSourceArchiveID

    protected UniversalID resolveSourceArchiveID(DataType dataType)

  - ### getType

    public ArchiveType getType()
    Description copied from interface: `DataTypeManager`
    Returns this manager's archive type
    Specified by:
      `getType` in interface `DataTypeManager`
    Overrides:
      `getType` in class `StandAloneDataTypeManager`
    Returns:
      the type

  - ### resolve

    public DataType resolve(DataType dataType, DataTypeConflictHandler handler)
    Description copied from interface: `DataTypeManager`
    Returns a dataType that is "in" (ie suitable implementation) this Manager, creating a new one if necessary. Also the returned dataType will be in a category in this dataTypeManager that is equivalent to the category of the passed in dataType.
    Specified by:
      `resolve` in interface `DataTypeManager`
    Overrides:
      `resolve` in class `DataTypeManagerDB`
    Parameters:
      `dataType` - the dataType to be resolved.
      `handler` - used to resolve conflicts with existing dataTypes.
    Returns:
      an equivalent dataType that "belongs" to this dataTypeManager.

  - ### addDataType

    public DataType addDataType(DataType originalDataType, DataTypeConflictHandler handler)
    Description copied from interface: `DataTypeManager`
    Returns a data type after adding it to this data manager. The returned dataType will be in a category in this dataTypeManager that is equivalent to the category of the passed in dataType.
    Specified by:
      `addDataType` in interface `DataTypeManager`
    Overrides:
      `addDataType` in class `DataTypeManagerDB`
    Parameters:
      `originalDataType` - the dataType to be resolved.
      `handler` - used to resolve conflicts with existing dataTypes.
    Returns:
      an equivalent dataType that "belongs" to this dataTypeManager.

  - ### setName

    public void setName(String name) throws InvalidNameException
    Description copied from interface: `DataTypeManager`
    Sets this data type manager's name
    Specified by:
      `setName` in interface `DataTypeManager`
    Overrides:
      `setName` in class `StandAloneDataTypeManager`
    Parameters:
      `name` - the new name
    Throws:
      `InvalidNameException` - if the given name is invalid (such as when null or empty)

  - ### associateDataTypeWithArchive

    public void associateDataTypeWithArchive(DataType datatype, SourceArchive archive)
    Description copied from interface: `DataTypeManager`
    Change the given data type and its dependencies so thier source archive is set to given archive. Only those data types not already associated with a source archive will be changed.
    Specified by:
      `associateDataTypeWithArchive` in interface `DataTypeManager`
    Overrides:
      `associateDataTypeWithArchive` in class `DataTypeManagerDB`
    Parameters:
      `datatype` - the type
      `archive` - the archive

  - ### remove

    public boolean remove(DataType dataType, TaskMonitor monitor)
    Description copied from interface: `DataTypeManager`
    Remove the given datatype from this manager
    Specified by:
      `remove` in interface `DataTypeManager`
    Overrides:
      `remove` in class `DataTypeManagerDB`
    Parameters:
      `dataType` - the dataType to be removed
      `monitor` - the task monitor
    Returns:
      true if the data type existed and was removed

  - ### replaceDataType

    public DataType replaceDataType(DataType existingDt, DataType replacementDt, boolean updateCategoryPath) throws DataTypeDependencyException
    Description copied from interface: `DataTypeManager`
    Replace an existing dataType with another. All instances and references will be updated to use the replacement dataType.
    Specified by:
      `replaceDataType` in interface `DataTypeManager`
    Overrides:
      `replaceDataType` in class `DataTypeManagerDB`
    Parameters:
      `existingDt` - the dataType to be replaced.
      `replacementDt` - the dataType to use as the replacement.
      `updateCategoryPath` - if true, the replacementDt will have its categoryPath changed to the exitingDt's path.
    Returns:
      the resolved replacement dataType.
    Throws:
      `DataTypeDependencyException` - if the replacement datatype depends on the existing dataType;

  - ### close

    public void close()
    Description copied from interface: `DataTypeManager`
    Closes this dataType manager
    Specified by:
      `close` in interface `AutoCloseable`
    Specified by:
      `close` in interface `Closeable`
    Specified by:
      `close` in interface `DataTypeManager`
    Overrides:
      `close` in class `StandAloneDataTypeManager`