vil_nitf2_tagged_record_definition defines a particular tagged record extension (TRE). More...
#include <vil_nitf2_tagged_record_definition.h>
Public Types | |
| typedef std::map< std::string, vil_nitf2_tagged_record_definition * > | tagged_record_definition_map |
Public Member Functions | |
| vil_nitf2_tagged_record_definition & | field (std::string field_name, std::string pretty_name, vil_nitf2_field_formatter *formatter, bool blanks_ok=false, vil_nitf2_field_functor< int > *width_functor=nullptr, vil_nitf2_field_functor< bool > *condition_functor=nullptr, std::string units="", std::string description="") |
| Define a field. Assumes ownership of pointer arguments. More... | |
| vil_nitf2_tagged_record_definition & | repeat (vil_nitf2_field_functor< int > *repeat_functor, vil_nitf2_field_definitions &field_definitions) |
| Define a repeat node. Assumes ownership of pointer argument. More... | |
| vil_nitf2_tagged_record_definition & | repeat (std::string int_tag, vil_nitf2_field_definitions &field_definitions) |
| Convenience overload where repeat count is simply the value of a tag. More... | |
| vil_nitf2_tagged_record_definition & | repeat (int repeat_count, vil_nitf2_field_definitions &field_definitions) |
| Convenience overload where repeat count is a fixed value. More... | |
| void | end () |
| Declares that definition is finished, preventing further invocations of field() or repeat(). More... | |
| vil_nitf2_field_definition * | find_field (std::string name) |
| Look up a field definition. More... | |
| ~vil_nitf2_tagged_record_definition () | |
| const vil_nitf2_field_definitions & | field_definitions () const |
| Return field definitions. More... | |
Static Public Member Functions | |
| static vil_nitf2_tagged_record_definition & | define (std::string name, std::string pretty_name) |
| Factory method. Assumes ownership of optional pointer argument. More... | |
| static vil_nitf2_tagged_record_definition * | find (const std::string &name) |
| Look up a record definition. More... | |
| static tagged_record_definition_map & | all_definitions () |
| All tagged record definitions. More... | |
| static bool | undefine (const std::string &name) |
| Undefines a TRE. Returns whether TRE with specified name was found. More... | |
| static void | register_test_tre () |
| Registers some TREs for testing. More... | |
Private Member Functions | |
| vil_nitf2_tagged_record_definition (const vil_nitf2_tagged_record_definition &) | |
| vil_nitf2_tagged_record_definition & | operator= (const vil_nitf2_tagged_record_definition &) |
| vil_nitf2_tagged_record_definition (std::string name, std::string pretty_name, vil_nitf2_field_definitions *defs=nullptr) | |
Private Attributes | |
| std::string | m_name |
| std::string | m_pretty_name |
| vil_nitf2_field_definitions * | m_field_definitions |
| bool | m_definition_completed |
Friends | |
| class | vil_nitf2_tagged_record |
vil_nitf2_tagged_record_definition defines a particular tagged record extension (TRE).
It consists of its name and an ordered list of vil_nitf2_field_definitions. It also defines a static method to look up a TRE definition by name.
The primary goal of this class design to provide a succinct way for the programmer to specify a NITF tagged record definition, which can be used for both reading and writing the record. The definition must support references to values of other fields in the record, which are needed to define conditional and repeating fields. Please see the example definition in method test().
Definition at line 35 of file vil_nitf2_tagged_record_definition.h.
| typedef std::map<std::string, vil_nitf2_tagged_record_definition*> vil_nitf2_tagged_record_definition::tagged_record_definition_map |
Definition at line 87 of file vil_nitf2_tagged_record_definition.h.
| vil_nitf2_tagged_record_definition::~vil_nitf2_tagged_record_definition | ( | ) |
Definition at line 114 of file vil_nitf2_tagged_record_definition.cxx.
|
private |
|
private |
Definition at line 34 of file vil_nitf2_tagged_record_definition.cxx.
|
static |
All tagged record definitions.
Definition at line 16 of file vil_nitf2_tagged_record_definition.cxx.
|
static |
Factory method. Assumes ownership of optional pointer argument.
Definition at line 43 of file vil_nitf2_tagged_record_definition.cxx.
| void vil_nitf2_tagged_record_definition::end | ( | ) |
Declares that definition is finished, preventing further invocations of field() or repeat().
Definition at line 102 of file vil_nitf2_tagged_record_definition.cxx.
| vil_nitf2_tagged_record_definition & vil_nitf2_tagged_record_definition::field | ( | std::string | field_name, |
| std::string | pretty_name, | ||
| vil_nitf2_field_formatter * | formatter, | ||
| bool | blanks_ok = false, |
||
| vil_nitf2_field_functor< int > * | width_functor = nullptr, |
||
| vil_nitf2_field_functor< bool > * | condition_functor = nullptr, |
||
| std::string | units = "", |
||
| std::string | description = "" |
||
| ) |
Define a field. Assumes ownership of pointer arguments.
Definition at line 66 of file vil_nitf2_tagged_record_definition.cxx.
|
inline |
Return field definitions.
Definition at line 92 of file vil_nitf2_tagged_record_definition.h.
|
static |
Look up a record definition.
Definition at line 107 of file vil_nitf2_tagged_record_definition.cxx.
| vil_nitf2_field_definition* vil_nitf2_tagged_record_definition::find_field | ( | std::string | name | ) |
Look up a field definition.
|
private |
|
static |
Registers some TREs for testing.
Definition at line 131 of file vil_nitf2_tagged_record_definition.cxx.
| vil_nitf2_tagged_record_definition & vil_nitf2_tagged_record_definition::repeat | ( | vil_nitf2_field_functor< int > * | repeat_functor, |
| vil_nitf2_field_definitions & | field_definitions | ||
| ) |
Define a repeat node. Assumes ownership of pointer argument.
Definition at line 88 of file vil_nitf2_tagged_record_definition.cxx.
| vil_nitf2_tagged_record_definition & vil_nitf2_tagged_record_definition::repeat | ( | std::string | int_tag, |
| vil_nitf2_field_definitions & | field_definitions | ||
| ) |
Convenience overload where repeat count is simply the value of a tag.
Definition at line 119 of file vil_nitf2_tagged_record_definition.cxx.
| vil_nitf2_tagged_record_definition & vil_nitf2_tagged_record_definition::repeat | ( | int | repeat_count, |
| vil_nitf2_field_definitions & | field_definitions | ||
| ) |
Convenience overload where repeat count is a fixed value.
Definition at line 125 of file vil_nitf2_tagged_record_definition.cxx.
|
static |
Undefines a TRE. Returns whether TRE with specified name was found.
Definition at line 55 of file vil_nitf2_tagged_record_definition.cxx.
|
friend |
Definition at line 37 of file vil_nitf2_tagged_record_definition.h.
|
private |
Definition at line 120 of file vil_nitf2_tagged_record_definition.h.
|
private |
Definition at line 119 of file vil_nitf2_tagged_record_definition.h.
|
private |
Definition at line 117 of file vil_nitf2_tagged_record_definition.h.
|
private |
Definition at line 118 of file vil_nitf2_tagged_record_definition.h.
1.8.15