Class FunctionTagManagerDB

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected Lock lock  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      FunctionTag createFunctionTag​(java.lang.String name, java.lang.String comment)
      Creates a new function tag with the given attributes if one does not already exist.
      void dbError​(java.io.IOException e)
      Notification that an IO exception occurred.
      java.util.List<? extends FunctionTag> getAllFunctionTags()
      TODO: Be a bit smarter about this - if the cache contains all the tags in the db we can just return the cache itself.
      FunctionTag getFunctionTag​(long id)
      Returns the function tag with the given database id.
      FunctionTag getFunctionTag​(java.lang.String name)
      Returns the function tag with the given name.
      ghidra.program.database.function.FunctionTagAdapter getFunctionTagAdapter()  
      ghidra.program.database.function.FunctionTagMappingAdapter getFunctionTagMappingAdapter()  
      boolean isTagAssigned​(java.lang.String name)
      Returns true if the given tag is assigned to a function.
      void setProgram​(Program program)
      Sets the program on this manager to allow the manager to persist changes and notify subscribers.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • lock

        protected final Lock lock
    • Method Detail

      • setProgram

        public void setProgram​(Program program)
        Description copied from interface: FunctionTagManager
        Sets the program on this manager to allow the manager to persist changes and notify subscribers.
        Specified by:
        setProgram in interface FunctionTagManager
        Parameters:
        program - the program
      • dbError

        public void dbError​(java.io.IOException e)
        Description copied from interface: ErrorHandler
        Notification that an IO exception occurred.
        Specified by:
        dbError in interface ErrorHandler
      • getFunctionTag

        public FunctionTag getFunctionTag​(java.lang.String name)
        Description copied from interface: FunctionTagManager
        Returns the function tag with the given name.
        Specified by:
        getFunctionTag in interface FunctionTagManager
        Parameters:
        name - the tag name
        Returns:
        the function tag, or null if not found
      • getFunctionTag

        public FunctionTag getFunctionTag​(long id)
        Description copied from interface: FunctionTagManager
        Returns the function tag with the given database id.
        Specified by:
        getFunctionTag in interface FunctionTagManager
        Parameters:
        id - the tags database id
        Returns:
        the function tag, or null if not found
      • isTagAssigned

        public boolean isTagAssigned​(java.lang.String name)
        Description copied from interface: FunctionTagManager
        Returns true if the given tag is assigned to a function.
        Specified by:
        isTagAssigned in interface FunctionTagManager
        Parameters:
        name - the tag name
        Returns:
        true if assigned to a function
      • createFunctionTag

        public FunctionTag createFunctionTag​(java.lang.String name,
                                             java.lang.String comment)
        Description copied from interface: FunctionTagManager
        Creates a new function tag with the given attributes if one does not already exist. Otherwise, returns the existing tag.
        Specified by:
        createFunctionTag in interface FunctionTagManager
        Parameters:
        name - the tag name
        comment - the comment associated with the tag (optional)
        Returns:
        the new function tag
      • getAllFunctionTags

        public java.util.List<? extends FunctionTag> getAllFunctionTags()
        TODO: Be a bit smarter about this - if the cache contains all the tags in the db we can just return the cache itself. If not, then go to the db to get the remainder.
        Specified by:
        getAllFunctionTags in interface FunctionTagManager
        Returns:
        Throws:
        java.io.IOException
      • getFunctionTagAdapter

        public ghidra.program.database.function.FunctionTagAdapter getFunctionTagAdapter()
      • getFunctionTagMappingAdapter

        public ghidra.program.database.function.FunctionTagMappingAdapter getFunctionTagMappingAdapter()