OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
Public Member Functions | Public Attributes | Friends | List of all members
ossimRpfComponentLocationRecord Class Reference

#include <ossimRpfLocationSection.h>

Public Member Functions

 ossimRpfComponentLocationRecord ()
 default constructor More...
 
 ossimRpfComponentLocationRecord (const ossimRpfComponentLocationRecord &record)
 copy constructor More...
 
const ossimRpfComponentLocationRecordoperator= (const ossimRpfComponentLocationRecord &rhs)
 assignment operator More...
 
std::ostream & print (std::ostream &out, const std::string &prefix=std::string()) const
 print method that outputs a key/value type format adding prefix to keys. More...
 
ossimErrorCode parseStream (std::istream &in, ossimByteOrder endianOrder)
 
void writeStream (std::ostream &out)
 Write method. More...
 

Public Attributes

ossim_uint16 m_componentId
 
ossim_uint32 m_componentLength
 
ossim_uint32 m_componentLocation
 

Friends

std::ostream & operator<< (std::ostream &out, const ossimRpfComponentLocationRecord &data)
 

Detailed Description

Definition at line 24 of file ossimRpfLocationSection.h.

Constructor & Destructor Documentation

◆ ossimRpfComponentLocationRecord() [1/2]

ossimRpfComponentLocationRecord::ossimRpfComponentLocationRecord ( )

default constructor

Definition at line 31 of file ossimRpfLocationSection.cpp.

◆ ossimRpfComponentLocationRecord() [2/2]

ossimRpfComponentLocationRecord::ossimRpfComponentLocationRecord ( const ossimRpfComponentLocationRecord record)

Member Function Documentation

◆ operator=()

const ossimRpfComponentLocationRecord & ossimRpfComponentLocationRecord::operator= ( const ossimRpfComponentLocationRecord rhs)

assignment operator

Definition at line 46 of file ossimRpfLocationSection.cpp.

References m_componentId, m_componentLength, and m_componentLocation.

48 {
49  if (this != &rhs)
50  {
54  }
55  return *this;
56 }

◆ parseStream()

ossimErrorCode ossimRpfComponentLocationRecord::parseStream ( std::istream &  in,
ossimByteOrder  endianOrder 
)

Definition at line 77 of file ossimRpfLocationSection.cpp.

References ossim::byteOrder(), m_componentId, m_componentLength, m_componentLocation, ossimErrorCodes::OSSIM_ERROR, ossimErrorCodes::OSSIM_OK, and ossimEndian::swap().

79 {
80  if(in)
81  {
82  in.read((char*)&m_componentId, 2);
83  in.read((char*)&m_componentLength, 4);
84  in.read((char*)&m_componentLocation, 4);
85 
86  if( ossim::byteOrder() != byteOrder)
87  {
88  // swap to native
89  ossimEndian anEndian;
90  anEndian.swap(m_componentId);
91  anEndian.swap(m_componentLength);
92  anEndian.swap(m_componentLocation);
93  }
94  }
95  else
96  {
98  }
99 
101 }
static const ossimErrorCode OSSIM_OK
OSSIM_DLL ossimByteOrder byteOrder()
Definition: ossimCommon.cpp:54
static const ossimErrorCode OSSIM_ERROR
void swap(ossim_sint8 &)
Definition: ossimEndian.h:26

◆ print()

std::ostream & ossimRpfComponentLocationRecord::print ( std::ostream &  out,
const std::string &  prefix = std::string() 
) const

print method that outputs a key/value type format adding prefix to keys.

Parameters
outString to output to.
prefixThis will be prepended to key. e.g. Where prefix = "nitf." and key is "file_name" key becomes: "nitf.file_name:"
Returns
output stream.

Definition at line 58 of file ossimRpfLocationSection.cpp.

References ossimLookUpTable::getEntryString(), ossimRpfComponentIdLut::instance(), m_componentId, m_componentLength, and m_componentLocation.

Referenced by operator<<().

60 {
61  out << prefix << "ComponentId: "
62  << m_componentId << "\n"
63  << prefix << "ComponentIdString: "
65  << prefix << "ComponentLength: "
66  << m_componentLength << "\n"
67  << prefix << "ComponentLocation: "
68  << m_componentLocation << "\n";
69  return out;
70 }
virtual ossimString getEntryString(ossim_int32 entry_number) const
static ossimRpfComponentIdLut * instance()

◆ writeStream()

void ossimRpfComponentLocationRecord::writeStream ( std::ostream &  out)

Write method.

Parameters
outStream to write to.

Definition at line 103 of file ossimRpfLocationSection.cpp.

References ossim::byteOrder(), m_componentId, m_componentLength, m_componentLocation, OSSIM_BIG_ENDIAN, and ossimEndian::swap().

104 {
106  {
107  ossimEndian endian;
108  endian.swap(m_componentId);
109  endian.swap(m_componentLength);
110  endian.swap(m_componentLocation);
111  }
112 
113  out.write((char*)&m_componentId, 2);
114  out.write((char*)&m_componentLength, 4);
115  out.write((char*)&m_componentLocation, 4);
116 
118  {
119  // Swap back to native byte order.
120  ossimEndian endian;
121  endian.swap(m_componentId);
122  endian.swap(m_componentLength);
123  endian.swap(m_componentLocation);
124  }
125 }
OSSIM_DLL ossimByteOrder byteOrder()
Definition: ossimCommon.cpp:54
void swap(ossim_sint8 &)
Definition: ossimEndian.h:26

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  out,
const ossimRpfComponentLocationRecord data 
)
friend

Definition at line 26 of file ossimRpfLocationSection.cpp.

27 {
28  return data.print(out);
29 }
std::ostream & print(std::ostream &out, const std::string &prefix=std::string()) const
print method that outputs a key/value type format adding prefix to keys.

Member Data Documentation

◆ m_componentId

ossim_uint16 ossimRpfComponentLocationRecord::m_componentId

The component is a 2-Byte unsigned value which identitfies a level-2 component. The table can be found in MIL-STD-2411-1 in section 5.1.1 and in ossimRpfConstants.h.

Definition at line 65 of file ossimRpfLocationSection.h.

Referenced by operator=(), parseStream(), print(), and writeStream().

◆ m_componentLength

ossim_uint32 ossimRpfComponentLocationRecord::m_componentLength

Is a 4 byte unsigned integer indicating the length in bytes of the component.

Definition at line 71 of file ossimRpfLocationSection.h.

Referenced by operator=(), parseStream(), print(), and writeStream().

◆ m_componentLocation

ossim_uint32 ossimRpfComponentLocationRecord::m_componentLocation

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