LocalL256BitVector (struct)

Same as a BitVector, but the first 256 bits will not require memory allocation (local).

LocalL256BitVector LocalL256BitVector LocalL256BitVector

Methods

  LocalL256BitVector ( in LocalL256BitVector other )
  LocalL256BitVector ()
  atomicClear ! ( in UInt32 index )
  atomicSet ! ( in UInt32 index )
  atomicSet ! ( in UInt32 index, in Boolean value )
BitVectorIterator begin ? ()
  clear ! ( in UInt32 index )
  clearAll ! ()
LocalL256BitVector clone ? ()
  copy ! ( in LocalL256BitVector src )
Boolean get ? ( in UInt32 index )
Boolean getNext ? ( io BitVectorIterator iter )
String getString ? ()
Boolean getThenClear ! ( in UInt32 index )
Boolean getThenSet ! ( in UInt32 index )
Boolean getThenSet ! ( in UInt32 index, in Boolean value )
  resize ! ( in UInt32 size )
  set ! ( in UInt32 index )
  set ! ( in UInt32 index, in Boolean value )
  setAll ! ()
UInt32 size ? ()

Methods in detail

LocalL256BitVector ( in LocalL256BitVector other )

copy constructor


LocalL256BitVector ()

default constructor


LocalL256BitVector.atomicClear! ( in UInt32 index )

performs an atomic clear of a bit.

注釈

atomic calls are threadsafe but slower since they cause cache synchronization across CPUs.


LocalL256BitVector.atomicSet! ( in UInt32 index )

performs an atomic set with true.

注釈

atomic calls are threadsafe but slower since they cause cache synchronization across CPUs.


LocalL256BitVector.atomicSet! ( in UInt32 index, in Boolean value )

performs an atomic set with a known value.

注釈

atomic calls are threadsafe but slower since they cause cache synchronization across CPUs.


BitVectorIterator LocalL256BitVector.begin? ()

returns an iterator at the start of the vector. This method is particularly efficient for traversing sparse bits, where only a small portion are set to true.

/*
** Example: begin
*/

require Containers;
  
operator entry() {

  LocalL256BitVector v;
  v.resize(4);
  v.set(0, true);
  v.set(1, true);
  v.set(2, false);
  v.set(3, true);
  LocalL256BitVectorIterator it = v.begin();
  while(v.getNext(it)) {
    report(it.index + ' : ' + v.get(it.index));
  }
  
}

/*
** Output:
(stdin):16:30: error: 'LocalL256BitVectorIterator': type not registered
(stdin):17:19: error: 'it': symbol not found


*/


LocalL256BitVector.clear! ( in UInt32 index )

clears a bit


LocalL256BitVector.clearAll! ()

clears all bits in this vector


LocalL256BitVector LocalL256BitVector.clone? ()

clone method


LocalL256BitVector.copy! ( in LocalL256BitVector src )

copy constructor.


Boolean LocalL256BitVector.get? ( in UInt32 index )

returns true if the bit is set


Boolean LocalL256BitVector.getNext? ( io BitVectorIterator iter )

returns the next BitVectorIterator on this vector based on the previous one This method is particularly efficient for traversing sparse bits, where only a small portion are set to true.


String LocalL256BitVector.getString? ()

returns a description of the bit values


Boolean LocalL256BitVector.getThenClear! ( in UInt32 index )

clears the bit and returns the previous value


Boolean LocalL256BitVector.getThenSet! ( in UInt32 index )

performs a set with true for a known value and returns the previous value


Boolean LocalL256BitVector.getThenSet! ( in UInt32 index, in Boolean value )

sets the bit to a known value and returns the previous value


LocalL256BitVector.resize! ( in UInt32 size )

resizes the LocalL256BitVector for a given number of bits


LocalL256BitVector.set! ( in UInt32 index )

sets a single bit to true


LocalL256BitVector.set! ( in UInt32 index, in Boolean value )

sets a single bit from the Boolean value


LocalL256BitVector.setAll! ()

sets all bits in this vector to true


UInt32 LocalL256BitVector.size? ()

returns the number bit array size