Nitf::Header Class Reference

The Header class contains all knowledge needed to succesfully import or export a given NITF header. More...

#include <NitfHeader.h>

Inheritance diagram for Nitf::Header:

Inheritance graph

List of all members.

Public Member Functions

virtual ~Header ()
bool importMetadata (const ossimPropertyInterface *pProperties, RasterDataDescriptor *pDescriptor, DynamicObject *pDynObj)
bool exportMetadata (const RasterDataDescriptor *pDescriptor, ossimContainerProperty *pExportHeader)

Protected Types

typedef bool(* ImportFunction )(const ossimPropertyInterface *pProperties, RasterDataDescriptor *pDescriptor, DynamicObject *pDynObj, const std::string &appName, const std::string &ossimName)
typedef bool(* ExportFunction )(const RasterDataDescriptor *pDescriptor, const DataVariant &prop, ossimContainerProperty *pProperties, const std::string &appName, const std::string &ossimName)

Protected Member Functions

 Header (const std::string &fileVersion)
virtual std::string getMetadataPath () const =0
virtual FactoryResource
< DynamicObject
createDefaultsDynamicObject (const RasterDataDescriptor *pDescriptor)=0
bool exportMetadata (const RasterDataDescriptor *pDescriptor, const DynamicObject *pDynObj, ossimContainerProperty *pProperties)

Static Protected Member Functions

template<typename T>
static bool importMetadataValue (const ossimPropertyInterface *pPropertyInterface, RasterDataDescriptor *pDescriptor, DynamicObject *pDynObj, const std::string &appName, const std::string &ossimName)
template<typename T>
static bool exportMetadataValue (const RasterDataDescriptor *pDescriptor, const DataVariant &prop, ossimContainerProperty *pProperties, const std::string &appName, const std::string &ossimName)
static bool importBinaryData (const ossimPropertyInterface *pPropertyInterface, RasterDataDescriptor *pDescriptor, DynamicObject *pDynObj, const std::string &appName, const std::string &ossimName)
static bool exportBinaryData (const RasterDataDescriptor *pDescriptor, const DataVariant &prop, ossimContainerProperty *pProperties, const std::string &appName, const std::string &ossimName)
static bool importColor (const ossimPropertyInterface *pPropertyInterface, RasterDataDescriptor *pDescriptor, DynamicObject *pDynObj, const std::string &appName, const std::string &ossimName)
static bool exportColor (const RasterDataDescriptor *pDescriptor, const DataVariant &prop, ossimContainerProperty *pProperties, const std::string &appName, const std::string &ossimName)
static bool importDateCCYYMMDDhhmmss (const ossimPropertyInterface *pPropertyInterface, RasterDataDescriptor *pDescriptor, DynamicObject *pDynObj, const std::string &appName, const std::string &ossimName)
static bool exportDateCCYYMMDDhhmmss (const RasterDataDescriptor *pDescriptor, const DataVariant &prop, ossimContainerProperty *pProperties, const std::string &appName, const std::string &ossimName)
static bool importDateCCYYMMDD (const ossimPropertyInterface *pPropertyInterface, RasterDataDescriptor *pDescriptor, DynamicObject *pDynObj, const std::string &appName, const std::string &ossimName)
static bool exportDateCCYYMMDD (const RasterDataDescriptor *pDescriptor, const DataVariant &prop, ossimContainerProperty *pProperties, const std::string &appName, const std::string &ossimName)
static bool importDateDDHHMMSSZMONYY (const ossimPropertyInterface *pPropertyInterface, RasterDataDescriptor *pDescriptor, DynamicObject *pDynObj, const std::string &appName, const std::string &ossimName)
static bool importDateYYMMDD (const ossimPropertyInterface *pPropertyInterface, RasterDataDescriptor *pDescriptor, DynamicObject *pDynObj, const string &appName, const string &ossimName)

Protected Attributes

std::vector< ElementmElements
const std::string mFileVersion

Classes

