Go to the documentation of this file.00001
00002
00003
00004
00005 #ifndef VIL_NITF2_DES_H
00006 #define VIL_NITF2_DES_H
00007
00008 class vil_nitf2_field_definitions;
00009 class vil_stream;
00010 #include "vil_nitf2_classification.h"
00011 #include "vil_nitf2_field_sequence.h"
00012
00013 #include <vcl_map.h>
00014
00015
00016
00017
00018
00019
00020
00021
00022 class vil_nitf2_des
00023 {
00024 public:
00025 vil_nitf2_des( vil_nitf2_classification::file_version version, int data_width );
00026
00027
00028 virtual bool read( vil_stream* stream );
00029
00030
00031 virtual ~vil_nitf2_des();
00032
00033
00034
00035 template< class T >
00036 bool get_property(vcl_string tag, T& out_value) const
00037 {
00038 if ( ! m_field_sequence1->get_value( tag, out_value ) && m_field_sequence2 ){
00039 return m_field_sequence2->get_value( tag, out_value );
00040 }
00041 }
00042
00043
00044
00045 template< class T >
00046 bool get_property(vcl_string tag, int i, T& out_value) const
00047 {
00048 if( ! m_field_sequence1->get_value( tag, i, out_value ) && m_field_sequence2 ){
00049 return m_field_sequence2->get_value( tag, i, out_value );
00050 }
00051 }
00052
00053
00054
00055 virtual vil_nitf2_field::field_tree* get_tree( int i = 0 ) const;
00056
00057
00058
00059 static vil_nitf2_field_definitions& define( vcl_string desId );
00060 protected:
00061 typedef vcl_map<vcl_string, vil_nitf2_field_definitions*>
00062 field_definition_map;
00063 static field_definition_map & all_definitions();
00064
00065 static void add_shared_field_defs_1( vil_nitf2_field_definitions* defs );
00066 static void add_shared_field_defs_2( vil_nitf2_field_definitions* defs, int data_width );
00067 static vil_nitf2_field_definitions* create_field_definitions( vil_nitf2_classification::file_version ver, int data_width);
00068
00069 vil_nitf2_field_sequence* m_field_sequence1;
00070 vil_nitf2_field_sequence* m_field_sequence2;
00071 };
00072
00073 #endif //VIL_NITF2_DES_H