OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimNitfEngrdaTag.h
Go to the documentation of this file.
1 //----------------------------------------------------------------------------
2 //
3 // License: MIT
4 //
5 // See LICENSE.txt file in the top level directory for more details.
6 //
7 // Author: David Burken
8 //
9 // Description: ENGRDA - Engineering Data tag class declaration.
10 //
11 // See document STDI-0002 (version 4), Appendix N for more info.
12 //
13 //----------------------------------------------------------------------------
14 // $Id
15 
16 #ifndef ossimNitfEngrdaTag_HEADER
17 #define ossimNitfEngrdaTag_HEADER 1
18 
19 #include <string>
20 #include <vector>
21 
23 
25 {
26 public:
27 
28  enum
29  {
30  RESRC_SIZE = 20,
31  RECNT_SIZE = 3,
32  ENGLN_SIZE = 2,
33  ENGMTXC_SIZE = 4,
34  ENGMTXR_SIZE = 4,
35  ENGTYP_SIZE = 1,
36  ENGDTS_SIZE = 1,
37  ENGDATU_SIZE = 2,
38  ENGDATC_SIZE = 8,
39  TMP_BUF_SIZE = 128
40  };
41 
44 
46  virtual ~ossimNitfEngrdaTag();
47 
49  virtual void parseStream(std::istream& in);
50 
52  virtual void writeStream(std::ostream& out);
53 
55  virtual void clearFields();
56 
63  virtual std::ostream& print(std::ostream& out,
64  const std::string& prefix=std::string()) const;
65 
66 protected:
67 
70  {
71  public:
72 
82  char m_engLn[ENGLN_SIZE+1];
83 
91  std::string m_engLbl;
92 
102  char m_engMtxC[ENGMTXC_SIZE+1];
103 
113  char m_engMtxR[ENGMTXR_SIZE+1];
114 
124  char m_engTyp;
125 
135  char m_engDts;
136 
146  char m_engDatU[ENGDATU_SIZE+1];
147 
157  char m_engDatC[ENGDATC_SIZE+1];
158 
160  std::vector<ossim_uint8> m_engDat;
161  };
162 
170  std::ostream& printData(std::ostream& out,
171  const ossimEngDataElement& element,
172  ossim_uint32 elIndex,
173  const std::string& prefix) const;
174 
182  template <class T> void getValueAsString(T v,
183  ossim_uint16 w,
184  std::string& s) const;
185 
197  char m_reSrc[RESRC_SIZE+1];
198 
208  char m_reCnt[RECNT_SIZE+1];
209 
210  std::vector<ossimEngDataElement> m_data;
211 
212 TYPE_DATA
213 };
214 
215 #endif /* matches #ifndef ossimNitfEngrdaTag_HEADER */
virtual void writeStream(ossim::ostream &out)=0
virtual void parseStream(ossim::istream &in)=0
This will allow the user defined data to parse the stream.
virtual std::ostream & print(std::ostream &out, const std::string &prefix=std::string()) const
Pure virtual print method that outputs a key/value type format adding prefix to keys.
std::vector< ossimEngDataElement > m_data
unsigned short ossim_uint16
std::vector< ossim_uint8 > m_engDat
ENGDATA - data.
Container class for an Engineering Data Element Record.
#define TYPE_DATA
Definition: ossimRtti.h:339
unsigned int ossim_uint32
std::basic_istream< char > istream
Base class for char input streams.
Definition: ossimIosFwd.h:20
#define OSSIM_DLL
std::basic_ostream< char > ostream
Base class for char output streams.
Definition: ossimIosFwd.h:23