OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimRpfBoundaryRectTable.cpp
Go to the documentation of this file.
1 //*******************************************************************
2 //
3 // License: See top level LICENSE.txt file.
4 //
5 // Author: Garrett Potts
6 //
7 // Description: Rpf support class
8 //
9 //********************************************************************
10 // $Id: ossimRpfBoundaryRectTable.cpp 16997 2010-04-12 18:53:48Z dburken $
11 
12 
13 #include <istream>
14 #include <iterator>
15 #include <ostream>
16 
18 #include <ossim/base/ossimEndian.h>
19 
21 {
22  return data.print(out);
23 }
24 
26  :
27  m_table(numberOfEntries)
28 {
29 }
30 
32  :
33  m_table(obj.m_table)
34 {
35 }
36 
38  const ossimRpfBoundaryRectTable& rhs)
39 {
40  if ( this != &rhs )
41  {
42  m_table = rhs.m_table;
43  }
44  return *this;
45 }
46 
48 {}
49 
52 {
53  if(in)
54  {
55  std::vector<ossimRpfBoundaryRectRecord>::iterator entry = m_table.begin();
56 
57  while(entry != m_table.end())
58  {
59  (*entry).parseStream(in, byteOrder);
60  ++entry;
61  }
62  }
63  else
64  {
66  }
67 
69 }
70 
72 {
73  std::vector<ossimRpfBoundaryRectRecord>::iterator entry = m_table.begin();
74  while ( entry != m_table.end() )
75  {
76  (*entry).writeStream(out);
77  ++entry;
78  }
79 }
80 
82 {
83  m_table.resize(numberOfEntries);
84 }
85 
87 {
88  return static_cast<ossim_uint32>(m_table.size());
89 }
90 
92  ossim_uint32 entry, ossimRpfBoundaryRectRecord& record) const
93 {
94  bool result = true;
95  if ( entry < m_table.size() )
96  {
97  record = m_table[entry];
98  }
99  else
100  {
101  result = false;
102  }
103  return result;
104 }
105 
107 {
108  std::copy(m_table.begin(), m_table.end(),
109  std::ostream_iterator<ossimRpfBoundaryRectRecord>(out, "\n"));
110  return out;
111 }
const ossimRpfBoundaryRectTable & operator=(const ossimRpfBoundaryRectTable &rhs)
assignment operator
ossim_int32 ossimErrorCode
ossimRpfBoundaryRectTable(ossim_uint32 numberOfEntries=0)
default constructor
static const ossimErrorCode OSSIM_OK
std::vector< ossimRpfBoundaryRectRecord > m_table
std::ostream & operator<<(std::ostream &out, const ossimRpfBoundaryRectTable &data)
OSSIM_DLL ossimByteOrder byteOrder()
Definition: ossimCommon.cpp:54
static const ossimErrorCode OSSIM_ERROR
std::ostream & print(std::ostream &out) const
unsigned int ossim_uint32
bool getEntry(ossim_uint32 entry, ossimRpfBoundaryRectRecord &record) const
Gets record for entry.
ossimErrorCode parseStream(std::istream &in, ossimByteOrder byteOrder)
ossimByteOrder
std::basic_istream< char > istream
Base class for char input streams.
Definition: ossimIosFwd.h:20
void writeStream(std::ostream &out)
Write method.
void setNumberOfEntries(ossim_uint32 numberOfEntries)
std::basic_ostream< char > ostream
Base class for char output streams.
Definition: ossimIosFwd.h:23