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

This class is able to read the ASAR dsd record. More...

#include <dsd.h>

Inheritance diagram for ossimplugins::dsd:
ossimplugins::EnvisatAsarRecord

Public Member Functions

 dsd ()
 Constructor. More...
 
virtual ~dsd ()
 Destructor. More...
 
 dsd (const dsd &rhs)
 Copy constructor. More...
 
dsdoperator= (const dsd &rhs)
 Copy operator. More...
 
EnvisatAsarRecordInstanciate ()
 This function is able to create a new instance of the class. More...
 
EnvisatAsarRecordClone ()
 This function is able to create a new instance of the class initialised with the data of the calling instance. More...
 
void Read (std::istream &is)
 Read the class data from a stream. More...
 
void Write (std::ostream &os)
 Write the class to a stream. More...
 
std::string get_ds_name ()
 Data set Name. More...
 
std::string get_ds_type ()
 Data set Type. More...
 
std::string get_filename ()
 Data set Filename. More...
 
double get_ds_offset ()
 Data set Offset. More...
 
double get_ds_size ()
 Data set Size. More...
 
int get_num_dsr ()
 Number of data set record. More...
 
int get_dsr_size ()
 Data set record size. More...
 
- Public Member Functions inherited from ossimplugins::EnvisatAsarRecord
 EnvisatAsarRecord (std::string mnemonic)
 Constructor. More...
 
virtual ~EnvisatAsarRecord ()
 Destructor. More...
 
 EnvisatAsarRecord (const EnvisatAsarRecord &rhs)
 Copy constructor. More...
 
std::string get_mnemonic ()
 Returns the mnemonic of the record. More...
 

Public Attributes

std::string _ds_name
 Data set Name. More...
 
std::string _ds_type
 Data set Type. More...
 
std::string _filename
 Data set Filename. More...
 
double _ds_offset
 Data set Offset. More...
 
double _ds_size
 Data set Size. More...
 
int _num_dsr
 Number of data set record. More...
 
int _dsr_size
 Data set record size. More...
 

Friends

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

Additional Inherited Members

- Protected Member Functions inherited from ossimplugins::EnvisatAsarRecord
template<typename T >
void SwitchEndian (T &value)
 This function switches the LSB value and the MSB value of the parameter. More...
 
- Protected Attributes inherited from ossimplugins::EnvisatAsarRecord
std::string _mnemonic
 

Detailed Description

This class is able to read the ASAR dsd record.

Definition at line 24 of file dsd.h.

Constructor & Destructor Documentation

◆ dsd() [1/2]

ossimplugins::dsd::dsd ( )

Constructor.

Definition at line 16 of file dsd.cpp.

Referenced by Clone(), and Instanciate().

16  : EnvisatAsarRecord("dsd_rec")
17  {
18  }
EnvisatAsarRecord(std::string mnemonic)
Constructor.

◆ ~dsd()

ossimplugins::dsd::~dsd ( )
virtual

Destructor.

Definition at line 20 of file dsd.cpp.

21  {
22  }

◆ dsd() [2/2]

ossimplugins::dsd::dsd ( const dsd rhs)

Copy constructor.

Definition at line 132 of file dsd.cpp.

132  :
133  EnvisatAsarRecord(rhs),
134  _ds_name(rhs._ds_name),
135  _ds_type(rhs._ds_type),
136  _filename(rhs._filename),
137  _ds_offset(rhs._ds_offset),
138  _ds_size(rhs._ds_size),
139  _num_dsr(rhs._num_dsr),
140  _dsr_size(rhs._dsr_size)
141  {
142  }
int _num_dsr
Number of data set record.
Definition: dsd.h:163
std::string _filename
Data set Filename.
Definition: dsd.h:151
double _ds_size
Data set Size.
Definition: dsd.h:159
double _ds_offset
Data set Offset.
Definition: dsd.h:155
std::string _ds_type
Data set Type.
Definition: dsd.h:147
int _dsr_size
Data set record size.
Definition: dsd.h:167
std::string _ds_name
Data set Name.
Definition: dsd.h:143
EnvisatAsarRecord(std::string mnemonic)
Constructor.

Member Function Documentation

◆ Clone()

EnvisatAsarRecord* ossimplugins::dsd::Clone ( )
inlinevirtual

This function is able to create a new instance of the class initialised with the data of the calling instance.

Implements ossimplugins::EnvisatAsarRecord.

Definition at line 68 of file dsd.h.

References dsd().

