Package ghidra.trace.model
Interface TraceTimeViewport
- All Known Implementing Classes:
DBTraceTimeViewport
public interface TraceTimeViewport
A convenience for tracking the time structure of a trace and querying the trace accordingly.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfacestatic interfacestatic interfacestatic interface -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a listener for when the forking structure of this viewport changes<T> AddressSetcomputeVisibleParts(AddressSetView set, Lifespan lifespan, T object, TraceTimeViewport.Occlusion<T> occlusion) Compute the parts of a given object that are visible past more-recent objectsbooleancontainsAnyUpper(Lifespan lifespan) Check if the given lifespan contains any upper snap among the involved spansGet the snaps involved in the view in most-recent-first orderGet the spans involved in the view in most-recent-first orderGet the snaps involved in the view in least-recent-first orderGet the spans involved in the view in least-recent-first order<T> TGet the first non-null result of the function, applied to the most-recent snaps first<T> booleanisCompletelyVisible(AddressRange range, Lifespan lifespan, T object, TraceTimeViewport.Occlusion<T> occlusion) Check if any part of the given object is occluded by more-recent objectsbooleanisForked()Check if this view is forked<T> Iterator<T> mergedIterator(Function<Long, Iterator<T>> iterFunc, Comparator<? super T> comparator) Merge iterators from each involved snap into a single iteratorvoidRemove a listener for forking structure changesvoidsetSnap(long snap) Set the snapshot for this viewportunionedAddresses(Function<Long, AddressSetView> setFunc) Union address sets from each involved snap
-
Method Details
-
setSnap
void setSnap(long snap) Set the snapshot for this viewport- Parameters:
snap- the snap
-
addChangeListener
Add a listener for when the forking structure of this viewport changesThis can occur when the snap changes or when any snapshot involved changes
- Parameters:
l- the listener
-
removeChangeListener
Remove a listener for forking structure changes- Parameters:
l- the listener- See Also:
-
isForked
boolean isForked()Check if this view is forkedThe view is considered forked if any snap previous to this has a schedule with an initial snap other than the immediately-preceding one. Such forks "break" the linearity of the trace's usual time line.
- Returns:
- true if forked, false otherwise
-
containsAnyUpper
Check if the given lifespan contains any upper snap among the involved spans- Parameters:
lifespan- the lifespan to consider- Returns:
- true if it contains any upper snap, false otherwise.
-
isCompletelyVisible
<T> boolean isCompletelyVisible(AddressRange range, Lifespan lifespan, T object, TraceTimeViewport.Occlusion<T> occlusion) Check if any part of the given object is occluded by more-recent objects- Type Parameters:
T- the type of the object- Parameters:
range- the address range of the objectlifespan- the lifespan of the objectobject- optionally, the object to examine. Used to avoid "self occlusion"occlusion- a mechanism for querying other like objects and checking for occlusion- Returns:
- true if completely visible, false if even partially occluded
-
computeVisibleParts
<T> AddressSet computeVisibleParts(AddressSetView set, Lifespan lifespan, T object, TraceTimeViewport.Occlusion<T> occlusion) Compute the parts of a given object that are visible past more-recent objects- Type Parameters:
T- the type of the object- Parameters:
set- the addresses comprising the objectlifespan- the lifespan of the objectobject- the object to examineocclusion- a mechanism for query other like objects and removing occluded parts- Returns:
- the set of visible addresses
-
getOrderedSpans
Get the spans involved in the view in most-recent-first order- Returns:
- the list of spans
-
getReversedSpans
Get the spans involved in the view in least-recent-first order- Returns:
- the list of spans
-
getOrderedSnaps
Get the snaps involved in the view in most-recent-first orderThe first is always this view's snap. Following are the source snaps of each previous snapshot's schedule where applicable.
- Returns:
- the list of snaps
-
getReversedSnaps
Get the snaps involved in the view in least-recent-first order- Returns:
- the list of snaps
-
getTop
Get the first non-null result of the function, applied to the most-recent snaps firstTypically, func both retrieves an object and tests for its suitability.
- Type Parameters:
T- the type of object to retrieve- Parameters:
func- the function on a snap to retrieve an object- Returns:
- the first non-null result
-
mergedIterator
<T> Iterator<T> mergedIterator(Function<Long, Iterator<T>> iterFunc, Comparator<? super T> comparator) Merge iterators from each involved snap into a single iteratorTypically, the resulting iterator is passed through a filter to test each objects suitability.
- Type Parameters:
T- the type of objects in each iterator- Parameters:
iterFunc- a function on a snap to retrieve each iteratorcomparator- the comparator for merging, which must yield the same order as each iterator- Returns:
- the merged iterator
-
unionedAddresses
Union address sets from each involved snapThe returned union is computed lazily.
- Parameters:
setFunc- a function on a snap to retrieve the address set- Returns:
- the union
-