Package cppclassanalyzer.data.manager
Class ClassTypeInfoManagerDB
java.lang.Object
cppclassanalyzer.data.manager.ClassTypeInfoManagerDB
- All Implemented Interfaces:
ClassTypeInfoManager
,ProgramClassTypeInfoManager
,TypeInfoManager
,ErrorHandler
,ManagerDB
- Direct Known Subclasses:
ItaniumAbiClassTypeInfoManager
,VsClassTypeInfoManager
public abstract class ClassTypeInfoManagerDB extends Object implements ManagerDB, ProgramClassTypeInfoManager
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
ClassTypeInfoManagerDB.RttiRecordWorker
-
Field Summary
Fields Modifier and Type Field Description protected ClassTypeInfoManagerService
plugin
protected ProgramDB
program
protected TypeInfoTreeNodeManager
treeNodeManager
protected ClassTypeInfoManagerDB.RttiRecordWorker
worker
Fields inherited from interface cppclassanalyzer.data.ClassTypeInfoManager
INVALID_KEY
-
Constructor Summary
Constructors Modifier Constructor Description protected
ClassTypeInfoManagerDB(ClassTypeInfoManagerService service, ProgramDB program)
-
Method Summary
Modifier and Type Method Description boolean
containsRecord(AbstractVtableDB vtable)
void
dbError(IOException e)
Address
decodeAddress(long offset)
void
deleteAddressRange(Address startAddr, Address endAddr, TaskMonitor monitor)
long
encodeAddress(Address address)
Icon
getIcon(boolean expanded)
Gets the icon for this manager to be used in theTypeInfoArchiveGTree
String
getName()
Gets the name of this managerprotected static ClassTypeInfoDatabaseTable
getNewClassTable(DBHandle handle)
ProgramDB
getProgram()
Gets the programTypeInfoTreeNodeManager
getTreeNodeManager()
Gets theTypeInfoTreeNodeManager
for this ClassTypeInfoManagerClassTypeInfoDB
getType(long key)
Gets the ClassTypeInfo for the corresponding database keyClassTypeInfoDB
getType(Address address)
Gets the ClassTypeInfo at the specified addressClassTypeInfoDB
getType(Function fun)
Gets the ClassTypeInfo for the correspondingFunction
ClassTypeInfoDB
getType(GhidraClass gc)
Gets the ClassTypeInfo for the correspondingGhidraClass
AbstractClassTypeInfoDB
getType(UniversalID id)
Gets the type with a class data type that has the provided idClassTypeInfoDB
getType(String name)
Gets the ClassTypeInfo with the specified symbol.ClassTypeInfoDB
getType(String name, Namespace namespace)
Gets the ClassTypeInfo with the specified name andNamespace
int
getTypeCount()
Gets the number of managed ClassTypeInfosTypeInfo
getTypeInfo(Address address)
Get the TypeInfo at the addressTypeInfo
getTypeInfo(Address address, boolean resolve)
Gets the Type info at the specified address.long
getTypeKey(Address address)
Iterable<ClassTypeInfoDB>
getTypes(boolean reverse)
Gets an iterable over all the managed ClassTypeInfos in the specified directionStream<ClassTypeInfoDB>
getTypeStream(boolean reverse)
Gets a stream of all the managed ClassTypeInfos in the specified directionVtable
getVtable(Address address)
Gets the Vtable at the specified addressint
getVtableCount()
Gets the number of managed VtablesIterable<Vtable>
getVtableIterable(boolean reverse)
Gets an iterable over all the managed Vtables in the specified directionlong
getVtableKey(Address address)
Stream<Vtable>
getVtableStream()
Gets a stream of all the managed Vtablesprotected abstract ClassTypeInfoManagerDB.RttiRecordWorker
getWorker(ProgramRttiTablePair tables, ProgramRttiCachePair caches)
void
invalidateCache(boolean all)
void
moveAddressRange(Address fromAddr, Address toAddr, long length, TaskMonitor monitor)
void
programReady(int openMode, int currentRevision, TaskMonitor monitor)
AbstractClassTypeInfoDB
resolve(ArchivedClassTypeInfo type)
Returns a ClassTypeInfo that is managed by this ClassTypeInfoManager.Vtable
resolve(ArchivedGnuVtable vtable)
Returns a Vtable that is managed by this ClassTypeInfoManager.AbstractClassTypeInfoDB
resolve(ClassTypeInfo type)
Returns a ClassTypeInfo that is managed by this ClassTypeInfoManager.Vtable
resolve(Vtable vtable)
Returns a Vtable that is managed by this ProgramClassTypeInfoManager.void
setProgram(ProgramDB program)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface cppclassanalyzer.data.ProgramClassTypeInfoManager
addListener, getTypes, getTypeStream, getVtables, removeListener
Methods inherited from interface cppclassanalyzer.data.TypeInfoManager
isTypeInfo
-
Field Details
-
plugin
-
program
-
worker
-
treeNodeManager
-
-
Constructor Details
-
ClassTypeInfoManagerDB
-
-
Method Details
-
getWorker
protected abstract ClassTypeInfoManagerDB.RttiRecordWorker getWorker(ProgramRttiTablePair tables, ProgramRttiCachePair caches) -
getNewClassTable
- Throws:
IOException
-
getName
Description copied from interface:ClassTypeInfoManager
Gets the name of this manager- Specified by:
getName
in interfaceClassTypeInfoManager
- Returns:
- the managers name
-
getIcon
Description copied from interface:ClassTypeInfoManager
Gets the icon for this manager to be used in theTypeInfoArchiveGTree
- Specified by:
getIcon
in interfaceClassTypeInfoManager
- Parameters:
expanded
- true if the manager tree node is expanded- Returns:
- the icon to be used in the tree
-
getTypeKey
-
getVtableKey
-
decodeAddress
-
encodeAddress
-
containsRecord
-
getProgram
Description copied from interface:ProgramClassTypeInfoManager
Gets the program- Specified by:
getProgram
in interfaceProgramClassTypeInfoManager
- Returns:
- the program
-
setProgram
- Specified by:
setProgram
in interfaceManagerDB
-
programReady
public void programReady(int openMode, int currentRevision, TaskMonitor monitor) throws IOException, CancelledException- Specified by:
programReady
in interfaceManagerDB
- Throws:
IOException
CancelledException
-
invalidateCache
public final void invalidateCache(boolean all)- Specified by:
invalidateCache
in interfaceManagerDB
-
deleteAddressRange
public void deleteAddressRange(Address startAddr, Address endAddr, TaskMonitor monitor) throws CancelledException- Specified by:
deleteAddressRange
in interfaceManagerDB
- Throws:
CancelledException
-
moveAddressRange
public void moveAddressRange(Address fromAddr, Address toAddr, long length, TaskMonitor monitor) throws AddressOverflowException, CancelledException- Specified by:
moveAddressRange
in interfaceManagerDB
- Throws:
AddressOverflowException
CancelledException
-
getType
Description copied from interface:ProgramClassTypeInfoManager
Gets the ClassTypeInfo at the specified address- Specified by:
getType
in interfaceProgramClassTypeInfoManager
- Parameters:
address
- the address of the ClassTypeInfo- Returns:
- the ClassTypeInfo or null if invalid
-
getVtable
Description copied from interface:ProgramClassTypeInfoManager
Gets the Vtable at the specified address- Specified by:
getVtable
in interfaceProgramClassTypeInfoManager
- Parameters:
address
- the address of the vtable- Returns:
- the vtable at the address or null if none is present
-
getType
Description copied from interface:ClassTypeInfoManager
Gets the ClassTypeInfo for the correspondingGhidraClass
- Specified by:
getType
in interfaceClassTypeInfoManager
- Parameters:
gc
- the GhidraClass- Returns:
- the ClassTypeInfo or null if it doesn't exist
-
getType
Description copied from interface:ClassTypeInfoManager
Gets the ClassTypeInfo for the correspondingFunction
- Specified by:
getType
in interfaceClassTypeInfoManager
- Parameters:
fun
- the function- Returns:
- the ClassTypeInfo or null if it doesn't exist
-
getType
Description copied from interface:ClassTypeInfoManager
Gets the ClassTypeInfo with the specified symbol. The supplied symbol should be mangled.- Specified by:
getType
in interfaceClassTypeInfoManager
- Parameters:
name
- the mangled symbol name- Returns:
- the ClassTypeInfo or null if it doesn't exist
-
getType
Description copied from interface:ClassTypeInfoManager
Gets the ClassTypeInfo with the specified name andNamespace
- Specified by:
getType
in interfaceClassTypeInfoManager
- Parameters:
name
- the type's namenamespace
- the type's namespace- Returns:
- the ClassTypeInfo or null if it doesn't exist
-
resolve
Description copied from interface:ClassTypeInfoManager
Returns a ClassTypeInfo that is managed by this ClassTypeInfoManager. If one does not currently exist a new one is created.- Specified by:
resolve
in interfaceClassTypeInfoManager
- Parameters:
type
- the type to resolve- Returns:
- the equivalent type managed by this ClassTypeInfoManager
-
resolve
Description copied from interface:ProgramClassTypeInfoManager
Returns a Vtable that is managed by this ProgramClassTypeInfoManager. If one does not currently exist a new one is created.- Specified by:
resolve
in interfaceProgramClassTypeInfoManager
- Parameters:
vtable
- the vtable to resolve- Returns:
- the equivalent vtable managed by this ProgramClassTypeInfoManager
-
resolve
Description copied from interface:ProgramClassTypeInfoManager
Returns a ClassTypeInfo that is managed by this ClassTypeInfoManager. If the ArchivedClassTypeInfo hasn't already been resolved the type will be created and all required data will be added to the program.- Specified by:
resolve
in interfaceProgramClassTypeInfoManager
- Parameters:
type
- the type to resolve- Returns:
- the equivalent type managed by this ClassTypeInfoManager
-
resolve
Description copied from interface:ProgramClassTypeInfoManager
Returns a Vtable that is managed by this ClassTypeInfoManager. If the ArchivedGnuVtable hasn't already been resolved the vtable will be created and all required data will be added to the program.- Specified by:
resolve
in interfaceProgramClassTypeInfoManager
- Parameters:
vtable
- the vtable to resolve- Returns:
- the equivalent vtable managed by this ClassTypeInfoManager
-
getTypeCount
public int getTypeCount()Description copied from interface:ClassTypeInfoManager
Gets the number of managed ClassTypeInfos- Specified by:
getTypeCount
in interfaceClassTypeInfoManager
- Returns:
- the number of managed ClassTypeInfos
-
getVtableCount
public int getVtableCount()Description copied from interface:ProgramClassTypeInfoManager
Gets the number of managed Vtables- Specified by:
getVtableCount
in interfaceProgramClassTypeInfoManager
- Returns:
- the number of managed Vtables
-
getTypes
Description copied from interface:ProgramClassTypeInfoManager
Gets an iterable over all the managed ClassTypeInfos in the specified direction- Specified by:
getTypes
in interfaceProgramClassTypeInfoManager
- Parameters:
reverse
- true if the types should be provided in reverse- Returns:
- an iterable over all the managed ClassTypeInfos
-
getVtableIterable
Description copied from interface:ProgramClassTypeInfoManager
Gets an iterable over all the managed Vtables in the specified direction- Specified by:
getVtableIterable
in interfaceProgramClassTypeInfoManager
- Parameters:
reverse
- true if the Vtables should be provided in reverse- Returns:
- an iterable over all the managed Vtables
-
getTypeStream
Description copied from interface:ProgramClassTypeInfoManager
Gets a stream of all the managed ClassTypeInfos in the specified direction- Specified by:
getTypeStream
in interfaceProgramClassTypeInfoManager
- Parameters:
reverse
- true if the types should be provided in reverse- Returns:
- a stream of all the managed ClassTypeInfos
-
getVtableStream
Description copied from interface:ProgramClassTypeInfoManager
Gets a stream of all the managed Vtables- Specified by:
getVtableStream
in interfaceProgramClassTypeInfoManager
- Returns:
- a stream of all the managed Vtables
-
getTypeInfo
Description copied from interface:TypeInfoManager
Get the TypeInfo at the address- Specified by:
getTypeInfo
in interfaceTypeInfoManager
- Parameters:
address
- the address of the TypeInfo- Returns:
- the TypeInfo at the specified address or null if none exists.
-
getTypeInfo
Description copied from interface:ProgramClassTypeInfoManager
Gets the Type info at the specified address. If the TypeInfo is a ClassTypeInfo it can be resolved if requested.- Specified by:
getTypeInfo
in interfaceProgramClassTypeInfoManager
- Parameters:
address
- the address of the TypeInforesolve
- true to resolve the TypeInfo if it happens to be a ClassTypeInfo- Returns:
- the TypeInfo at the address
-
getTreeNodeManager
Description copied from interface:ClassTypeInfoManager
Gets theTypeInfoTreeNodeManager
for this ClassTypeInfoManager- Specified by:
getTreeNodeManager
in interfaceClassTypeInfoManager
- Returns:
- this manager's TypeInfoTreeNodeManager
-
dbError
- Specified by:
dbError
in interfaceErrorHandler
-
getType
Description copied from interface:ClassTypeInfoManager
Gets the ClassTypeInfo for the corresponding database key- Specified by:
getType
in interfaceClassTypeInfoManager
- Parameters:
key
- the database key- Returns:
- the ClassTypeInfo or null if it doesn't exist
-
getType
Description copied from interface:ProgramClassTypeInfoManager
Gets the type with a class data type that has the provided id- Specified by:
getType
in interfaceProgramClassTypeInfoManager
- Parameters:
id
- the universal id- Returns:
- the type with the corresponding data type id or null
-