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

This class is able to read the leader file of the RadarSat file structure. More...

#include <Leader.h>

Public Member Functions

 Leader ()
 Constructor. More...
 
 ~Leader ()
 Destructor. More...
 
 Leader (const Leader &rhs)
 Copy constructor. More...
 
Leaderoperator= (const Leader &rhs)
 Copy operator. More...
 
void ClearRecords ()
 Removes all the previous records from the Leader. More...
 
RadiometricDataget_RadiometricData ()
 
RadiometricCompensationDataget_RadiometricCompensationData ()
 
AttitudeDataget_AttitudeData ()
 
PlatformPositionDataget_PlatformPositionData ()
 
ProcessingParametersget_ProcessingParameters ()
 
DataHistogramProcessedDataget_DataHistogramProcessedData ()
 
DataHistogramSignalDataget_DataHistogramSignalData ()
 
DataQualityget_DataQuality ()
 
DataSetSummaryget_DataSetSummary ()
 
FileDescriptorget_FileDescriptor ()
 

Protected Attributes

std::map< int, RadarSatRecord * > _records
 

Static Protected Attributes

static const int RadiometricDataID = 9
 
static const int RadiometricCompensationDataID = 10
 
static const int AttitudeDataID = 8
 
static const int PlatformPositionDataID = 7
 
static const int ProcessingParametersID = 6
 
static const int DataHistogramProcessedDataID = 5
 
static const int DataHistogramSignalDataID = 4
 
static const int DataQualityID = 3
 
static const int DataSetSummaryID = 2
 
static const int FileDescriptorID = 1
 

Friends

std::ostream & operator<< (std::ostream &os, const Leader &data)
 This function writes the Leader in a stream. More...
 
std::istream & operator>> (std::istream &is, Leader &data)
 This function reads a Leader from a stream. More...
 

Detailed Description

This class is able to read the leader file of the RadarSat file structure.

Author
Magellium, Pacome Dentraygues
Version
1.0
Date
23-11-07

Definition at line 43 of file Leader.h.

Constructor & Destructor Documentation

◆ Leader() [1/2]

ossimplugins::Leader::Leader ( )

Constructor.

Definition at line 43 of file Leader.cpp.

44 {
45 }

◆ ~Leader()

ossimplugins::Leader::~Leader ( )

Destructor.

Definition at line 47 of file Leader.cpp.

References ClearRecords().

48 {
49  ClearRecords();
50 }
void ClearRecords()
Removes all the previous records from the Leader.
Definition: Leader.cpp:140

◆ Leader() [2/2]

ossimplugins::Leader::Leader ( const Leader rhs)

Copy constructor.

Definition at line 117 of file Leader.cpp.

References _records.

118 {
119  std::map<int, RadarSatRecord*>::const_iterator it = rhs._records.begin();
120  while(it != rhs._records.end())
121  {
122  _records[(*it).first] = (*it).second->Clone();
123  ++it;
124  }
125 }
std::map< int, RadarSatRecord * > _records
Definition: Leader.h:92

Member Function Documentation

◆ ClearRecords()

void ossimplugins::Leader::ClearRecords ( )

Removes all the previous records from the Leader.

Definition at line 140 of file Leader.cpp.

References _records.

Referenced by operator=(), ossimplugins::operator>>(), and ~Leader().

141 {
142  std::map<int, RadarSatRecord*>::const_iterator it = _records.begin();
143  while(it != _records.end())
144  {
145  delete (*it).second;
146  ++it;
147  }
148  _records.clear();
149 }
std::map< int, RadarSatRecord * > _records
Definition: Leader.h:92

◆ get_AttitudeData()

AttitudeData * ossimplugins::Leader::get_AttitudeData ( )

Definition at line 161 of file Leader.cpp.

References _records, and AttitudeDataID.

162 {
163  return (AttitudeData*)_records[AttitudeDataID];
164 }
static const int AttitudeDataID
Definition: Leader.h:96
std::map< int, RadarSatRecord * > _records
Definition: Leader.h:92

◆ get_DataHistogramProcessedData()

DataHistogramProcessedData * ossimplugins::Leader::get_DataHistogramProcessedData ( )

Definition at line 176 of file Leader.cpp.

References _records, and DataHistogramProcessedDataID.