struct  Element
 An Element contains all information needed to import and export a piece of metadata. More...


Detailed Description

The Header class contains all knowledge needed to succesfully import or export a given NITF header.

To be useful, this class must be subclassed to provide behavior for a specific header or subheader. Subclass behavior must include a public import method, which calls the protected one on this class.

When importing or exporting, the Header iterates over the contents of Header::mElements, calling the appropriate functions to import/export.

Definition at line 45 of file NitfHeader.h.


Member Typedef Documentation

typedef bool(* Nitf::Header::ImportFunction)(const ossimPropertyInterface *pProperties, RasterDataDescriptor *pDescriptor, DynamicObject *pDynObj, const std::string &appName, const std::string &ossimName) [protected]

Typedef for function pointer to use to import a specific piece of metadata.

Write functions which follow this typedef to add custom behavior for import. See importMetadataValue for an example.

typedef bool(* Nitf::Header::ExportFunction)(const RasterDataDescriptor *pDescriptor, const DataVariant &prop, ossimContainerProperty *pProperties, const std::string &appName, const std::string &ossimName) [protected]

Typedef for function pointer to use to export a specific piece of metadata.

Write functions which follow this typedef to add custom behavior for import. See exportMetadataValue for an example.


Constructor & Destructor Documentation

virtual Nitf::Header::~Header (  )  [virtual]

Destructs the object.

Nitf::Header::Header ( const std::string &  fileVersion  )  [protected]

Construct a Header with a given name.

Parameters:
fileVersion The version of this NITF file.


Member Function Documentation

bool Nitf::Header::importMetadata ( const ossimPropertyInterface *  pProperties,
RasterDataDescriptor pDescriptor,
DynamicObject pDynObj 
)

Import the metadata from OSSIM into a given DynamicObject.

Subclasses must provide a public import method, which eventually calls this one.

Imports according to the specification in Header::mElements.

Parameters:
pProperties The header to import from.
pDescriptor The Descriptor to import to.
pDynObj The DynamicObject to import according to the specification.
Returns:
True if the operation succeeded, false otherwise.

bool Nitf::Header::exportMetadata ( const RasterDataDescriptor pDescriptor,
ossimContainerProperty *  pExportHeader 
)

Export all metadata from the given descriptor to the export header.

This is performed by exporting two DynamicObjects. First, the DynamicObject created by createDefaultsDynamicObject is exported. This should contain any defaults to be exported. This is most useful if the RasterElement wasn't originally a NITF file.

Second, the DynamicObject for this header from the DataDescriptor's metadata object is exported. This should contain metadata as imported from a NITF.

Parameters:
pDescriptor The descriptor to export.
pExportHeader The OSSIM header to export to.
Returns:
True if the operation was successful, false otherwise.

virtual std::string Nitf::Header::getMetadataPath (  )  const [protected, pure virtual]

Returns the metadata location.

Returns:
The name to place and retrieve the main metadata DynamicObject for this header.

Implemented in Nitf::DesSubheader, Nitf::FileHeader, and Nitf::ImageSubheader.

virtual FactoryResource<DynamicObject> Nitf::Header::createDefaultsDynamicObject ( const RasterDataDescriptor pDescriptor  )  [protected, pure virtual]

Create defaults to export from the given DataDescriptor.

Parameters:
pDescriptor Descriptor which will be exported. May be needed to create defaults.
Returns:
The defaults DynamicObject, wrapped in a FactoryResource to prevent leaks.

Implemented in Nitf::DesSubheader, Nitf::FileHeader, and Nitf::ImageSubheader.

bool Nitf::Header::exportMetadata ( const RasterDataDescriptor pDescriptor,
const DynamicObject pDynObj,
ossimContainerProperty *  pProperties 
) [protected]

Exports a provided DynamicObject according to the specification in Header::mElements.

Parameters:
pDescriptor The Descriptor to export
pDynObj The DynamicObject to export from.
pProperties The OSSIM header to export to.
Returns:
True if the operation succeeded, false otherwise.