69  {
70  return new dsd(*this);
71  };
dsd()
Constructor.
Definition: dsd.cpp:16

◆ get_ds_name()

std::string ossimplugins::dsd::get_ds_name ( )
inline

Data set Name.

Definition at line 93 of file dsd.h.

References _ds_name.

94  {
95  return _ds_name;
96  }
std::string _ds_name
Data set Name.
Definition: dsd.h:143

◆ get_ds_offset()

double ossimplugins::dsd::get_ds_offset ( )
inline

Data set Offset.

Definition at line 114 of file dsd.h.

References _ds_offset.

115  {
116  return _ds_offset;
117  }
double _ds_offset
Data set Offset.
Definition: dsd.h:155

◆ get_ds_size()

double ossimplugins::dsd::get_ds_size ( )
inline

Data set Size.

Definition at line 121 of file dsd.h.

References _ds_size.

122  {
123  return _ds_size;
124  }
double _ds_size
Data set Size.
Definition: dsd.h:159

◆ get_ds_type()

std::string ossimplugins::dsd::get_ds_type ( )
inline

Data set Type.

Definition at line 100 of file dsd.h.

References _ds_type.

101  {
102  return _ds_type;
103  }
std::string _ds_type
Data set Type.
Definition: dsd.h:147

◆ get_dsr_size()

int ossimplugins::dsd::get_dsr_size ( )
inline

Data set record size.

Definition at line 135 of file dsd.h.

References _dsr_size.

136  {
137  return _dsr_size;
138  }
int _dsr_size
Data set record size.
Definition: dsd.h:167

◆ get_filename()

std::string ossimplugins::dsd::get_filename ( )
inline

Data set Filename.

Definition at line 107 of file dsd.h.

References _filename.

108  {
109  return _filename;
110  }
std::string _filename
Data set Filename.
Definition: dsd.h:151

◆ get_num_dsr()

int ossimplugins::dsd::get_num_dsr ( )
inline

Number of data set record.

Definition at line 128 of file dsd.h.

References _num_dsr.

129  {
130  return _num_dsr;
131  }
int _num_dsr
Number of data set record.
Definition: dsd.h:163

◆ Instanciate()

EnvisatAsarRecord* ossimplugins::dsd::Instanciate ( )
inlinevirtual

This function is able to create a new instance of the class.

Implements ossimplugins::EnvisatAsarRecord.

Definition at line 60 of file dsd.h.

References dsd().

61  {
62  return new dsd();
63  };
dsd()
Constructor.
Definition: dsd.cpp:16

◆ operator=()

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

Copy operator.

Definition at line 145 of file dsd.cpp.

References _ds_name, _ds_offset, _ds_size, _ds_type, _dsr_size, _filename, and _num_dsr.

146  {
147  _ds_name = rhs._ds_name;
148  _ds_type = rhs._ds_type;
149  _filename = rhs._filename;
150  _ds_offset = rhs._ds_offset;
151  _ds_size = rhs._ds_size;
152  _num_dsr = rhs._num_dsr;
153  _dsr_size = rhs._dsr_size;
154 
155  return *this;
156  }
int _num_dsr
Number of data set record.
Definition: dsd.h:163
std::string _filename
Data set Filename.
Definition: dsd.h:151
double _ds_size
Data set Size.
Definition: dsd.h:159
double _ds_offset
Data set Offset.
Definition: dsd.h:155
std::string _ds_type
Data set Type.
Definition: dsd.h:147
int _dsr_size
Data set record size.
Definition: dsd.h:167
std::string _ds_name
Data set Name.
Definition: dsd.h:143

◆ Read()

void ossimplugins::dsd::Read ( std::istream &  is)
inlinevirtual

Read the class data from a stream.

Implements ossimplugins::EnvisatAsarRecord.

Definition at line 76 of file dsd.h.

77  {
78  is>>*this;
79  };

◆ Write()

void ossimplugins::dsd::Write ( std::ostream &  os)
inlinevirtual

Write the class to a stream.

Implements ossimplugins::EnvisatAsarRecord.

Definition at line 84 of file dsd.h.

85  {
86  os<<*this;
87  };

Friends And Related Function Documentation

◆ operator<<

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

This function write the dsd in a stream.

Definition at line 24 of file dsd.cpp.

