Main Content

hasNext

Class: systemcomposer.rptgen.finder.InterfaceFinder
Namespace: systemcomposer.rptgen.finder

Determine if interface search result queue is nonempty

Since R2022b

Syntax

nonempty = hasNext(finder)

Description

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

Input Arguments

expand all

Interface finder, specified as a systemcomposer.rptgen.finder.InterfaceFinder object.

Output Arguments

expand all

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

Data Types: logical

Examples

expand all

Use the InterfaceFinder and InterfaceResult classes to generate a report.

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

scExampleSmallUAV
model_name = "scExampleSmallUAVModel";
model = systemcomposer.loadModel(model_name);
rpt = slreportgen.report.Report(output="InterfaceFinderReport",...
CompileModelBeforeReporting=false);
add(rpt,TitlePage("Title",sprintf('Interfaces in %s Model',model_name)));
add(rpt,TableOfContents);
 
intfFinder = InterfaceFinder(model_name);

chapter = Chapter("Title","Interfaces");
while hasNext(intfFinder)
    interface = next(intfFinder);
    sect = Section("Title",interface.InterfaceName);
    add(sect,interface);
    add(chapter,sect);
end
 
add(rpt,chapter);
close(rpt);
rptview(rpt);

Version History

Introduced in R2022b