Cleaner<T> class

Stores objects that need cleanup and then cleans them when cleanup is called.

Constructors

Cleaner(void cleaner(T), {Set<T>? inUse})
The cleaner you pass in will be called on all the objects you want cleaned when cleanup is called. The optional inUse parameter can be used to specify the starting objects that need to be cleaned up.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

add(T inUse) bool
Stores an object in the set of objects that need cleanup. The object will then be cleaned with _cleaner when cleanup is called. Returns true if the object wasn't in the set yet and vice versa.
cleanup() → void
Calls _cleaner on all the stored objects.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
remove(T unused) bool
Removes an object from the set of objects that need cleanup. Returns true if the object was in the set and vice versa.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited