#include <NitfTreParser.h>

Public Member Functions | |
| virtual TreState | isTreValid (const DynamicObject &tre, std::ostream &reporter) const =0 |
| virtual bool | ossimTagToDynamicObject (const ossimNitfRegisteredTag &input, DynamicObject &output, std::string &errorMessage) const =0 |
| virtual bool | toDynamicObject (std::istream &input, size_t numBytes, DynamicObject &output, std::string &errorMessage) const =0 |
| virtual bool | ossimTagFromDynamicObject (const DynamicObject &input, ossimNitfRegisteredTag &tre, std::string &errorMessage) const =0 |
| virtual bool | fromDynamicObject (const DynamicObject &input, std::ostream &output, size_t &numBytesWritten, std::string &errorMessage) const =0 |
| virtual bool | importMetadata (const DynamicObject &tre, RasterDataDescriptor &descriptor, std::string &errorMessage) const =0 |
| virtual TreExportStatus | exportMetadata (const RasterDataDescriptor &descriptor, const RasterFileDescriptor &exportDescriptor, DynamicObject &tre, unsigned int &ownerIndex, std::string &tagType, std::string &errorMessage) const =0 |
Static Public Member Functions | |
| static std::string | Type () |
| static std::string | NormalSubtype () |
| static std::string | CreateOnExportSubtype () |
In order for the NITF importer and exporter to find your plug-in, you should ensure that the plug-in name is the same 6-character string as the CETAG as the TRE.
Implementers of this interface can use an existing OSSIM TRE plug-in by implementing ossimTagToDynamicObject(ossimNitfRegisteredTag&, DynamicObject&) const and ossimTagFromDynamicObject(const DynamicObject&, ossimNitfRegisteredTag&) const. The ossimNitfRegisteredTag object will be that registered with OSSIM.
Implementers can also simply perform stream operations for TRE import and export. In that case, implement toDynamicObject(std::istream&, size_t, DynamicObject&) const and fromDynamicObject(const DynamicObject&, std::ostream&, size_t&) const.
Definition at line 80 of file NitfTreParser.h.
| static std::string Nitf::TreParser::Type | ( | ) | [static] |
The type that should be returned from PlugIn::getType() for TRE parser plug-ins.
Definition at line 89 of file NitfTreParser.h.
| static std::string Nitf::TreParser::NormalSubtype | ( | ) | [static] |
The type that should be returned from PlugIn::getSubtype() for TRE parser plug-ins which do not implement TreParser::exportMetadata().
Definition at line 103 of file NitfTreParser.h.
| static std::string Nitf::TreParser::CreateOnExportSubtype | ( | ) | [static] |
The type that should be returned from PlugIn::getSubtype() for TRE parser plug-ins which do implement TreParser::exportMetadata().
Definition at line 117 of file NitfTreParser.h.
| virtual TreState Nitf::TreParser::isTreValid | ( | const DynamicObject & | tre, | |
| std::ostream & | reporter | |||
| ) | const [pure virtual] |
Examine the TRE to determine if it is valid.
| tre | The TRE to examine. | |
| reporter | Write to this ostream with information regarding a TreState::SUSPECT or TreState::INVALID TRE. |
Implemented in Nitf::TreParserShell.
| virtual bool Nitf::TreParser::ossimTagToDynamicObject | ( | const ossimNitfRegisteredTag & | input, | |
| DynamicObject & | output, | |||
| std::string & | errorMessage | |||
| ) | const [pure virtual] |
Load the TRE directly from an ossimNitfRegisteredTag.
Implementers should implement either this function or toDynamicObject(std::istream&, size_t, DynamicObject&) const to load the TRE.
| input | The ossimNitfRegisteredTag to read from. | |
| output | The DynamicObject to write to. | |
| errorMessage | If this is modified by the function, it will be displayed to the user as a warning that imported TREs might be incomplete, missing, etc. |
Implemented in Nitf::TreParserShell.
| virtual bool Nitf::TreParser::toDynamicObject | ( | std::istream & | input, | |
| size_t | numBytes, | |||
| DynamicObject & | output, | |||
| std::string & | errorMessage | |||
| ) | const [pure virtual] |
Load the TRE from an istream.
Implementers should implement either this function or ossimTagToDynamicObject(ossimNitfRegisteredTag&, DynamicObject&) const to load the TRE. This function will only be called if the other returned false.
| input | The istream to read from. The data within does not include the CETAG or CEL fields. | |
| numBytes | The number of bytes to read. | |
| output | The DynamicObject to write to. | |
| errorMessage | If this is modified by the function, it will be displayed to the user as a warning that imported TREs might be incomplete, missing, etc. |
Implemented in Nitf::TreParserShell.
| virtual bool Nitf::TreParser::ossimTagFromDynamicObject | ( | const DynamicObject & | input, | |
| ossimNitfRegisteredTag & | tre, | |||
| std::string & | errorMessage | |||
| ) | const [pure virtual] |
Write the TRE directly to an ossimNitfRegisteredTag.
Implementers should implement either this function or fromDynamicObject(const DynamicObject&, std::ostream&, size_t&) const to write the TRE.
| input | The DynamicObject to read from. | |
| tre | The ossimNitfRegisteredTag to write to. | |
| errorMessage | If this is modified by the function, it will be displayed to the user as a warning that exported TREs might be incomplete, missing, etc. |
Implemented in Nitf::TreParserShell.
| virtual bool Nitf::TreParser::fromDynamicObject | ( | const DynamicObject & | input, | |
| std::ostream & | output, | |||
| size_t & | numBytesWritten, | |||
| std::string & | errorMessage | |||
| ) | const [pure virtual] |
Write the TRE from a DynamicObject into an ostream.
Implementers should implement either this function or ossimTagFromDynamicObject(const DynamicObject&, ossimNitfRegisteredTag&) const to write the TRE. This function will only be called if the other returned false.
| input | The DynamicObject to read from. | |
| output | The ostream to write to. Do not write the CETAG or CEL. | |
| numBytesWritten | The number of bytes written. | |
| errorMessage | If this is modified by the function, it will be displayed to the user as a warning that exported TREs might be incomplete, missing, etc. |
Implemented in Nitf::TreParserShell.
| virtual bool Nitf::TreParser::importMetadata | ( | const DynamicObject & | tre, | |
| RasterDataDescriptor & | descriptor, | |||
| std::string & | errorMessage | |||
| ) | const [pure virtual] |
Import contents of the TRE to specific fields within the descriptor.
For example, a TRE might contain wavelength data which would be appropriately represented in the Special Metadata.
| tre | The parsed TRE to place copies of data within the descriptor. | |
| descriptor | The descriptor to place copies of data within. | |
| errorMessage | If this is modified by the function, it will be displayed to the user as a warning that imported TREs might be incomplete, missing, etc. |
true if the operation successfully populated the descriptor, false otherwise. This method should return false if there is no need to import metadata into the descriptor. Implemented in Nitf::TreParserShell.
| virtual TreExportStatus Nitf::TreParser::exportMetadata | ( | const RasterDataDescriptor & | descriptor, | |
| const RasterFileDescriptor & | exportDescriptor, | |||
| DynamicObject & | tre, | |||
| unsigned int & | ownerIndex, | |||
| std::string & | tagType, | |||
| std::string & | errorMessage | |||
| ) | const [pure virtual] |
Export contents descriptor into a tre.
For example, a TRE might contain wavelength data which would be appropriately represented in the Special Metadata.
This method can also be used to modify or create new TREs on export. This might be desired if the TRE must be modified when chipping, or to create a TRE for a dataset not initially loaded as a NITF.
| descriptor | The data descriptor to export from. | |
| exportDescriptor | The descriptor which specifies which portion is to be exported. | |
| tre | On return, this should contain the TRE to export with a future call to fromDynamicObject(). | |
| ownerIndex | When returning TreExportStatus::REPLACE, specifies the index of the owner of this tag. This should be set to 0 for the file header and 1 for the image subheader. If this value is unspecified, it will default to the image subheader. | |
| tagType | When returning TreExportStatus::REPLACE, specifies the type of this tag. Valid values are "UDHD" "UDID", "XHD", and "IXSHD". If this value is unspecified, it will default to "IXSHD". | |
| errorMessage | If this is modified by the function, it will be displayed to the user as a warning that exported TREs might be incomplete, missing, etc. |
Implemented in Nitf::TreParserShell.