ScopeListclass
A ScopeList is a helper object used to build the list of objects in scope. This object provides methods for the common ways of adding objects to scope.
The ScopeList isn’t a true Collection object, but it mimics one by providing most of the standard methods. You can use length() and the [] operator to scan the list, perform a foreach or for..in loop with a ScopeList to iterate over the items in scope, you can use find() to check if a given object is in scope, and you can use subset() to get a list of in-scope objects satisfying some condition.
class
ScopeList
: object
Superclass Tree (in declaration order)
ScopeList
` object`
Subclass Tree
(none)
Global Objects
(none)
Summary of Properties
Summary of Methods
add
addAll
addOnly
addSelfIlluminatingWithin
addWithin
close
createIterator
createLiveIterator
find
length
subset
toList
Properties
status_
A LookupTable with the objects already added to the list. We use this to avoid redundantly scanning containment trees for objects that we’ve already added. For each object, we set status_[obj] to a status indicator:
nil (unset) - the object has never been visited
1 - we’ve added the object only, not its contents
2 - we’ve added the object and its contents
vec_
a vector with the objects in scope
Methods
add (obj)
Add an object and its contents to the scope.
addAll (lst)
Add all of the objects in the given list
addOnly (obj)
Add a single object to the scope. This doesn’t add anything related to the object (such as its contents) - just the object itself.
addSelfIlluminatingWithin (obj)
add each self-illuminating object in the interior contents
addWithin (obj)
Add the interior contents of an object to the scope. This adds only the contents, not the object itself.
close ( )
“close” the scope list - this converts the vector to a list
createIterator ( )
create an iterator, for foreach()
createLiveIterator ( )
create a live iterator
find (obj)
is the given object in scope?
length ( )
get the number of items in scope
subset (func)
get the subset of the objects in scope matching the given condition
toList ( )
return the scope as a simple list of objects
Adv3Lite Library Reference Manual
Generated on 15/03/2023 from adv3Lite version 1.6.1