Macros
vil_nitf2_field_sequence.cxx File Reference
#include <utility>
#include "vil_nitf2_field_sequence.h"
#include "vil_nitf2_index_vector.h"
#include "vil_nitf2_field_formatter.h"
#include "vil_nitf2_field_definition.h"
#include "vil_nitf2_scalar_field.h"
#include "vil_nitf2_array_field.h"
#include "vil_nitf2_compound_field_value.h"

Go to the source code of this file.

Macros

#define NITF_FIELD_SEQ_GET_VALUE(T)
 
#define NITF_FIELD_SEQ_GET_ARRAY_VALUE(T)
 
#define NITF_FIELD_SEQ_GET_VALUES(T)
 

Macro Definition Documentation

◆ NITF_FIELD_SEQ_GET_ARRAY_VALUE

#define NITF_FIELD_SEQ_GET_ARRAY_VALUE (   T)
Value:
bool vil_nitf2_field_sequence::get_value(std::string tag, \
const vil_nitf2_index_vector& indexes, \
T& out_value, \
bool ignore_extra_indexes) const { \
vil_nitf2_field* field = get_field(tag); \
if (!field) { \
/*std::cerr << "vil_nitf2_field_sequence::get_value(" << tag << ", const vil_nitf2_index_vector&): tag not found.\n"; */\
return false; \
} \
vil_nitf2_index_vector trimmed_indexes(indexes); \
if (ignore_extra_indexes && (int)indexes.size() > field->num_dimensions()) { \
trimmed_indexes.resize(field->num_dimensions()); \
} \
if (trimmed_indexes.size()==0) { \
return field->scalar_field() && field->scalar_field()->value(out_value); \
} else { \
return field->array_field()->value(trimmed_indexes, out_value); \
} \
}
vil_nitf2_field * get_field(const std::string &tag) const
bool get_value(std::string tag, int &out_value) const

Definition at line 397 of file vil_nitf2_field_sequence.cxx.

◆ NITF_FIELD_SEQ_GET_VALUE

#define NITF_FIELD_SEQ_GET_VALUE (   T)
Value:
bool vil_nitf2_field_sequence::get_value(std::string tag, T& out_value) const { \
vil_nitf2_field* field = get_field(tag); \
vil_nitf2_scalar_field* scalar_field = field ? field->scalar_field() : 0; \
if (!scalar_field) { \
/*std::cerr << "vil_nitf2_field_sequence::get_value(" << tag << "): scalar field not found.\n";*/ \
return false; \
} \
if (!scalar_field->value(out_value)) { \
std::cerr << "vil_nitf2_field_sequence::get_value(" << tag << ") called with wrong type.\n"; \
return false; \
} \
return true; \
}
vil_nitf2_field * get_field(const std::string &tag) const
bool get_value(std::string tag, int &out_value) const

Definition at line 373 of file vil_nitf2_field_sequence.cxx.

◆ NITF_FIELD_SEQ_GET_VALUES

#define NITF_FIELD_SEQ_GET_VALUES (   T)