Isis 3 Programmer Reference
SerialNumberList.h
Go to the documentation of this file.
1 #ifndef SerialNumberList_h
2 #define SerialNumberList_h
3 
26 #include <map>
27 #include <vector>
28 
29 #include <QString>
30 
31 namespace Isis {
32 
33  class Progress;
34 
81  public:
82  SerialNumberList(bool checkTarget = true);
83  SerialNumberList(const QString &list, bool checkTarget = true, Progress *progress = NULL);
84  virtual ~SerialNumberList();
85 
86  void add(const QString &filename, bool def2filename = false);
87  void add(const QString &serialNumber, const QString &filename);
88  void add(const char *serialNumber, const char *filename);
89  bool hasSerialNumber(QString sn);
90 
91  void remove(const QString &sn);
92 
93  int size() const;
94  QString fileName(const QString &sn);
95  QString fileName(int index);
96  QString serialNumber(const QString &filename);
97  QString serialNumber(int index);
98  QString observationNumber(int index);
99  QString spacecraftInstrumentId(int index);
100  QString spacecraftInstrumentId(const QString &sn);
101 
102  int serialNumberIndex(const QString &sn);
103  int fileNameIndex(const QString &filename);
104 
105  std::vector<QString> possibleSerialNumbers(const QString &on);
106 
107  protected:
112  struct Pair {
113  QString filename;
114  QString serialNumber;
115  QString observationNumber;
116  QString spacecraftName;
117  QString instrumentId;
118  };
119 
120  std::vector<Pair> m_pairs;
121  std::map<QString, int> m_serialMap;
122  std::map<QString, int> m_fileMap;
123 
129  QString m_target;
130 
131  };
132 };
133 
134 #endif
int serialNumberIndex(const QString &sn)
Return a list index given a serial number.
bool hasSerialNumber(QString sn)
Determines whether or not the requested serial number exists in the list.
virtual ~SerialNumberList()
Destructor.
void add(const QString &filename, bool def2filename=false)
Adds a new filename / serial number pair to the SerialNumberList.
QString serialNumber(const QString &filename)
Return a serial number given a filename.
QString spacecraftInstrumentId(int index)
Return the spacecraftname/instrumentid at the given index.
std::vector< QString > possibleSerialNumbers(const QString &on)
Return possible serial numbers given an observation number.
std::map< QString, int > m_fileMap
Maps filenames to their positions in the list.
int fileNameIndex(const QString &filename)
Return a list index given a filename.
bool m_checkTarget
Specifies whether or not to check to make sure the target names match between files added to the seri...
std::map< QString, int > m_serialMap
Maps serial numbers to their positions in the list.
QString fileName(const QString &sn)
Return a filename given a serial number.
A serial number list entity that contains the filename serial number pair.
std::vector< Pair > m_pairs
List of serial number Pair entities.
Program progress reporter.
Definition: Progress.h:58
QString m_target
Target name that the files must have if m_checkTarget is true.
int size() const
How many serial number / filename combos are in the list.
QString observationNumber(int index)
Return a observation number given an index.
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
SerialNumberList(bool checkTarget=true)
Creates an empty SerialNumberList.
Serial Number list generator.