Official websites use .gov
A .gov website belongs to an official government organization in the United States.

Secure .gov websites use HTTPS
A lock ( ) or https:// means you’ve safely connected to the .gov website. Share sensitive information only on official, secure websites.

Isis Developer Reference
SerialNumberList.h
Go to the documentation of this file.
1#ifndef SerialNumberList_h
2#define SerialNumberList_h
7
8/* SPDX-License-Identifier: CC0-1.0 */
9
10#include <map>
11#include <vector>
12
13#include <QString>
14
15namespace Isis {
16
17 class Progress;
18 class Pvl;
19
64
66 public:
67 SerialNumberList(bool checkTarget = true);
68 SerialNumberList(const QString &list, bool checkTarget = true, Progress *progress = NULL);
69 virtual ~SerialNumberList();
70
71 void add(const QString &filename, bool def2filename = false);
72 void add(Pvl &p, const QString &filename, bool def2filename = false);
73 void add(const QString &serialNumber, const QString &filename);
74 void add(const char *serialNumber, const char *filename);
75 bool hasSerialNumber(QString sn);
76
77 void remove(const QString &sn);
78
79 int size() const;
80 QString fileName(const QString &sn);
81 QString fileName(int index);
82 QString serialNumber(const QString &filename);
83 QString serialNumber(int index);
84 QString observationNumber(int index);
85 QString spacecraftInstrumentId(int index);
86 QString spacecraftInstrumentId(const QString &sn);
87
88 int serialNumberIndex(const QString &sn);
89 int fileNameIndex(const QString &filename);
90
91 std::vector<QString> possibleSerialNumbers(const QString &on);
92
93 protected:
98 struct Pair {
99 QString filename;
104 };
105
106 std::vector<Pair> m_pairs;
107 std::map<QString, int> m_serialMap;
108 std::map<QString, int> m_fileMap;
109
115 QString m_target;
116
117 };
118};
119
120#endif
Program progress reporter.
Definition Progress.h:42
virtual ~SerialNumberList()
Destructor.
Definition SerialNumberList.cpp:77
bool hasSerialNumber(QString sn)
Determines whether or not the requested serial number exists in the list.
Definition SerialNumberList.cpp:393
QString observationNumber(int index)
Return a observation number given an index.
Definition SerialNumberList.cpp:488
std::map< QString, int > m_serialMap
Maps serial numbers to their positions in the list.
Definition SerialNumberList.h:107
std::map< QString, int > m_fileMap
Maps filenames to their positions in the list.
Definition SerialNumberList.h:108
void remove(const QString &sn)
Remove the specified serial number from the list.
Definition SerialNumberList.cpp:88
QString serialNumber(const QString &filename)
Return a serial number given a filename.
Definition SerialNumberList.cpp:446
void add(const QString &filename, bool def2filename=false)
Adds a new filename / serial number pair to the SerialNumberList.
Definition SerialNumberList.cpp:121
bool m_checkTarget
Specifies whether or not to check to make sure the target names match between files added to the seri...
Definition SerialNumberList.h:114
SerialNumberList(bool checkTarget=true)
Creates an empty SerialNumberList.
Definition SerialNumberList.cpp:26
QString spacecraftInstrumentId(int index)
Return the spacecraftname/instrumentid at the given index.
Definition SerialNumberList.cpp:579
QString m_target
Target name that the files must have if m_checkTarget is true.
Definition SerialNumberList.h:115
int size() const
How many serial number / filename combos are in the list.
Definition SerialNumberList.cpp:404
int serialNumberIndex(const QString &sn)
Return a list index given a serial number.
Definition SerialNumberList.cpp:510
int fileNameIndex(const QString &filename)
Return a list index given a filename.
Definition SerialNumberList.cpp:537
std::vector< Pair > m_pairs
List of serial number Pair entities.
Definition SerialNumberList.h:106
std::vector< QString > possibleSerialNumbers(const QString &on)
Return possible serial numbers given an observation number.
Definition SerialNumberList.cpp:633
QString fileName(const QString &sn)
Return a filename given a serial number.
Definition SerialNumberList.cpp:419
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16
A serial number list entity that contains the filename serial number pair.
Definition SerialNumberList.h:98
QString observationNumber
Definition SerialNumberList.h:101
QString filename
Definition SerialNumberList.h:99
QString serialNumber
Definition SerialNumberList.h:100
QString spacecraftName
Definition SerialNumberList.h:102
QString instrumentId
Definition SerialNumberList.h:103