Main Content

hasNext

Class: systemcomposer.rptgen.finder.AllocationListFinder
Namespace: systemcomposer.rptgen.finder

Determine if allocation list search result queue is nonempty

Since R2022b

Syntax

nonempty = hasNext(finder)

Description

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

Input Arguments

expand all

Allocation list finder, specified as a systemcomposer.rptgen.finder.AllocationListFinder object.

Output Arguments

expand all

Whether queue is nonempty, returned as a logical.

Data Types: logical

Examples

expand all

Use the AllocationListFinder and AllocationListResult classes to generate a report.

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

rpt = slreportgen.report.Report(output="AllocationListFinderReport",...
CompileModelBeforeReporting=false);
add(rpt,TitlePage("Title","Allocations"));
add(rpt,TableOfContents);

allocationListFinder = AllocationListFinder("AllocationSet.mldatx");
allocationListFinder.ComponentName = "mTestModel/Component1";
chapter = Chapter("Title","Allocations");
while hasNext(allocationListFinder)
    allocations = next(allocationListFinder);
    sect = Section("Title",allocationListFinder.ComponentName);
    add(sect,allocations);
    add(chapter,sect);
end

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

Version History

Introduced in R2022b