# Used to play sound, best suited for sounds effects in apps or games
class SoundPool
- private var nsoundpool: NativeSoundPool
+ private var nsoundpool: NativeSoundPool is noinit
# The maximum number of simultaneous streams for this SoundPool
var max_streams writable = 10
super Turnable[G]
type BUCKET: HashSet[Bucketable[G]]
- private var buckets: Array[BUCKET]
+ private var buckets: Array[BUCKET] is noinit
private var next_bucket: nullable BUCKET = null
private var current_bucket_key: Int = -1
# Top level of Curl
class Curl
- protected var prim_curl: CCurl
+ protected var prim_curl = new CCurl.easy_init
init
do
- self.prim_curl = new CCurl.easy_init
assert curlInstance:self.prim_curl.is_init else
print "Curl must be instancied to be used"
end
# The current state
# Used by generated parsers
- var state: LRState
+ var state: LRState is noinit
init
do
# The main method is `parse_http_request`.
class HttpRequestParser
# The current `HttpRequest` under construction
- private var http_request: HttpRequest
+ private var http_request: HttpRequest is noinit
# Untreated body
private var body = ""
class Session
# Hashed id used both client and server side to identify this `Session`
- var id_hash: String
+ var id_hash: String is noinit
init
do
# Union of interval for implementing perfect numbering
# Represents the interval of free identifiers
# A null value represents the upper bound of identifier
- private var interval: List[Couple[nullable Int, nullable Int]]
+ private var interval = new List[Couple[nullable Int, nullable Int]]
# An array used as a temporary Hashtable for
# checking there is no collision between identifiers
- private var tempht: Array[nullable Int]
+ private var tempht = new Array[nullable Int]
# Initialize the structure of free identifiers
init
do
# By default, all identifiers are available
- interval = new List[Couple[nullable Int, nullable Int]]
interval.push(new Couple[nullable Int, nullable Int](1, null))
- tempht = new Array[nullable Int]
end
# Returns a mask composed by discriminants bits
# Keeps track of real time
class Clock
# Time at instanciation
- protected var time_at_beginning : Timespec
+ protected var time_at_beginning = new Timespec.monotonic_now
# Time at last time a lapse method was called
- protected var time_at_last_lapse : Timespec
-
- init
- do
- time_at_beginning = new Timespec.monotonic_now
- time_at_last_lapse = new Timespec.monotonic_now
- end
+ protected var time_at_last_lapse = new Timespec.monotonic_now
# Smallest time frame reported by clock
fun resolution : Timespec `{
end
class SocketSet
- var sset: FFSocketSet
- init do sset = new FFSocketSet end
+ var sset = new FFSocketSet
fun set(s: Socket) do sset.set(s.socket) end
fun is_set(s: Socket): Bool do return sset.is_set(s.socket) end
fun zero do sset.zero end
end
# Internal storage.
- var _items: Array[Couple[K,E]]
+ var _items = new Array[Couple[K,E]]
# fast remove the ith element of the array
private fun remove_at_index(i: Int)
end
return -1
end
-
- # A new empty map.
- init
- do
- _items = new Array[Couple[K,E]]
- end
end
private class ArrayMapKeys[K: Object, E]
private var leaf_cache: nullable LeafCache = null
# Empty Rope
- init do from("")
+ init do root = new StringLeaf("".as(FlatString))
# Creates a new Rope with `s` as root
init from(s: String) do