Package ghidra.trace.database.property

# Class DBTraceAddressPropertyManager

java.lang.Object
ghidra.trace.database.property.DBTraceAddressPropertyManager

All Implemented Interfaces:
  `ErrorHandler`, `DBTraceManager`, `TraceAddressPropertyManager`

public class DBTraceAddressPropertyManager extends Object implements TraceAddressPropertyManager, DBTraceManager
TODO: Document me TODO: This is public for user properties, i.e., `ProgramUserData`, but encapsulated for trace properties

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `protected static class`
  `DBTraceAddressPropertyManager.DBTraceAddressPropertyEntry`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected final TraceAddressPropertyManager`
  `apiView`
  `protected final Language`
  `baseLanguage`
  `protected final DBHandle`
  `dbh`
  `protected final ReadWriteLock`
  `lock`
  `protected final Map<String,AbstractDBTracePropertyMap<?,?>>`
  `propertyMapsByName`
  `protected final DBCachedObjectStore<DBTraceAddressPropertyManager.DBTraceAddressPropertyEntry>`
  `propertyStore`
  `protected final DBTraceThreadManager`
  `threadManager`
  `protected final DBTrace`
  `trace`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DBTraceAddressPropertyManager(DBHandle dbh, OpenMode openMode, ReadWriteLock lock, TaskMonitor monitor, Language baseLanguage, DBTrace trace, DBTraceThreadManager threadManager)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `<T> AbstractDBTracePropertyMap<T,?>`
  `createPropertyMap(String name, Class<T> valueClass)`
  Create a property map with the given name having the given type
  `void`
  `dbError(IOException e)`
  Notification that an IO exception occurred.
  `protected <T> AbstractDBTracePropertyMap<T,?>`
  `doCreateMap(String name, OpenMode openMode, Class<T> valueClass)`
  `Map<String,TracePropertyMap<?>>`
  `getAllProperties()`
  Get a copy of all the defined properties
  `TraceAddressPropertyManager`
  `getApiPropertyManager()`
  `<T> AbstractDBTracePropertyMap<T,?>`
  `getOrCreatePropertyMap(String name, Class<T> valueClass)`
  Get the property map with the given name, creating it if necessary, of the given type
  `<T> TracePropertyMap<? super T>`
  `getOrCreatePropertyMapSuper(String name, Class<T> valueClass)`
  Get the property map with the given name, creating it if necessary, of the given type
  `TracePropertyMap<?>`
  `getPropertyMap(String name)`
  Get the property map with the given name.
  `<T> AbstractDBTracePropertyMap<T,?>`
  `getPropertyMap(String name, Class<T> valueClass)`
  Get the property map with the given name, if it has the given type
  `<T> TracePropertyMap<? extends T>`
  `getPropertyMapExtends(String name, Class<T> valueClass)`
  Get the property map with the given name, if its values extend the given type
  `void`
  `invalidateCache(boolean all)`
  Invalidate this manager's caches

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

  - ### lock

    protected final ReadWriteLock lock

  - ### baseLanguage

    protected final Language baseLanguage

  - ### trace

    protected final DBTrace trace

  - ### threadManager

    protected final DBTraceThreadManager threadManager

  - ### propertyStore

    protected final DBCachedObjectStore<DBTraceAddressPropertyManager.DBTraceAddressPropertyEntry> propertyStore

  - ### propertyMapsByName

    protected final Map<String,AbstractDBTracePropertyMap<?,?>> propertyMapsByName

  - ### apiView

    protected final TraceAddressPropertyManager apiView

- ## Constructor Details

  - ### DBTraceAddressPropertyManager

    public DBTraceAddressPropertyManager(DBHandle dbh, OpenMode openMode, ReadWriteLock lock, TaskMonitor monitor, Language baseLanguage, DBTrace trace, DBTraceThreadManager threadManager) throws VersionException, IOException
    Throws:
      `VersionException`
      `IOException`

- ## Method Details

  - ### doCreateMap

    protected <T> AbstractDBTracePropertyMap<T,?> doCreateMap(String name, OpenMode openMode, Class<T> valueClass)

  - ### createPropertyMap

    public <T> AbstractDBTracePropertyMap<T,?> createPropertyMap(String name, Class<T> valueClass) throws DuplicateNameException
    Description copied from interface: `TraceAddressPropertyManager`
    Create a property map with the given name having the given type

    The following types are supported for valueClass:

    - `Integer`
    - `Long`
    - `String`
    - `Void`: presence or absence of entry satisfies "boolean" use case
    - `? extends` `Saveable`

    Note that for maps of user-defined `Saveable` type, only the specified type is accepted by the map. Attempting to save an extension of that type may lead to undefined behavior, esp., if it attempts to save additional fields. When the value is restored, it will have the type given in `valueClass`, not the extended type.

    Specified by:
      `createPropertyMap` in interface `TraceAddressPropertyManager`
    Parameters:
      `name` - the name
      `valueClass` - the type of values
    Returns:
      the new property map
    Throws:
      `DuplicateNameException` - if a map of the given name already exists

  - ### getPropertyMap

    public <T> AbstractDBTracePropertyMap<T,?> getPropertyMap(String name, Class<T> valueClass)
    Description copied from interface: `TraceAddressPropertyManager`
    Get the property map with the given name, if it has the given type
    Specified by:
      `getPropertyMap` in interface `TraceAddressPropertyManager`
    Parameters:
      `name` - the name
      `valueClass` - the expected type of values
    Returns:
      the property map, or null if it does not exist

  - ### getPropertyMapExtends

    public <T> TracePropertyMap<? extends T> getPropertyMapExtends(String name, Class<T> valueClass)
    Description copied from interface: `TraceAddressPropertyManager`
    Get the property map with the given name, if its values extend the given type
    Specified by:
      `getPropertyMapExtends` in interface `TraceAddressPropertyManager`
    Parameters:
      `name` - the name
      `valueClass` - the expected type of values
    Returns:
      the property map, or null if it does not exist

  - ### getOrCreatePropertyMap

    public <T> AbstractDBTracePropertyMap<T,?> getOrCreatePropertyMap(String name, Class<T> valueClass)
    Description copied from interface: `TraceAddressPropertyManager`
    Get the property map with the given name, creating it if necessary, of the given type
    Specified by:
      `getOrCreatePropertyMap` in interface `TraceAddressPropertyManager`
    Parameters:
      `name` - the name
      `valueClass` - the expected type of values
    Returns:
      the (possibly new) property map
    See Also:
      - `TraceAddressPropertyManager.createPropertyMap(String, Class)`

  - ### getOrCreatePropertyMapSuper

    public <T> TracePropertyMap<? super T> getOrCreatePropertyMapSuper(String name, Class<T> valueClass)
    Description copied from interface: `TraceAddressPropertyManager`
    Get the property map with the given name, creating it if necessary, of the given type

    If the map already exists, then its values' type must be a super type of that given.

    Specified by:
      `getOrCreatePropertyMapSuper` in interface `TraceAddressPropertyManager`
    Parameters:
      `name` - the name
      `valueClass` - the expected type of values
    Returns:
      the (possibly new) property map
    See Also:
      - `TraceAddressPropertyManager.getOrCreatePropertyMap(String, Class)`

  - ### getPropertyMap

    public TracePropertyMap<?> getPropertyMap(String name)
    Description copied from interface: `TraceAddressPropertyManager`
    Get the property map with the given name.

    Note that no type checking is performed (there is no `valueClass` parameter). Thus, the returned map is suitable only for clearing and querying where the property is present. The caller may perform run-time type checking via the `TracePropertyMapOperations.getValueClass()` method.

    Specified by:
      `getPropertyMap` in interface `TraceAddressPropertyManager`
    Parameters:
      `name` - the name
    Returns:
      the property map

  - ### getAllProperties

    public Map<String,TracePropertyMap<?>> getAllProperties()
    Description copied from interface: `TraceAddressPropertyManager`
    Get a copy of all the defined properties
    Specified by:
      `getAllProperties` in interface `TraceAddressPropertyManager`
    Returns:
      the set of names

  - ### dbError

    public void dbError(IOException e)
    Description copied from interface: `ErrorHandler`
    Notification that an IO exception occurred.
    Specified by:
      `dbError` in interface `ErrorHandler`
    Parameters:
      `e` - `IOException` which was cause of error

  - ### invalidateCache

    public void invalidateCache(boolean all)
    Description copied from interface: `DBTraceManager`
    Invalidate this manager's caches
    Specified by:
      `invalidateCache` in interface `DBTraceManager`
    Parameters:
      `all` - probably nothing. Check out implementations of `ManagerDB.invalidateCache(boolean)`.

  - ### getApiPropertyManager

    public TraceAddressPropertyManager getApiPropertyManager()