Refactor viewer sessions and selections and optimize transaction queries
This commit is contained in:
1 parent
4824d48828
commit
589762b220
42 files changed
+1118
-720
No files matched your search
+20
-1
@@ -11,6 +11,11 @@
|
||||
package com.minres.scviewer.database.ftr;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
import com.minres.scviewer.database.LazyValue;
|
||||
import com.minres.scviewer.database.tx.ITx;
|
||||
import com.minres.scviewer.database.tx.TransactionLists;
|
||||
import com.minres.scviewer.database.tx.ITransactionProvider;
|
||||
import com.minres.scviewer.database.EventEntry;
|
||||
import com.minres.scviewer.database.EventList;
|
||||
import com.minres.scviewer.database.HierNode;
|
||||
@@ -24,7 +29,21 @@ import com.minres.scviewer.database.tx.ITxEvent;
|
||||
/**
|
||||
* The Class AbstractTxStream.
|
||||
*/
|
||||
abstract class AbstractTxStream extends HierNode implements IWaveform {
|
||||
abstract class AbstractTxStream extends HierNode implements IWaveform, ITransactionProvider {
|
||||
|
||||
private final LazyValue<List<ITx>> transactionList = new LazyValue<>();
|
||||
|
||||
@Override
|
||||
public List<ITx> getTransactionList() {
|
||||
return transactionList.get(() -> TransactionLists.fromEvents(getEvents(), () -> false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ITx getTransaction(long id) {
|
||||
getEvents(); // FTR parses the owning stream on demand.
|
||||
ITx transaction = loader.getTransaction(id);
|
||||
return transaction != null && (transaction.getStream() == this || transaction.getGenerator() == this) ? transaction : null;
|
||||
}
|
||||
|
||||
private final String fullName;
|
||||
|
||||
|
||||
Reference in new issue
Block a user