Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
vil_nitf2_tagged_record_definition Class Reference

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_definitionfield (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_definitionrepeat (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_definitionrepeat (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_definitionrepeat (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_definitionfind_field (std::string name)
 Look up a field definition. More...
 
 ~vil_nitf2_tagged_record_definition ()
 
const vil_nitf2_field_definitionsfield_definitions () const
 Return field definitions. More...
 

Static Public Member Functions

static vil_nitf2_tagged_record_definitiondefine (std::string name, std::string pretty_name)
 Factory method. Assumes ownership of optional pointer argument. More...
 
static vil_nitf2_tagged_record_definitionfind (const std::string &name)
 Look up a record definition. More...
 
static tagged_record_definition_mapall_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_definitionoperator= (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_definitionsm_field_definitions
 
bool m_definition_completed
 

Friends

class vil_nitf2_tagged_record
 

Detailed Description

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.

Member Typedef Documentation

◆ tagged_record_definition_map

Definition at line 87 of file vil_nitf2_tagged_record_definition.h.

Constructor & Destructor Documentation

◆ ~vil_nitf2_tagged_record_definition()

vil_nitf2_tagged_record_definition::~vil_nitf2_tagged_record_definition ( )

Definition at line 114 of file vil_nitf2_tagged_record_definition.cxx.

◆ vil_nitf2_tagged_record_definition() [1/2]

vil_nitf2_tagged_record_definition::vil_nitf2_tagged_record_definition ( const vil_nitf2_tagged_record_definition )
private

◆ vil_nitf2_tagged_record_definition() [2/2]

vil_nitf2_tagged_record_definition::vil_nitf2_tagged_record_definition ( std::string  name,
std::string  pretty_name,
vil_nitf2_field_definitions defs = nullptr 
)
private

Definition at line 34 of file vil_nitf2_tagged_record_definition.cxx.

Member Function Documentation

◆ all_definitions()

vil_nitf2_tagged_record_definition::tagged_record_definition_map & vil_nitf2_tagged_record_definition::all_definitions ( )
static

All tagged record definitions.

Definition at line 16 of file vil_nitf2_tagged_record_definition.cxx.

◆ define()

vil_nitf2_tagged_record_definition & vil_nitf2_tagged_record_definition::define ( std::string  name,
std::string  pretty_name 
)
static

Factory method. Assumes ownership of optional pointer argument.

Definition at line 43 of file vil_nitf2_tagged_record_definition.cxx.

◆ end()

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.

◆ field()

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.

◆ field_definitions()

const vil_nitf2_field_definitions& vil_nitf2_tagged_record_definition::field_definitions ( ) const
inline

Return field definitions.

Definition at line 92 of file vil_nitf2_tagged_record_definition.h.

◆ find()

vil_nitf2_tagged_record_definition * vil_nitf2_tagged_record_definition::find ( const std::string &  name)
static

Look up a record definition.

Definition at line 107 of file vil_nitf2_tagged_record_definition.cxx.

◆ find_field()

vil_nitf2_field_definition* vil_nitf2_tagged_record_definition::find_field ( std::string  name)

Look up a field definition.

◆ operator=()

vil_nitf2_tagged_record_definition& vil_nitf2_tagged_record_definition::operator= ( const vil_nitf2_tagged_record_definition )
private

◆ register_test_tre()

void vil_nitf2_tagged_record_definition::register_test_tre ( )
static

Registers some TREs for testing.

Definition at line 131 of file vil_nitf2_tagged_record_definition.cxx.

◆ repeat() [1/3]

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.

◆ repeat() [2/3]

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.

◆ repeat() [3/3]

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.

◆ undefine()

bool vil_nitf2_tagged_record_definition::undefine ( const std::string &  name)
static

Undefines a TRE. Returns whether TRE with specified name was found.

Definition at line 55 of file vil_nitf2_tagged_record_definition.cxx.

Friends And Related Function Documentation

◆ vil_nitf2_tagged_record

friend class vil_nitf2_tagged_record
friend

Definition at line 37 of file vil_nitf2_tagged_record_definition.h.

Member Data Documentation

◆ m_definition_completed

bool vil_nitf2_tagged_record_definition::m_definition_completed
private

Definition at line 120 of file vil_nitf2_tagged_record_definition.h.

◆ m_field_definitions

vil_nitf2_field_definitions* vil_nitf2_tagged_record_definition::m_field_definitions
private

Definition at line 119 of file vil_nitf2_tagged_record_definition.h.

◆ m_name

std::string vil_nitf2_tagged_record_definition::m_name
private

Definition at line 117 of file vil_nitf2_tagged_record_definition.h.

◆ m_pretty_name

std::string vil_nitf2_tagged_record_definition::m_pretty_name
private

Definition at line 118 of file vil_nitf2_tagged_record_definition.h.


The documentation for this class was generated from the following files: