ERC CISST - cisst software

vctFixedSizeVectorRecursiveEngines< _size >::Find< _conditionOperationType, _currentIndex > Class Template Reference

#include <vctFixedSizeVectorRecursiveEngines.h>

List of all members.


Detailed Description

template<vct::size_type _size>
template<class _conditionOperationType, vct::index_type _currentIndex>
class vctFixedSizeVectorRecursiveEngines< _size >::Find< _conditionOperationType, _currentIndex >

The Find engine returns the first index in which a condition evaluates to 'true'. The index is returned as an unsigned integer. The condition is evaluated between each element of the input vector and the input scalar, in the form _conditionOperationType::Operate(inputVector[index], inputScalar). That is, the static method Operate is a binary predicate.

The Find engine uses an auxiliary template argument _currentIndex which is incremented as the recursion nesting increases. We need it so that we don't have to evaluate the function again to return the index.

If the condition never evaluates to true, the function returns a value one past the length of the vector (_size).

A typical example assigned _conditionOperation with an equality test, searching for the first occurence of a value in the vector.

Definition at line 887 of file vctFixedSizeVectorRecursiveEngines.h.

Public Types

Static Public Member Functions


The documentation for this class was generated from the following file:
erc-cisst-devel<at>lists.johnshopkins.edu