177 {
178  return (DataHistogramProcessedData*)_records[DataHistogramProcessedDataID];
179 }
static const int DataHistogramProcessedDataID
Definition: Leader.h:99
std::map< int, RadarSatRecord * > _records
Definition: Leader.h:92

◆ get_DataHistogramSignalData()

DataHistogramSignalData * ossimplugins::Leader::get_DataHistogramSignalData ( )

Definition at line 181 of file Leader.cpp.

References _records, and DataHistogramSignalDataID.

182 {
183  return (DataHistogramSignalData*)_records[DataHistogramSignalDataID];
184 }
static const int DataHistogramSignalDataID
Definition: Leader.h:100
std::map< int, RadarSatRecord * > _records
Definition: Leader.h:92

◆ get_DataQuality()

DataQuality * ossimplugins::Leader::get_DataQuality ( )

Definition at line 186 of file Leader.cpp.

References _records, and DataQualityID.

187 {
188  return (DataQuality*)_records[DataQualityID];
189 }
static const int DataQualityID
Definition: Leader.h:101
std::map< int, RadarSatRecord * > _records
Definition: Leader.h:92

◆ get_DataSetSummary()

DataSetSummary * ossimplugins::Leader::get_DataSetSummary ( )

Definition at line 191 of file Leader.cpp.

References _records, and DataSetSummaryID.

Referenced by ossimplugins::ossimRadarSatModel::internalSaveState().

192 {
193  return (DataSetSummary*)_records[DataSetSummaryID];
194 }
static const int DataSetSummaryID
Definition: Leader.h:102
std::map< int, RadarSatRecord * > _records
Definition: Leader.h:92

◆ get_FileDescriptor()

FileDescriptor * ossimplugins::Leader::get_FileDescriptor ( )

Definition at line 196 of file Leader.cpp.

References _records, and FileDescriptorID.

Referenced by ossimplugins::ossimRadarSatModel::internalSaveState().

197 {
198  return (FileDescriptor*)_records[FileDescriptorID];
199 }
static const int FileDescriptorID
Definition: Leader.h:103
std::map< int, RadarSatRecord * > _records
Definition: Leader.h:92

◆ get_PlatformPositionData()

PlatformPositionData * ossimplugins::Leader::get_PlatformPositionData ( )

Definition at line 166 of file Leader.cpp.

References _records, and PlatformPositionDataID.

Referenced by ossimplugins::ossimRadarSatModel::internalSaveState().

167 {
168  return (PlatformPositionData*)_records[PlatformPositionDataID];
169 }
static const int PlatformPositionDataID
Definition: Leader.h:97
std::map< int, RadarSatRecord * > _records
Definition: Leader.h:92

◆ get_ProcessingParameters()

ProcessingParameters * ossimplugins::Leader::get_ProcessingParameters ( )

Definition at line 171 of file Leader.cpp.

References _records, and ProcessingParametersID.

Referenced by ossimplugins::ossimRadarSatModel::internalSaveState().

172 {
173  return (ProcessingParameters*)_records[ProcessingParametersID];
174 }
static const int ProcessingParametersID
Definition: Leader.h:98
std::map< int, RadarSatRecord * > _records
Definition: Leader.h:92

◆ get_RadiometricCompensationData()

RadiometricCompensationData * ossimplugins::Leader::get_RadiometricCompensationData ( )

Definition at line 156 of file Leader.cpp.

References _records, and RadiometricCompensationDataID.

157 {
158  return (RadiometricCompensationData*)_records[RadiometricCompensationDataID];
159 }
static const int RadiometricCompensationDataID
Definition: Leader.h:95
std::map< int, RadarSatRecord * > _records
Definition: Leader.h:92

◆ get_RadiometricData()

RadiometricData * ossimplugins::Leader::get_RadiometricData ( )

Definition at line 151 of file Leader.cpp.

References _records, and RadiometricDataID.

152 {
153  return (RadiometricData*)_records[RadiometricDataID];
154 }
static const int RadiometricDataID
Definition: Leader.h:94
std::map< int, RadarSatRecord * > _records
Definition: Leader.h:92

◆ operator=()

Leader & ossimplugins::Leader::operator= ( const Leader rhs)

Copy operator.

Definition at line 127 of file Leader.cpp.

References _records, and ClearRecords().

