13 # include <vcl_msvc_warnings.h> 27 return dimension_bounds_entry->second;
37 std::cerr <<
"vil_nitf2_array_field::set_next_dimension" 38 << index <<
": invalid partial index!\n";
42 std::cerr <<
"vil_nitf2_array_field::set_next_dimension" 43 << index <<
": bound previously set!\n";
52 std::cerr <<
"index length does not match value dimensions!\n";
61 dimension_index.push_back(indexes[dim]);
64 int last_index = indexes[indexes.size()-1];
65 if (last_index < dimension_bound) {
68 std::cerr <<
"Tag " <<
tag() << indexes <<
": index out of bounds!\n";
82 std::string ret_val =
"";
83 for (
unsigned int i = 0 ; i < indices.size() ; i++ ){
96 buffer = (
char*)std::malloc( (std::size_t) num_to_read+1 );
97 str->read( (
void*)buffer, num_to_read );
98 buffer[(std::size_t) num_to_read] = 0;
99 return std::string( buffer );
106 for (
int i = 0 ; i < dim ; i++ )
110 curr_indices.push_back( i );
113 std::string tag_str =
tag();
118 tr->columns.push_back( tag_str + index_str );
119 tr->columns.push_back( p_name );
virtual field_tree * get_tree() const
int next_dimension(const vil_nitf2_index_vector &indexes) const
Given a partial index vector, return value of next dimension (or zero if none).
void do_dimension(const vil_nitf2_index_vector &index, vil_nitf2_field::field_tree *tr) const
vil_nitf2: Written by Harry Voorhees (hlv@) and Rob Radtke (rob@) of Stellar Science Ltd.
std::string int_to_string(int i)
bool check_index(const vil_nitf2_index_vector &indexes) const
Compares index vector against value dimensions.
An in-core vil_stream implementation.
virtual bool write_vector_element(vil_nitf2_ostream &output, const vil_nitf2_index_vector &indexes, int variable_width) const =0
Writes to output stream the scalar value at specified index.
std::vector< field_tree * > children
std::string get_value_string(const vil_nitf2_index_vector &in_indices) const
std::string pretty_name() const
void set_next_dimension(const vil_nitf2_index_vector &indexes, int bound)
Given a partial index vector, set the value of the next dimension.
std::string index_string(const vil_nitf2_index_vector &indices)
field_tree * get_tree() const override
int m_num_dimensions
Dimensionality of vector field.
An in-core vil_stream implementation.
int num_dimensions() const override
Number of dimensions.
std::map< vil_nitf2_index_vector, int > m_dimensions_map
Because a repeating field's dimension can depend on the value of another repeating field,...