ScopeList class | query.t[923]

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

`status_ vec_`

Summary of Methods

`add addAll addOnly addSelfIlluminatingWithin addWithin close createIterator createLiveIterator find length subset toList`

Properties

`status_` | `query.t[1045]`

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_` | `query.t[1033]`

a vector with the objects in scope

Methods

`add (obj)` | `query.t[927]`

Add an object and its contents to the scope.

`addAll (lst)` | `query.t[957]`

Add all of the objects in the given list

`addOnly (obj)` | `query.t[985]`

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)` | `query.t[975]`

add each self-illuminating object in the interior contents

`addWithin (obj)` | `query.t[967]`

Add the interior contents of an object to the scope. This adds only the contents, not the object itself.

`close ( )` | `query.t[1005]`

"close" the scope list - this converts the vector to a list

`createIterator ( )` | `query.t[1027]`

create an iterator, for foreach()

`createLiveIterator ( )` | `query.t[1030]`

create a live iterator

`find (obj)` | `query.t[1018]`

is the given object in scope?

`length ( )` | `query.t[1012]`

get the number of items in scope

`subset (func)` | `query.t[1021]`

get the subset of the objects in scope matching the given condition

`toList ( )` | `query.t[1024]`

return the scope as a simple list of objects

Adv3Lite Library Reference Manual
Generated on 25/04/2024 from adv3Lite version 2.0