Isis 3 Programmer Reference
HiCalTypes.h
1#ifndef HiCalTypes_h
2#define HiCalTypes_h
3
10/* SPDX-License-Identifier: CC0-1.0 */
11
12#include <string>
13#include <vector>
14#include <iostream>
15#include <sstream>
16
17#include "tnt_array1d.h"
18#include "tnt_array1d_utils.h"
19#include "tnt_array2d.h"
20#include "tnt_array2d_utils.h"
21
22#include "IString.h"
23#include "PvlKeyword.h"
24
25namespace Isis {
26
27typedef TNT::Array1D<double> HiVector;
28typedef TNT::Array2D<double> HiMatrix;
29
30class HiHistory {
31 public:
39 friend std::ostream &operator<<(std::ostream &o, const HiHistory &h) {
40 std::vector<QString>::const_iterator it = h._events.begin();
41
42 while (it != h._events.end()) {
43 o << *it << "; ";
44 it++;
45 }
46 return (o);
47 }
48
49 public:
50 HiHistory() { }
51 HiHistory(const HiHistory &h) : _events(h._events) { }
52 virtual ~HiHistory() { }
53
54 inline int size() const { return (_events.size()); }
55 void add(const QString &event) { _events.push_back(event); }
56 QString get(unsigned int index = 0) const {
57 if (index < _events.size()) {
58 return (_events[index]);
59 }
60 else {
61 return (QString(""));
62 }
63 }
64
65 void clear() { _events.clear(); }
66
67 PvlKeyword makekey(const QString &name = "History") const {
68 PvlKeyword key(name);
69 for (unsigned int i = 0 ; i < _events.size() ; i++) {
70 key.addValue(_events[i]);
71 }
72 return (key);
73 }
74
75 private:
76 std::vector<QString> _events;
77};
78
79};
80#endif
friend std::ostream & operator<<(std::ostream &o, const HiHistory &h)
Output operator for history events.
Definition HiCalTypes.h:39
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16
TNT::Array2D< double > HiMatrix
2-D buffer
Definition HiCalTypes.h:28
TNT::Array1D< double > HiVector
1-D Buffer
Definition HiCalTypes.h:27