Package ghidra.program.model.block
Class SimpleDestReferenceIterator
java.lang.Object
ghidra.program.model.block.SimpleDestReferenceIterator
- All Implemented Interfaces:
CodeBlockReferenceIterator
This iterator is implemented by getting the flows from the instruction
and iterating over those flows (plus the fallthrough). This is probably
not the most efficient method. An linked-list of references has to be created each
time we want to get the destinations from a block.
-
Constructor Summary
ConstructorDescriptionSimpleDestReferenceIterator
(CodeBlock block, boolean followIndirectFlows, TaskMonitor monitor) Construct an Iterator over Destination blocks for a CodeBlock. -
Method Summary
Modifier and TypeMethodDescriptionstatic int
getNumDestinations
(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
-
SimpleDestReferenceIterator
public SimpleDestReferenceIterator(CodeBlock block, boolean followIndirectFlows, TaskMonitor monitor) throws CancelledException Construct an Iterator over Destination blocks for a CodeBlock. External references are ignored.- 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:
-
getNumDestinations
@Deprecated public static int getNumDestinations(CodeBlock block, boolean followIndirectFlows, TaskMonitor monitor) throws CancelledException Deprecated.this method should be avoided since it repeats the work of the iteratorGet number of destination references flowing out of this block. All Calls from this block, and all external FlowType block references from this block are ignored.- Parameters:
block
- code block to get the number of destination references from.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.
-