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

#include <ossimRpfBoundaryRectSectionSubheader.h>

Inheritance diagram for ossimRpfBoundaryRectSectionSubheader:
ossimReferenced

Public Member Functions

 ossimRpfBoundaryRectSectionSubheader ()
 default constructor More...
 
 ossimRpfBoundaryRectSectionSubheader (const ossimRpfBoundaryRectSectionSubheader &obj)
 copy constructor More...
 
const ossimRpfBoundaryRectSectionSubheaderoperator= (const ossimRpfBoundaryRectSectionSubheader &rhs)
 assignment operator More...
 
virtual ~ossimRpfBoundaryRectSectionSubheader ()
 
ossimErrorCode parseStream (std::istream &in, ossimByteOrder)
 
void writeStream (std::ostream &out)
 Write method. More...
 
std::ostream & print (std::ostream &out) const
 print method More...
 
ossim_uint16 getNumberOfEntries () const
 
ossim_uint32 getTableOffset () const
 
ossim_uint16 getLengthOfEachEntry () const
 
void setNumberOfEntries (ossim_uint16 entries)
 
void setTableOffset (ossim_uint32 offset)
 
void setLengthOfEachEntry (ossim_uint16 length)
 
void clearFields ()
 
- Public Member Functions inherited from ossimReferenced
 ossimReferenced ()
 
 ossimReferenced (const ossimReferenced &)
 
ossimReferencedoperator= (const ossimReferenced &)
 
void ref () const
 increment the reference count by one, indicating that this object has another pointer which is referencing it. More...
 
void unref () const
 decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
void unref_nodelete () const
 decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
int referenceCount () const
 

Private Attributes

ossim_uint32 m_rectangleTableOffset
 
ossim_uint16 m_numberOfEntries
 
ossim_uint16 m_lengthOfEachEntry
 

Friends

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

Additional Inherited Members

- Protected Member Functions inherited from ossimReferenced
virtual ~ossimReferenced ()
 

Detailed Description

Definition at line 19 of file ossimRpfBoundaryRectSectionSubheader.h.

Constructor & Destructor Documentation

◆ ossimRpfBoundaryRectSectionSubheader() [1/2]

ossimRpfBoundaryRectSectionSubheader::ossimRpfBoundaryRectSectionSubheader ( )

◆ ossimRpfBoundaryRectSectionSubheader() [2/2]

ossimRpfBoundaryRectSectionSubheader::ossimRpfBoundaryRectSectionSubheader ( const ossimRpfBoundaryRectSectionSubheader obj)

◆ ~ossimRpfBoundaryRectSectionSubheader()

ossimRpfBoundaryRectSectionSubheader::~ossimRpfBoundaryRectSectionSubheader ( )
virtual

Definition at line 53 of file ossimRpfBoundaryRectSectionSubheader.cpp.

54 {
55 }

Member Function Documentation

◆ clearFields()

void ossimRpfBoundaryRectSectionSubheader::clearFields ( )

◆ getLengthOfEachEntry()

ossim_uint16 ossimRpfBoundaryRectSectionSubheader::getLengthOfEachEntry ( ) const

◆ getNumberOfEntries()

ossim_uint16 ossimRpfBoundaryRectSectionSubheader::getNumberOfEntries ( ) const

◆ getTableOffset()

ossim_uint32 ossimRpfBoundaryRectSectionSubheader::getTableOffset ( ) const

◆ operator=()

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

◆ parseStream()

ossimErrorCode ossimRpfBoundaryRectSectionSubheader::parseStream ( std::istream &  in,
ossimByteOrder  byteOrder 
)

Definition at line 57 of file ossimRpfBoundaryRectSectionSubheader.cpp.

References ossim::byteOrder(), clearFields(), m_lengthOfEachEntry, m_numberOfEntries, m_rectangleTableOffset, ossimErrorCodes::OSSIM_ERROR, ossimErrorCodes::OSSIM_OK, and ossimEndian::swap().

