DVfld_match


Synopsis

detect the mesh type of a field


group DVfld_match {
Mesh+IPort2 ∈
int+OPort2 index=0;
group+write links {
link+OPort2 link0;
link+OPort2 link1;
link+OPort2 link2;
link+OPort2 link3;
};
method+notify_val upd_match = "fld_match";
};

Description

DVfld_match detects the mesh type of a field. It compares the mesh type of the input field &in against a list of links to specific mesh types. It then outputs the index of the matching mesh. This index is usually used as input to DVswitch, which uses it as an index into its array of base modules to find the correct base module to use.

Input

&in

A reference to a field containing any type of Mesh.

Output

link0
link1
link2
link3

Links to DVfld_match's matching choices. For example, DVcrop uses DVfld_match to discover the mesh type of its input in order to call the correct DVcrop_type base module. It defines these links as:

links {
link0 => DVcrop_unif.in;
link1 => DVcrop_rect.in;
link2 => DVcrop_struct.in;
};

index

An integer whose value is the index of the "match" in the links object. For example, if the input field to DVcrop is Mesh_Rect, index's value is 1.

Files

v/dv.v
modules/match.c

Example

Libraries.Main.Filters.downsize
Libraries.Main.Filters.crop
Libraries.Main.Mappers.slice

See also