Skip to content

Commit c660642

Browse files
committed
Add isLoad and isStore operators for atomic transaction to ensure compatibility with previous version of PML
1 parent 3616f6b commit c660642

File tree

1 file changed

+16
-0
lines changed
  • src/main/scala/onera/pmlanalyzer/pml/operators

1 file changed

+16
-0
lines changed

src/main/scala/onera/pmlanalyzer/pml/operators/Used.scala

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,22 @@ object Used {
229229
): Set[AtomicTransaction] =
230230
ev(x)
231231

232+
/** Check if the transaction is a load transaction
233+
*
234+
* @return
235+
* true if target services are loads
236+
*/
237+
def isLoad(using ev: Transform[T, Set[AtomicTransaction]]): Boolean =
238+
paths.forall(path => path.nonEmpty && path.head.isInstanceOf[Load])
239+
240+
/** Check if the transaction is a store transaction
241+
*
242+
* @return
243+
* true if target services are stores
244+
*/
245+
def isStore(using ev: Transform[T, Set[AtomicTransaction]]): Boolean =
246+
paths.forall(path => path.nonEmpty && path.head.isInstanceOf[Store])
247+
232248
/** Check if the target is in the possible targets of the transaction
233249
*
234250
* @param t

0 commit comments

Comments
 (0)