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

This class is able to read a record header. More...

#include <RadarSatRecordHeader.h>

Public Member Functions

 RadarSatRecordHeader ()
 Constructor. More...
 
 ~RadarSatRecordHeader ()
 Destructor. More...
 
 RadarSatRecordHeader (const RadarSatRecordHeader &rhs)
 Copy constructor. More...
 
RadarSatRecordHeaderoperator= (const RadarSatRecordHeader &rhs)
 Copy operator. More...
 
int get_rec_seq ()
 Record sequence number. More...
 
unsigned char get_rec_sub1 ()
 First record sub-type code. More...
 
unsigned char get_rec_type ()
 Record type code. More...
 
unsigned char get_rec_sub2 ()
 Second record sub-type code. More...
 
unsigned char get_rec_sub3 ()
 Third record sub-type code. More...
 
int get_length ()
 Length of this record (in bytes) More...
 

Protected Member Functions

void SwitchEndian (int &value)
 This function switches the LSB value and the MSB value of the parameter. More...
 

Protected Attributes

int _rec_seq
 Record sequence number. More...
 
unsigned char _rec_sub1
 First record sub-type code. More...
 
unsigned char _rec_type
 Record type code. More...
 
unsigned char _rec_sub2
 Second record sub-type code. More...
 
unsigned char _rec_sub3
 Third record sub-type code. More...
 
int _length
 Length of this record (in bytes) More...
 

Friends

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

Detailed Description

This class is able to read a record header.

Definition at line 24 of file RadarSatRecordHeader.h.

Constructor & Destructor Documentation

◆ RadarSatRecordHeader() [1/2]

ossimplugins::RadarSatRecordHeader::RadarSatRecordHeader ( )

Constructor.

Definition at line 16 of file RadarSatRecordHeader.cpp.

17 {
18 }

◆ ~RadarSatRecordHeader()

ossimplugins::RadarSatRecordHeader::~RadarSatRecordHeader ( )

Destructor.

Definition at line 20 of file RadarSatRecordHeader.cpp.

21 {
22 }

◆ RadarSatRecordHeader() [2/2]

ossimplugins::RadarSatRecordHeader::RadarSatRecordHeader ( const RadarSatRecordHeader rhs)

Copy constructor.

Definition at line 48 of file RadarSatRecordHeader.cpp.

48  :
49  _rec_seq(rhs._rec_seq),
50  _rec_sub1(rhs._rec_sub1),
51  _rec_type(rhs._rec_type),
52  _rec_sub2(rhs._rec_sub2),
53  _rec_sub3(rhs._rec_sub3)
54 {
55 }
unsigned char _rec_sub3
Third record sub-type code.
unsigned char _rec_sub1
First record sub-type code.
unsigned char _rec_sub2
Second record sub-type code.
int _rec_seq
Record sequence number.
unsigned char _rec_type
Record type code.

Member Function Documentation

◆ get_length()

int ossimplugins::RadarSatRecordHeader::get_length ( )
inline

Length of this record (in bytes)

Definition at line 99 of file RadarSatRecordHeader.h.

References _length.

100  {
101  return _length;
102  };
int _length
Length of this record (in bytes)

◆ get_rec_seq()

int ossimplugins::RadarSatRecordHeader::get_rec_seq ( )
inline

Record sequence number.

Definition at line 59 of file RadarSatRecordHeader.h.

References _rec_seq.

60  {
61  return _rec_seq;
62  };
int _rec_seq
Record sequence number.

◆ get_rec_sub1()

unsigned char ossimplugins::RadarSatRecordHeader::get_rec_sub1 ( )
inline

First record sub-type code.

Definition at line 67 of file RadarSatRecordHeader.h.

References _rec_sub1.

68  {
69  return _rec_sub1;
70  };
unsigned char _rec_sub1
First record sub-type code.

◆ get_rec_sub2()

unsigned char ossimplugins::RadarSatRecordHeader::get_rec_sub2 ( )
inline

Second record sub-type code.

Definition at line 83 of file RadarSatRecordHeader.h.

References _rec_sub2.

84  {
85  return _rec_sub2;
86  };
unsigned char _rec_sub2
Second record sub-type code.

◆ get_rec_sub3()

unsigned char ossimplugins::RadarSatRecordHeader::get_rec_sub3 ( )
inline

Third record sub-type code.