Referenced by ossimRpfHeader::getNewBoundaryRectSectSubheader().

59 {
60  if(in)
61  {
62  clearFields();
63 
64  in.read((char*)&m_rectangleTableOffset, 4);
65  in.read((char*)&m_numberOfEntries, 2);
66  in.read((char*)&m_lengthOfEachEntry, 2);
67 
68  if( ossim::byteOrder() != byteOrder )
69  {
70  ossimEndian anEndian;
71  anEndian.swap(m_rectangleTableOffset);
72  anEndian.swap(m_numberOfEntries);
73  anEndian.swap(m_lengthOfEachEntry);
74  }
75  }
76  else
77  {
79  }
80 
82 }
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 & ossimRpfBoundaryRectSectionSubheader::print ( std::ostream &  out) const

print method

Parameters
outString to output to.
Returns
output stream.

Definition at line 109 of file ossimRpfBoundaryRectSectionSubheader.cpp.

References m_lengthOfEachEntry, m_numberOfEntries, and m_rectangleTableOffset.

Referenced by operator<<().

110 {
111  out << "RectangleTableOffset: " << m_rectangleTableOffset
112  << "\nNumberOfEntries: " << m_numberOfEntries
113  << "\nLengthOfEachEntry: " << m_lengthOfEachEntry << std::endl;
114  return out;
115 }

◆ setLengthOfEachEntry()

void ossimRpfBoundaryRectSectionSubheader::setLengthOfEachEntry ( ossim_uint16  length)

◆ setNumberOfEntries()

void ossimRpfBoundaryRectSectionSubheader::setNumberOfEntries ( ossim_uint16  entries)

Definition at line 132 of file ossimRpfBoundaryRectSectionSubheader.cpp.

References m_numberOfEntries.

◆ setTableOffset()

void ossimRpfBoundaryRectSectionSubheader::setTableOffset ( ossim_uint32  offset)

◆ writeStream()

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

Write method.

Parameters
outStream to write to.

Definition at line 84 of file ossimRpfBoundaryRectSectionSubheader.cpp.

References ossimEndian::getSystemEndianType(), m_lengthOfEachEntry, m_numberOfEntries, m_rectangleTableOffset, OSSIM_BIG_ENDIAN, and ossimEndian::swap().

85 {
86  ossimEndian anEndian;
87 
88  if( anEndian.getSystemEndianType() != OSSIM_BIG_ENDIAN )
89  {
90  // Always write out big endian.
91  anEndian.swap(m_rectangleTableOffset);
92  anEndian.swap(m_numberOfEntries);
93  anEndian.swap(m_lengthOfEachEntry);
94  }
95 
96  out.write((char*)&m_rectangleTableOffset, 4);
97  out.write((char*)&m_numberOfEntries, 2);
98  out.write((char*)&m_lengthOfEachEntry, 2);
99 
100  if( anEndian.getSystemEndianType() != OSSIM_BIG_ENDIAN )
101  {
102  // Swap back to native.
103  anEndian.swap(m_rectangleTableOffset);
104  anEndian.swap(m_numberOfEntries);
105  anEndian.swap(m_lengthOfEachEntry);
106  }
107 }
ossimByteOrder getSystemEndianType() const
Definition: ossimEndian.h:78
void swap(ossim_sint8 &)
Definition: ossimEndian.h:26

Friends And Related Function Documentation

◆ operator<<

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

Definition at line 19 of file ossimRpfBoundaryRectSectionSubheader.cpp.

21 {
22  return data.print(out);
23 }
std::ostream & print(std::ostream &out) const
print method

Member Data Documentation

◆ m_lengthOfEachEntry

ossim_uint16 ossimRpfBoundaryRectSectionSubheader::m_lengthOfEachEntry
private

◆ m_numberOfEntries

ossim_uint16 ossimRpfBoundaryRectSectionSubheader::m_numberOfEntries
private

◆ m_rectangleTableOffset

ossim_uint32 ossimRpfBoundaryRectSectionSubheader::m_rectangleTableOffset
private

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