The Sequence class implements a thread-safe increment-only object.
Table 4.782. Sequence Method Overview
Method | Except? | Description |
|---|---|---|
| N | Creates a new Sequence object. |
N | Destroys the Sequence object. | |
N | Creates a new Sequence object, not based on the original. | |
N | Atomically increments the counter and returns the last value. | |
N | Returns the current value of the counter. |
Creates a new Sequence object.
Sequence::constructor(softint$start)
my Sequence $seq();Table 4.783. Arguments for Sequence::constructor()
Argument | Description |
|---|---|
| Optional start number for the sequence (default with no argument = 0). |
Creates a new Sequence object, not based on the original.
my Sequence $new_seq = $seq.copy();Atomically increments the counter and returns the last value.
$seq.next();
Table 4.784. Return Values for Sequence::next()
Return Type | Description |
|---|---|
The last value of the sequence. |
There are no comments yet