Definition at line 91 of file RadarSatRecordHeader.h.

References _rec_sub3.

92  {
93  return _rec_sub3;
94  };
unsigned char _rec_sub3
Third record sub-type code.

◆ get_rec_type()

unsigned char ossimplugins::RadarSatRecordHeader::get_rec_type ( )
inline

Record type code.

Definition at line 75 of file RadarSatRecordHeader.h.

References _rec_type.

76  {
77  return _rec_type;
78  };
unsigned char _rec_type
Record type code.

◆ operator=()

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

Copy operator.

Definition at line 57 of file RadarSatRecordHeader.cpp.

References _rec_seq, _rec_sub1, _rec_sub2, _rec_sub3, and _rec_type.

58 {
59  _rec_seq=rhs._rec_seq;
60  _rec_sub1=rhs._rec_sub1;
61  _rec_type=rhs._rec_type;
62  _rec_sub2=rhs._rec_sub2;
63  _rec_sub3=rhs._rec_sub3;
64  return *this;
65 }
unsigned char _rec_sub3
Third record sub-type code.
unsigned char _rec_sub1
First record sub-type code.
unsigned char _rec_sub2
Second record sub-type code.
int _rec_seq
Record sequence number.
unsigned char _rec_type
Record type code.

◆ SwitchEndian()

void ossimplugins::RadarSatRecordHeader::SwitchEndian ( int &  value)
protected

This function switches the LSB value and the MSB value of the parameter.

Definition at line 67 of file RadarSatRecordHeader.cpp.

Referenced by ossimplugins::operator>>().

68 {
69  char buffer[4];
70  char res[4];
71 
72  memcpy(buffer,&value,4);
73  res[0] = buffer[3];
74  res[1] = buffer[2];
75  res[2] = buffer[1];
76  res[3] = buffer[0];
77 
78  memcpy(&value,res,4);
79 }

Friends And Related Function Documentation

◆ operator<<

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

This function writes the RecordHeader in a stream.

Definition at line 24 of file RadarSatRecordHeader.cpp.

25 {
26  os<<"record_sequence_number:"<<data._rec_seq<<std::endl;
27  os<<"first_record_sub-type:"<<(int)data._rec_sub1<<std::endl;
28  os<<"record_type_code:"<<(int)data._rec_type<<std::endl;
29  os<<"second_record_sub-type:"<<(int)data._rec_sub2<<std::endl;
30  os<<"third_record_sub-type:"<<(int)data._rec_sub3<<std::endl;
31  os<<"length:"<<data._length<<std::endl;
32  return os;
33 }

◆ operator>>

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

This function reads a RecordHeader from a stream.

Definition at line 35 of file RadarSatRecordHeader.cpp.

36 {
37  is.read((char*)&(data._rec_seq),4);
38  data.SwitchEndian(data._rec_seq);
39  is.read((char*)&(data._rec_sub1),1);
40  is.read((char*)&(data._rec_type),1);
41  is.read((char*)&(data._rec_sub2),1);
42  is.read((char*)&(data._rec_sub3),1);
43  is.read((char*)&(data._length),4);
44  data.SwitchEndian(data._length);
45  return is;
46 }

Member Data Documentation

◆ _length

int ossimplugins::RadarSatRecordHeader::_length
protected

Length of this record (in bytes)

Definition at line 133 of file RadarSatRecordHeader.h.

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

◆ _rec_seq

int ossimplugins::RadarSatRecordHeader::_rec_seq
protected

Record sequence number.

Definition at line 113 of file RadarSatRecordHeader.h.

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

◆ _rec_sub1

unsigned char ossimplugins::RadarSatRecordHeader::_rec_sub1
protected

First record sub-type code.

Definition at line 117 of file RadarSatRecordHeader.h.

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

◆ _rec_sub2

unsigned char ossimplugins::RadarSatRecordHeader::_rec_sub2
protected

Second record sub-type code.

Definition at line 125 of file RadarSatRecordHeader.h.

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

◆ _rec_sub3

unsigned char ossimplugins::RadarSatRecordHeader::_rec_sub3
protected

Third record sub-type code.

Definition at line 129 of file RadarSatRecordHeader.h.

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

◆ _rec_type

unsigned char ossimplugins::RadarSatRecordHeader::_rec_type
protected

Record type code.

Definition at line 121 of file RadarSatRecordHeader.h.

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


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