128 {
129  ClearRecords();
130  std::map<int, RadarSatRecord*>::const_iterator it = rhs._records.begin();
131  while(it != rhs._records.end())
132  {
133  _records[(*it).first] = (*it).second->Clone();
134  ++it;
135  }
136 
137  return *this;
138 }
void ClearRecords()
Removes all the previous records from the Leader.
Definition: Leader.cpp:140
std::map< int, RadarSatRecord * > _records
Definition: Leader.h:92

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const Leader data 
)
friend

This function writes the Leader in a stream.

Definition at line 52 of file Leader.cpp.

53 {
54  std::map<int, RadarSatRecord*>::const_iterator it = data._records.begin();
55  while(it != data._records.end())
56  {
57  (*it).second->Write(os);
58  ++it;
59  }
60  return os;
61 
62 }

◆ operator>>

std::istream& operator>> ( std::istream &  is,
Leader data 
)
friend

This function reads a Leader from a stream.

Definition at line 64 of file Leader.cpp.

65 {
66  LeaderFactory factory;
67 
68  data.ClearRecords();
69 
70  RadarSatRecordHeader header;
71  bool eof = false;
72  while(!eof)
73  {
74  is>>header;
75  if(is.eof())
76  {
77  eof = true;
78  }
79  else
80  {
81  RadarSatRecord* record;
82  if ( (header.get_rec_seq() == 2) && (header.get_length() == 8960) )
83  {
84  record = factory.Instanciate(header.get_rec_seq() + 5); // case of SCN, SCW
85  if (record != NULL)
86  {
87  record->Read(is);
88  data._records[header.get_rec_seq() + 5] = record;
89  }
90  else
91  {
92  char* buff = new char[header.get_length()-12];
93  is.read(buff, header.get_length()-12);
94  delete[] buff;
95  }
96  }
97  else
98  {
99  record = factory.Instanciate(header.get_rec_seq());
100  if (record != NULL)
101  {
102  record->Read(is);
103  data._records[header.get_rec_seq()] = record;
104  }
105  else
106  {
107  char* buff = new char[header.get_length()-12];
108  is.read(buff, header.get_length()-12);
109  delete[] buff;
110  }
111  }
112  }
113  }
114  return is;
115 }

Member Data Documentation

◆ _records

std::map<int, RadarSatRecord*> ossimplugins::Leader::_records
protected

◆ AttitudeDataID

const int ossimplugins::Leader::AttitudeDataID = 8
staticprotected

Definition at line 96 of file Leader.h.

Referenced by get_AttitudeData().

◆ DataHistogramProcessedDataID

const int ossimplugins::Leader::DataHistogramProcessedDataID = 5
staticprotected

Definition at line 99 of file Leader.h.

Referenced by get_DataHistogramProcessedData().

◆ DataHistogramSignalDataID

const int ossimplugins::Leader::DataHistogramSignalDataID = 4
staticprotected

Definition at line 100 of file Leader.h.

Referenced by get_DataHistogramSignalData().

◆ DataQualityID

const int ossimplugins::Leader::DataQualityID = 3
staticprotected

Definition at line 101 of file Leader.h.

Referenced by get_DataQuality().

◆ DataSetSummaryID

const int ossimplugins::Leader::DataSetSummaryID = 2
staticprotected

Definition at line 102 of file Leader.h.

Referenced by get_DataSetSummary().

◆ FileDescriptorID

const int ossimplugins::Leader::FileDescriptorID = 1
staticprotected

Definition at line 103 of file Leader.h.

Referenced by get_FileDescriptor().

◆ PlatformPositionDataID

const int ossimplugins::Leader::PlatformPositionDataID = 7
staticprotected

Definition at line 97 of file Leader.h.

Referenced by get_PlatformPositionData().

◆ ProcessingParametersID

const int ossimplugins::Leader::ProcessingParametersID = 6
staticprotected

Definition at line 98 of file Leader.h.

Referenced by get_ProcessingParameters().

◆ RadiometricCompensationDataID

const int ossimplugins::Leader::RadiometricCompensationDataID = 10
staticprotected

Definition at line 95 of file Leader.h.

Referenced by get_RadiometricCompensationData().

◆ RadiometricDataID

const int ossimplugins::Leader::RadiometricDataID = 9
staticprotected

Definition at line 94 of file Leader.h.

Referenced by get_RadiometricData().


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