Public Member Functions | Private Attributes | List of all members
vil_nitf2_field_value< T > Class Template Reference

Functor vil_nitf2_field_value defines a function that sets its out parameter to a value of a field from a field sequence. More...

#include <vil_nitf2_field_functor.h>

Inheritance diagram for vil_nitf2_field_value< T >:
Inheritance graph
[legend]

Public Member Functions

 vil_nitf2_field_value (std::string tag)
 
 vil_nitf2_field_value (std::string tag, std::map< T, T > overrideMap)
 
vil_nitf2_field_functor< T > * copy () const override
 
bool operator() (vil_nitf2_field_sequence *record, const vil_nitf2_index_vector &indexes, T &value) override
 

Private Attributes

std::string tag
 
std::map< T, T > overrides
 

Detailed Description

template<typename T>
class vil_nitf2_field_value< T >

Functor vil_nitf2_field_value defines a function that sets its out parameter to a value of a field from a field sequence.

The function returns whether the field was found. The functor is instantiated with the field's tag. The field sequence is passed to the function.

You can override any value by specifying an overrideMap. For example, if 0 was a special value that actually meant 1 but all other values (2, 3, 4...) actually meant when they were you could get that effect like this: std::map< int, int > overrides; overrides.insert( std::make_pair( 0, 1 ) ); new vil_nitf2_field_value( "FIELD_NAME", overrides );

Definition at line 75 of file vil_nitf2_field_functor.h.

Constructor & Destructor Documentation

◆ vil_nitf2_field_value() [1/2]

template<typename T >
vil_nitf2_field_value< T >::vil_nitf2_field_value ( std::string  tag)
inline

Definition at line 78 of file vil_nitf2_field_functor.h.

◆ vil_nitf2_field_value() [2/2]

template<typename T >
vil_nitf2_field_value< T >::vil_nitf2_field_value ( std::string  tag,
std::map< T, T >  overrideMap 
)
inline

Definition at line 80 of file vil_nitf2_field_functor.h.

Member Function Documentation

◆ copy()

template<typename T >
vil_nitf2_field_functor<T>* vil_nitf2_field_value< T >::copy ( ) const
inlineoverridevirtual

Implements vil_nitf2_field_functor< T >.

Definition at line 83 of file vil_nitf2_field_functor.h.

◆ operator()()

template<typename T >
bool vil_nitf2_field_value< T >::operator() ( vil_nitf2_field_sequence record,
const vil_nitf2_index_vector indexes,
T &  value 
)
inlineoverridevirtual

Implements vil_nitf2_field_functor< T >.

Definition at line 86 of file vil_nitf2_field_functor.h.

Member Data Documentation

◆ overrides

template<typename T >
std::map<T, T> vil_nitf2_field_value< T >::overrides
private

Definition at line 103 of file vil_nitf2_field_functor.h.

◆ tag

template<typename T >
std::string vil_nitf2_field_value< T >::tag
private

Definition at line 102 of file vil_nitf2_field_functor.h.


The documentation for this class was generated from the following file: