Back to Adaptive Vision Library website

You are here: Start » Function Reference » Conditional Processing » ChooseByPredicate

ChooseByPredicate


This is Filter Equivalent. This function may be present in generated code, but should not be used in hand-written code.

Returns one of the two input objects depending on the specified condition.

Syntax

void avl::ChooseByPredicate
(
	const Type& inObjectIfTrue,
	const Type& inObjectIfFalse,
	bool inCondition,
	Type& outObject
)

Parameters

Name Type Default Description
inObjectIfTrue const Type& Object to be chosen if the condition is met
inObjectIfFalse const Type& Object to be chosen if the condition is NOT met
inCondition bool Determines which object is to be chosen
outObject Type& Chosen object

Hints

  • Also consider the ternary operator ?: in Formula Blocks.

Examples

inObjectIfTrue = "Mike"
inObjectIfFalse = "Bill"
inCondition = False
outObject = "Bill"

Remarks

This filter can replace the following formula:

See Also