Isis 3 Programmer Reference
TableField.h
Go to the documentation of this file.
1 #ifndef TableField_h
2 #define TableField_h
3 
25 #include <vector>
26 
27 #include <QString>
28 
29 namespace Isis {
30  class PvlGroup;
63  class TableField {
64  public:
68  enum Type {
71  Text,
74  };
75 
76  //Constructors and Destructor
77  TableField(const QString &name, Type type, int size = 1);
78  TableField(PvlGroup &field);
79  ~TableField();
80 
81 
82  QString name() const;
83  Type type() const;
84  bool isInteger() const;
85  bool isDouble() const;
86  bool isText() const;
87  bool isReal() const;
88  int bytes() const;
89  int size() const;
90 
91  operator int() const;
92  operator double() const;
93  operator float() const;
94  operator QString() const;
95  operator std::vector<int>() const;
96  operator std::vector<double>() const;
97  operator std::vector<float>() const;
98 
99  void operator=(const int value);
100  void operator=(const double value);
101  void operator=(const float value);
102  void operator=(const QString &value);
103  void operator=(const std::vector<int> &values);
104  void operator=(const std::vector<double> &values);
105  void operator=(const std::vector<float> &value);
106  void operator=(const char *buf);
107  void operator=(const void *buf);
108 
109  PvlGroup pvlGroup();
110 
111  static QString toString(const TableField &field, QString delimiter = ",");
112 
113  private:
114  QString m_name;
116  int m_size;
118  int m_bytes;
119  std::vector<int> m_ivalues;
122  std::vector<double> m_dvalues;
125  std::vector<float> m_rvalues;
128  QString m_svalue;
131  };
132 };
133 
134 #endif
Type m_type
Field value type.
Definition: TableField.h:115
The values in the field are text strings with 1 byte per character.
Definition: TableField.h:71
Type type() const
Returns the enumerated value of the TableField value&#39;s type.
Definition: TableField.cpp:128
int m_size
Field size.
Definition: TableField.h:116
bool isReal() const
Determines whether the field type is Text.
Definition: TableField.cpp:166
int bytes() const
Returns the number of bytes in the field value.
Definition: TableField.cpp:175
QString m_name
Field name.
Definition: TableField.h:114
void operator=(const int value)
Sets field value equal to input if TableField::Type is Integer and size is 1.
Definition: TableField.cpp:366
std::vector< int > m_ivalues
Vector containing integer field values.
Definition: TableField.h:119
The values in the field are 4 byte integers.
Definition: TableField.h:69
std::vector< float > m_rvalues
Vector containing Real field values.
Definition: TableField.h:125
TableField(const QString &name, Type type, int size=1)
Constructs a TableField object with the given field name, field value type, and field size...
Definition: TableField.cpp:41
Contains multiple PvlContainers.
Definition: PvlGroup.h:57
bool isInteger() const
Determines whether the field type is Integer.
Definition: TableField.cpp:138
QString m_svalue
String containing text value of field.
Definition: TableField.h:128
int size() const
Returns the number of values stored for the field at each record.
Definition: TableField.cpp:184
QString name() const
Returns the name of the TableField.
Definition: TableField.cpp:113
The values in the field are 4 byte reals or floats.
Definition: TableField.h:73
~TableField()
Destroys the TableField object.
Definition: TableField.cpp:105
std::vector< double > m_dvalues
Vector containing double field values.
Definition: TableField.h:122
The values in the field are 8 byte doubles.
Definition: TableField.h:70
PvlGroup pvlGroup()
Creates and returns a PvlGroup named "Field" containing the following keywords and their respective v...
Definition: TableField.cpp:605
int m_bytes
Number of bytes in field.
Definition: TableField.h:118
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
bool isText() const
Determines whether the field type is Text.
Definition: TableField.cpp:157
Class for storing an Isis::Table&#39;s field information.
Definition: TableField.h:63
bool isDouble() const
Determines whether the field type is Double.
Definition: TableField.cpp:148
Type
This enum describes the value type for the TableField.
Definition: TableField.h:68