Back to Adaptive Vision Library website
You are here: Start » Function Reference » Conditional Processing » 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
- ChooseByCase – Returns one of the input objects depending on the specified case index.
- ChooseByRange – Returns one of the three input objects depending on whether the associated input value falls below, in or above the specified range.