diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2024-09-03 20:39:14 -0400 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2024-09-03 20:39:14 -0400 |
commit | f3896d37ca625a4f7060ee5139a8825c2f6e6a74 (patch) | |
tree | c10bce816c8e7834c1e485b6f71feccd48eb1906 /indra/llinventory/llsettingssky.cpp | |
parent | 517163c126f7c0620f506532d67d9097083728d9 (diff) |
Generalize Lua-side result-set machinery for other use cases.
Change `result_view()` from a simple function to a callable table so we can
add conventional/default functions to it: `result_view.fetch()` is a generic
`fetch()` function suitable for use with `result_view()`, and `result_view.close()`
is a variadic function that closes result sets for whichever keys are passed.
This arises from the fact that any `LL::ResultSet` subclass is accessed
generically through its base class, therefore we don't need distinct
"getSlice" and "closeResult" operations for different `LLEventAPI` listeners.
(It might make sense to relocate those operations to a new generic listener,
but for now "LLInventory" works.)
That lets `result_view()`'s caller omit the `fetch` parameter unless it
requires special behavior. Omitting it uses the generic `result_view.fetch()`
function.
Moreover, every view returned by `result_view()` now contains a close()
function that closes that view's result set.
The table returned by LLInventory.lua's `result()` function has a `close()`
method; that method can now call `result_view.close()` with the two keys of
interest. That table's `__index()` metamethod can now leverage `result_view()`'s
default `fetch` function.
Diffstat (limited to 'indra/llinventory/llsettingssky.cpp')
0 files changed, 0 insertions, 0 deletions