Bounded worker cursor for exact, case-sensitive literal search without normalization. Search starts at the real source origin so grapheme boundaries are proven. Query, KMP/scalar maps, scratch and selected results use source->budget(). Sources must be seekable; unsupported streams return UNSUPPORTED explicitly. Operations serialize on this session, but start/advance belong on workers: they may wait for another operation, and advance performs source I/O. No UI reference or callback is retained. Cancellation preserves consistent accepted input; a later advance can resume when the query/request/revision is unchanged. A revision change fails instead of mixing matches from different generations. The byte quantum limits logical source admissions/processing; an underlying provider's cold replay or blocking I/O can still occupy its worker longer. Capacity failures preserve exact budgetDemand; budgetPeak includes retained session/page storage plus the failed operation, excluding source/provider pins and other callers' retained matches. These are capacities, not process RSS.
More...
#include <document_search.hpp>
Bounded worker cursor for exact, case-sensitive literal search without normalization. Search starts at the real source origin so grapheme boundaries are proven. Query, KMP/scalar maps, scratch and selected results use source->budget(). Sources must be seekable; unsupported streams return UNSUPPORTED explicitly. Operations serialize on this session, but start/advance belong on workers: they may wait for another operation, and advance performs source I/O. No UI reference or callback is retained. Cancellation preserves consistent accepted input; a later advance can resume when the query/request/revision is unchanged. A revision change fails instead of mixing matches from different generations. The byte quantum limits logical source admissions/processing; an underlying provider's cold replay or blocking I/O can still occupy its worker longer. Capacity failures preserve exact budgetDemand; budgetPeak includes retained session/page storage plus the failed operation, excluding source/provider pins and other callers' retained matches. These are capacities, not process RSS.
◆ advance()
- Parameters
-
| stop | Cooperative cancellation before/after reads and during bounded processing. |
- Returns
- PENDING, FOUND or END with owning progress, or an exact source/decoder/admission cause. NEXT continues after FOUND and includes overlaps. PREVIOUS rescans only the needed prefix, retains the last eligible match, and is terminal after FOUND.
◆ create()
- Parameters
-
| source | Retained logical byte source with an existing accounting root. |
| utf8Query | Nonempty valid UTF-8 literal; matching never folds case or normalizes. |
| decoderOptions | Original source encoding/error policy; UTF-8 hint is the default. |
| options | Bounded query, worker and result capacities. |
- Returns
- Cold session with initial NEXT-from-zero request, or typed validation/admission failure. Creation performs no source metadata/read I/O and may run on a worker.
◆ retainedUsage()
- Returns
- Retained session/page capacities, excluding independent matches and source/provider pins. Allocation-free and lock-free. The caller must serialize this worker-only observation with start/advance; concurrent UI reads are not supported.
◆ start()
- Parameters
-
| direction | NEXT or PREVIOUS; wrapping is not performed by the kernel. |
| anchorByte | NEXT accepts starts >= anchor; PREVIOUS accepts starts < anchor. |
- Returns
- Success after resetting a request, or typed validation failure. Both directions restart from the real origin. Consecutive NEXT after FOUND should call advance directly to preserve the streaming overlap/KMP state. A new request also clears the previous revision qualification.
The documentation for this class was generated from the following file: