11 # include <vcl_msvc_warnings.h> 21 ~tagged_record_definition_map_t()
23 for (
auto & it : *
this) {
29 static tagged_record_definition_map_t tagged_record_definitions;
30 return tagged_record_definitions;
36 : m_name(std::move(name)),
37 m_pretty_name(std::move(pretty_name)),
39 m_definition_completed(false)
44 std::string name, std::string pretty_name)
49 throw(
"vil_nitf2_tagged_record_definition already defined.");
61 delete definition->second;
68 std::string pretty_name,
74 std::string description)
77 std::cerr <<
"vil_nitf2_tagged_record_definition:field() failed; definition already complete.";
80 std::move(tag), std::move(pretty_name), formatter, blanks_ok,
81 width_functor, condition_functor, std::move(units), std::move(description));
92 std::cerr <<
"vil_nitf2_tagged_record_definition:repeat() failed; definition already complete.";
111 return definition->second;
133 define(
"PIAIMB",
"Profile for Imagery Archives Image" )
139 .
field(
"COMGEN",
"Compression Generation",
NITF_INT(2),
true)
Functor vil_nitf2_field_value defines a function that sets its out parameter to a value of a field fr...
std::map< std::string, vil_nitf2_tagged_record_definition * > tagged_record_definition_map
static void register_test_tre()
Registers some TREs for testing.
void end()
Declares that definition is finished, preventing further invocations of field() or repeat().
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.
vil_nitf2_tagged_record_definition(const vil_nitf2_tagged_record_definition &)
~vil_nitf2_tagged_record_definition()
static vil_nitf2_tagged_record_definition & define(std::string name, std::string pretty_name)
Factory method. Assumes ownership of optional pointer argument.
bool m_definition_completed
const vil_nitf2_field_definitions & field_definitions() const
Return field definitions.
vil_nitf2: Written by Harry Voorhees (hlv@) and Rob Radtke (rob@) of Stellar Science Ltd.
vil_nitf2_tagged_record_definition defines a particular tagged record extension (TRE).
static tagged_record_definition_map & all_definitions()
All tagged record definitions.
static bool undefine(const std::string &name)
Undefines a TRE. Returns whether TRE with specified name was found.
static vil_nitf2_tagged_record_definition * find(const std::string &name)
Look up a 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.
vil_nitf2_field_definitions * m_field_definitions