Performs a transactional read of the index
th element of this
transactional array.
Performs a transactional read of the index
th element of this
transactional array. Equivalent to refs(index).get
.
Returns the length of this TArray
, which does not change.
Returns a sequence of Ref
instances that are backed by elements of this
TArray
.
Returns a sequence of Ref
instances that are backed by elements of this
TArray
. All operations on the contained Ref
s are supported.
As an example, the following code tests whether a(i)
is greater than
10 without requiring the transaction to roll back for all writes to
a(i)
:
atomic { implicit t => if (a.refs(i).getWith( _ > 10 )) { ... lots of stuff } }
Returns a TArray.View
that allows access to the contents of this
TArray
without requiring that an InTxn
be available.
Returns a TArray.View
that allows access to the contents of this
TArray
without requiring that an InTxn
be available. See Ref.View
.
Performs a transactional write to the index
th element of this
transactional array.
Performs a transactional write to the index
th element of this
transactional array. Equivalent to refs(index).set(v)
.
Bulk transactional storage, roughly equivalent to
Array[Ref[T]]
but potentially much more space efficient. Elements can be read and written directly, or therefs
method can be used to obtain transientRef
instances backed by the elements of theTArray
.