Main Content

hasNext

Class: systemcomposer.rptgen.finder.ViewFinder
Namespace: systemcomposer.rptgen.finder

Determine if view search result queue is nonempty

Since R2022b

Syntax

nonempty = hasNext(finder)

Description

nonempty = hasNext(finder) determines whether the View search result queue is nonempty.

Input Arguments

expand all

View finder, specified as a systemcomposer.rptgen.finder.ViewFinder object.

Output Arguments

expand all

Whether queue is nonempty, returned as 1 (true) or 0 (false).

Data Types: logical

Examples

expand all

Use the ViewFinder and ViewResult classes to generate a report.

import mlreportgen.report.*
import slreportgen.report.*
import systemcomposer.rptgen.finder.*

scKeylessEntrySystem
model_name = "KeylessEntryArchitecture";
model = systemcomposer.loadModel(model_name);
rpt = slreportgen.report.Report(output="ViewFinderReport",...
CompileModelBeforeReporting=false);
add(rpt,TitlePage("Title",sprintf('Views in %s Model',model_name)));
add(rpt,TableOfContents);

viewFinder = ViewFinder(model_name);

chapter = Chapter("Title","Views");
while hasNext(viewFinder)
    view = next(viewFinder);
    sect = Section("Title",view.Name);
    add(sect,view);
    add(chapter,sect);
end

add(rpt,chapter);
close(rpt);
rptview(rpt);

Version History

Introduced in R2022b