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::ErsSarRecordHeader Class Reference

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

#include <ErsSarRecordHeader.h>

Public Member Functions

 ErsSarRecordHeader ()
 Constructor. More...
 
virtual ~ErsSarRecordHeader ()
 Destructor. More...
 
 ErsSarRecordHeader (const ErsSarRecordHeader &rhs)
 Copy constructor. More...
 
ErsSarRecordHeaderoperator= (const ErsSarRecordHeader &rhs)
 Copy operator. More...
 
unsigned 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...
 
unsigned int get_length ()
 Length of this record (in bytes) More...
 

Protected Member Functions

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

Protected Attributes

unsigned 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...
 
unsigned int _length
 Length of this record (in bytes) More...
 

Friends

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

Detailed Description

This class is able to read a record header.

Definition at line 26 of file ErsSarRecordHeader.h.

Constructor & Destructor Documentation

◆ ErsSarRecordHeader() [1/2]

ossimplugins::ErsSarRecordHeader::ErsSarRecordHeader ( )

Constructor.

Definition at line 18 of file ErsSarRecordHeader.cpp.

19 {
20 }

◆ ~ErsSarRecordHeader()

ossimplugins::ErsSarRecordHeader::~ErsSarRecordHeader ( )
virtual

Destructor.

Definition at line 22 of file ErsSarRecordHeader.cpp.

23 {
24 }

◆ ErsSarRecordHeader() [2/2]

ossimplugins::ErsSarRecordHeader::ErsSarRecordHeader ( const ErsSarRecordHeader rhs)

Copy constructor.

Definition at line 50 of file ErsSarRecordHeader.cpp.

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

Member Function Documentation

◆ get_length()

unsigned int ossimplugins::ErsSarRecordHeader::get_length ( )
inline

Length of this record (in bytes)

Definition at line 101 of file ErsSarRecordHeader.h.

References _length.

102  {
103  return _length;
104  };
unsigned int _length
Length of this record (in bytes)

◆ get_rec_seq()

unsigned int ossimplugins::ErsSarRecordHeader::get_rec_seq ( )
inline

Record sequence number.

Definition at line 61 of file ErsSarRecordHeader.h.

References _rec_seq.

62  {
63  return _rec_seq;
64  };
unsigned int _rec_seq
Record sequence number.

◆ get_rec_sub1()

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

First record sub-type code.

Definition at line 69 of file ErsSarRecordHeader.h.

References _rec_sub1.

70  {
71  return _rec_sub1;
72  };
unsigned char _rec_sub1
First record sub-type code.

◆ get_rec_sub2()

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

Second record sub-type code.

Definition at line 85 of file ErsSarRecordHeader.h.

References _rec_sub2.

86  {
87  return _rec_sub2;
88  };
unsigned char _rec_sub2
Second record sub-type code.

◆ get_rec_sub3()

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

Third record sub-type code.

Definition at line 93 of file ErsSarRecordHeader.h.

References _rec_sub3.

94  {
95  return _rec_sub3;
96  };
unsigned char _rec_sub3
Third record sub-type code.

◆ get_rec_type()

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

Record type code.

Definition at line 77 of file ErsSarRecordHeader.h.

References _rec_type.

78  {
79  return _rec_type;
80  };
unsigned char _rec_type
Record type code.

◆ operator=()

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

Copy operator.

Definition at line 59 of file ErsSarRecordHeader.cpp.

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

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

◆ SwitchEndian()

void ossimplugins::ErsSarRecordHeader::SwitchEndian ( unsigned int &  value)
protected

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

Definition at line 69 of file ErsSarRecordHeader.cpp.

Referenced by ossimplugins::operator>>().

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

Friends And Related Function Documentation

◆ operator<<

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

This function write the RecordHeader in a stream.

Definition at line 26 of file ErsSarRecordHeader.cpp.

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

◆ operator>>

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

This function read a RecordHeader from a stream.

Definition at line 37 of file ErsSarRecordHeader.cpp.

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

Member Data Documentation

◆ _length

unsigned int ossimplugins::ErsSarRecordHeader::_length
protected

Length of this record (in bytes)

Definition at line 135 of file ErsSarRecordHeader.h.

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

◆ _rec_seq

unsigned int ossimplugins::ErsSarRecordHeader::_rec_seq
protected

Record sequence number.

Definition at line 115 of file ErsSarRecordHeader.h.

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

◆ _rec_sub1

unsigned char ossimplugins::ErsSarRecordHeader::_rec_sub1
protected

First record sub-type code.

Definition at line 119 of file ErsSarRecordHeader.h.

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

◆ _rec_sub2

unsigned char ossimplugins::ErsSarRecordHeader::_rec_sub2
protected

Second record sub-type code.

Definition at line 127 of file ErsSarRecordHeader.h.

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

◆ _rec_sub3

unsigned char ossimplugins::ErsSarRecordHeader::_rec_sub3
protected

Third record sub-type code.

Definition at line 131 of file ErsSarRecordHeader.h.

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

◆ _rec_type

unsigned char ossimplugins::ErsSarRecordHeader::_rec_type
protected

Record type code.

Definition at line 123 of file ErsSarRecordHeader.h.

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


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