25  {
26  os<<"ds_name:"<<data._ds_name.c_str()<<std::endl;
27  os<<"ds_type:"<<data._ds_type.c_str()<<std::endl;
28  os<<"filename:"<<data._filename.c_str()<<std::endl;
29  os<<"ds_offset:"<<data._ds_offset<<std::endl;
30  os<<"ds_size:"<<data._ds_size<<std::endl;
31  os<<"num_dsr:"<<data._num_dsr<<std::endl;
32  os<<"dsr_size:"<<data._dsr_size<<std::endl;
33 
34  return os;
35  }

◆ operator>>

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

This function read a dsd from a stream.

Definition at line 37 of file dsd.cpp.

38  {
39  char buf64[65];
40  buf64[64] = '\0';
41  // char buf32[33];
42  // buf32[32] = '\0';
43  char buf28[29];
44  buf28[28] = '\0';
45  char buf27[28];
46  buf27[27] = '\0';
47  // char buf20[21];
48  // buf20[20] = '\0';
49  char buf16[17];
50  buf16[16]='\0';
51  // char buf15[16];
52  // buf15[15] = '\0';
53  // char buf14[15];
54  // buf14[14] = '\0';
55  // char buf13[14];
56  // buf13[13] = '\0';
57  char buf12[13];
58  buf12[12] = '\0';
59  char buf11[12];
60  buf11[11] = '\0';
61  char buf10[11];
62  buf10[10] = '\0';
63  char buf9[10];
64  buf9[9] = '\0';
65  // char buf8[9];
66  // buf8[8] = '\0';
67  // char buf7[8];
68  // buf7[7] = '\0';
69  // char buf6[7];
70  // buf6[6] = '\0';
71  // char buf5[6];
72  // buf5[5] = '\0';
73  // char buf4[5];
74  // buf4[4] = '\0';
75  // char buf3[4];
76  // buf3[3] = '\0';
77  // char buf2[3];
78  // buf2[2] = '\0';
79  char buf1[1];
80 
81  is.read(buf9,9);
82 
83  is.read(buf28,28);
84  data._ds_name = buf28;
85 
86  is.read(buf10,10);
87 
88  is.read(buf1,1);
89  data._ds_type = buf1;
90 
91  is.read(buf11,11);
92 
93  is.read(buf64,62);
94  buf64[62] = '\0';
95  data._filename = buf64;
96 
97  is.read(buf12,12);
98 
99  is.read(buf27,21);
100  buf27[21] = '\0';
101  data._ds_offset = atof(buf27);
102 
103  is.read(buf16,16);
104 
105  is.read(buf27,21);
106  buf27[21] = '\0';
107  data._ds_size = atof(buf27);
108 
109  is.read(buf16,16);
110 
111  is.read(buf11,11);
112  data._num_dsr = atol(buf11);
113 
114  is.read(buf10,10);
115 
116  is.read(buf11,11);
117  data._dsr_size = atol(buf11);
118 
119  is.read(buf64,41);
120 
121  return is;
122 
123  }

Member Data Documentation

◆ _ds_name

std::string ossimplugins::dsd::_ds_name

Data set Name.

Definition at line 143 of file dsd.h.

Referenced by get_ds_name(), ossimplugins::operator<<(), operator=(), and ossimplugins::operator>>().

◆ _ds_offset

double ossimplugins::dsd::_ds_offset

Data set Offset.

Definition at line 155 of file dsd.h.

Referenced by get_ds_offset(), ossimplugins::operator<<(), operator=(), and ossimplugins::operator>>().

◆ _ds_size

double ossimplugins::dsd::_ds_size

Data set Size.

Definition at line 159 of file dsd.h.

Referenced by get_ds_size(), ossimplugins::operator<<(), operator=(), and ossimplugins::operator>>().

◆ _ds_type

std::string ossimplugins::dsd::_ds_type

Data set Type.

Definition at line 147 of file dsd.h.

Referenced by get_ds_type(), ossimplugins::operator<<(), operator=(), and ossimplugins::operator>>().

◆ _dsr_size

int ossimplugins::dsd::_dsr_size

Data set record size.

Definition at line 167 of file dsd.h.

Referenced by get_dsr_size(), ossimplugins::operator<<(), operator=(), and ossimplugins::operator>>().

◆ _filename

std::string ossimplugins::dsd::_filename

Data set Filename.

Definition at line 151 of file dsd.h.

Referenced by get_filename(), ossimplugins::operator<<(), operator=(), and ossimplugins::operator>>().

◆ _num_dsr

int ossimplugins::dsd::_num_dsr

Number of data set record.

Definition at line 163 of file dsd.h.

Referenced by get_num_dsr(), ossimplugins::operator<<(), operator=(), and ossimplugins::operator>>().


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