template<typename T>
static bool Nitf::Header::importMetadataValue ( const ossimPropertyInterface *  pPropertyInterface,
RasterDataDescriptor pDescriptor,
DynamicObject pDynObj,
const std::string &  appName,
const std::string &  ossimName 
) [static, protected]

Generic function to import most metadata.

This function is templated on type to import to the DynamicObject.

Parameters:
pPropertyInterface OSSIM property interface to import from.
pDescriptor Descriptor to import to.
pDynObj DynamicObject to import to.
appName The name which is used internally.
ossimName The name which OSSIM uses to access the property.
Returns:
True if the metadata was successfully imported, false otherwise.

Definition at line 181 of file NitfHeader.h.

template<typename T>
static bool Nitf::Header::exportMetadataValue ( const RasterDataDescriptor pDescriptor,
const DataVariant prop,
ossimContainerProperty *  pProperties,
const std::string &  appName,
const std::string &  ossimName 
) [static, protected]

Generic function to export most metadata.

This function is templated on type stored in the DynamicObject.

Parameters:
pDescriptor Descriptor to export from.
prop DataVariant with stored metadata.
pProperties ossimContainerProperty to export the metadata to.
appName The name which is used internally.
ossimName The name which OSSIM uses to access the property.
Returns:
True if the metadata was successfully exported, false otherwise.

Definition at line 227 of file NitfHeader.h.

static bool Nitf::Header::importBinaryData ( const ossimPropertyInterface *  pPropertyInterface,
RasterDataDescriptor pDescriptor,
DynamicObject pDynObj,
const std::string &  appName,
const std::string &  ossimName 
) [static, protected]

Import an ossimBinaryDataProperty object as a vector<unsigned char>.

Parameters:
pPropertyInterface OSSIM property interface to import from.
pDescriptor Descriptor to import to.
pDynObj DynamicObject to import to.
appName The name which is used internally.
ossimName The name which OSSIM uses to access the property.
Returns:
True if the metadata was successfully imported, false otherwise.

static bool Nitf::Header::exportBinaryData ( const RasterDataDescriptor pDescriptor,
const DataVariant prop,
ossimContainerProperty *  pProperties,
const std::string &  appName,
const std::string &  ossimName 
) [static, protected]

Export vector<unsigned char> to an ossimBinaryDataProperty object.

Parameters:
pDescriptor Descriptor to export from.
prop DataVariant with stored metadata.
pProperties ossimContainerProperty to export the metadata to.
appName The name which is used internally.
ossimName The name which OSSIM uses to access the property.
Returns:
True if the metadata was successfully exported, false otherwise.

static bool Nitf::Header::importColor ( const ossimPropertyInterface *  pPropertyInterface,
RasterDataDescriptor pDescriptor,
DynamicObject pDynObj,
const std::string &  appName,
const std::string &  ossimName 
) [static, protected]

Import ossimColorProperty objects as ColorType objects.

Parameters:
pPropertyInterface OSSIM property interface to import from.
pDescriptor Descriptor to import to.
pDynObj DynamicObject to import to.
appName The name which is used internally.
ossimName The name which OSSIM uses to access the property.
Returns:
True if the metadata was successfully imported, false otherwise.

static bool Nitf::Header::exportColor ( const RasterDataDescriptor pDescriptor,
const DataVariant prop,
ossimContainerProperty *  pProperties,
const std::string &  appName,
const std::string &  ossimName 
) [static, protected]

Export ColorType objects to ossimColorProperty objects.

Parameters:
pDescriptor Descriptor to export from.
prop DataVariant with stored metadata.
pProperties ossimContainerProperty to export the metadata to.
appName The name which is used internally.
ossimName The name which OSSIM uses to access the property.
Returns:
True if the metadata was successfully exported, false otherwise.

static bool Nitf::Header::importDateCCYYMMDDhhmmss ( const ossimPropertyInterface *  pPropertyInterface,
RasterDataDescriptor pDescriptor,
DynamicObject pDynObj,
const std::string &  appName,
const std::string &  ossimName 
) [static, protected]

