Package ghidra.program.model.block
Class SimpleSourceReferenceIterator
java.lang.Object
ghidra.program.model.block.SimpleSourceReferenceIterator
- All Implemented Interfaces:
CodeBlockReferenceIterator
SimpleSourceReferenceIterator is a unidirectional iterator over the
CodeBlockReference
s
for a CodeBlock. It is not failfast, whenever hasNext()
are called it will find if there is a next CodeBlockReference
and acquire
a handle if there is one. If new code units are added to the listing after
the iterator is created it will find them as it scans ahead.-
Constructor Summary
ConstructorDescriptionSimpleSourceReferenceIterator
(CodeBlock block, boolean followIndirectFlows, TaskMonitor monitor) Construct an Iterator over Source blocks for a CodeBlock. -
Method Summary
Modifier and TypeMethodDescriptionstatic int
getNumSources
(CodeBlock block, boolean followIndirectFlows, TaskMonitor monitor) Deprecated.this method should be avoided since it repeats the work of the iteratorboolean
hasNext()
Return true if next() will return a CodeBlockReference.next()
Return the next CodeBlockReference.
-
Constructor Details
-
SimpleSourceReferenceIterator
public SimpleSourceReferenceIterator(CodeBlock block, boolean followIndirectFlows, TaskMonitor monitor) throws CancelledException Construct an Iterator over Source blocks for a CodeBlock.- Parameters:
block
- block to get destination blocks for. This should be a block obtained from SimpleBlockModel.followIndirectFlows
- indirect references will only be included if truemonitor
- task monitor which allows user to cancel operation.- Throws:
CancelledException
- if the monitor cancels the operation.
-
-
Method Details
-
next
Description copied from interface:CodeBlockReferenceIterator
Return the next CodeBlockReference.- Specified by:
next
in interfaceCodeBlockReferenceIterator
- Throws:
CancelledException
- thrown if the operation is cancelled.- See Also:
-
hasNext
Description copied from interface:CodeBlockReferenceIterator
Return true if next() will return a CodeBlockReference.- Specified by:
hasNext
in interfaceCodeBlockReferenceIterator
- Throws:
CancelledException
- thrown if the operation is cancelled.- See Also:
-
getNumSources
@Deprecated public static int getNumSources(CodeBlock block, boolean followIndirectFlows, TaskMonitor monitor) throws CancelledException Deprecated.this method should be avoided since it repeats the work of the iteratorGet number of source references flowing from this subroutine (block). All Calls to this block, and all external FlowType block references to this block are counted.- Parameters:
block
- code block to get the number of source references to.followIndirectFlows
- indirect references will only be included if truemonitor
- task monitor which allows user to cancel operation.- Throws:
CancelledException
- if the monitor cancels the operation.
-