Import dates stored in CCYYMMDDhhmmss format.

Parameters:
pPropertyInterface OSSIM property interface to import from.
pDescriptor Descriptor to import to.
pDynObj DynamicObject to import to.
appName The name which is used internally.
ossimName The name which OSSIM uses to access the property.
Returns:
True if the metadata was successfully imported, false otherwise.

static bool Nitf::Header::exportDateCCYYMMDDhhmmss ( const RasterDataDescriptor pDescriptor,
const DataVariant prop,
ossimContainerProperty *  pProperties,
const std::string &  appName,
const std::string &  ossimName 
) [static, protected]

Export dates stored in CCYYMMDDhhmmss format.

Parameters:
pDescriptor Descriptor to export from.
prop DataVariant with stored metadata.
pProperties ossimContainerProperty to export the metadata to.
appName The name which is used internally.
ossimName The name which OSSIM uses to access the property.
Returns:
True if the metadata was successfully exported, false otherwise.

static bool Nitf::Header::importDateCCYYMMDD ( const ossimPropertyInterface *  pPropertyInterface,
RasterDataDescriptor pDescriptor,
DynamicObject pDynObj,
const std::string &  appName,
const std::string &  ossimName 
) [static, protected]

Import dates stored in CCYYMMDD format.

Parameters:
pPropertyInterface OSSIM property interface to import from.
pDescriptor Descriptor to import to.
pDynObj DynamicObject to import to.
appName The name which is used internally.
ossimName The name which OSSIM uses to access the property.
Returns:
True if the metadata was successfully imported, false otherwise.

static bool Nitf::Header::exportDateCCYYMMDD ( const RasterDataDescriptor pDescriptor,
const DataVariant prop,
ossimContainerProperty *  pProperties,
const std::string &  appName,
const std::string &  ossimName 
) [static, protected]

Export dates stored in CCYYMMDD format.

Parameters:
pDescriptor Descriptor to export from.
prop DataVariant with stored metadata.
pProperties ossimContainerProperty to export the metadata to.
appName The name which is used internally.
ossimName The name which OSSIM uses to access the property.
Returns:
True if the metadata was successfully exported, false otherwise.

static bool Nitf::Header::importDateDDHHMMSSZMONYY ( const ossimPropertyInterface *  pPropertyInterface,
RasterDataDescriptor pDescriptor,
DynamicObject pDynObj,
const std::string &  appName,
const std::string &  ossimName 
) [static, protected]

Import dates stored in DDHHMMSSZMONYY format.

Parameters:
pPropertyInterface OSSIM property interface to import from.
pDescriptor Descriptor to import to.
pDynObj DynamicObject to import to.
appName The name which is used internally.
ossimName The name which OSSIM uses to access the property.
Returns:
True if the metadata was successfully imported, false otherwise.

static bool Nitf::Header::importDateYYMMDD ( const ossimPropertyInterface *  pPropertyInterface,
RasterDataDescriptor pDescriptor,
DynamicObject pDynObj,
const string &  appName,
const string &  ossimName 
) [static, protected]

Import dates stored in YYMMDD format.

Parameters:
pPropertyInterface OSSIM property interface to import from.
pDescriptor Descriptor to import to.
pDynObj DynamicObject to import to.
appName The name which is used internally.
ossimName The name which OSSIM uses to access the property.
Returns:
True if the metadata was successfully imported, false otherwise.


Member Data Documentation

std::vector<Element> Nitf::Header::mElements [protected]

Contains all Element objects for import and/or export.

Definition at line 502 of file NitfHeader.h.

const std::string Nitf::Header::mFileVersion [protected]

The version of the NITF file - either Nitf::VERSION_02_00 or Nitf::VERSION_02_10.

Definition at line 507 of file NitfHeader.h.


Software Development Kit - Opticks 4.9.0 Build 16218