18 #include "FitsError.h"
837 RangeError (
const String& msg,
bool silent =
true);
885 UnspecifiedLengths (
const String& diag,
bool silent =
true);
921 NoNullValue (
const String& diag,
bool silent =
true);
941 bool operator==(
const Column &right)
const;
943 bool operator!=(
const Column &right)
const;
945 virtual void readData (
long firstRow,
long nelements,
long firstElem = 1) = 0;
947 virtual Column * clone ()
const = 0;
951 friend std::ostream& operator << (std::ostream& s,
const Column& right);
954 friend bool operator < (
const Column& left,
const Column& right);
956 friend bool operator > (
const Column& left,
const Column& right);
958 void unit (
const String& value);
961 void index (
int value);
965 void width (
long value);
968 double scale ()
const;
969 void scale (
double value);
970 double zero ()
const;
971 void zero (
double value);
972 const String&
display ()
const;
973 const String&
dimen ()
const;
974 void dimen (
const String& value);
977 static const String& TFORM ();
978 static const String& TDISP ();
979 static const String& TSCAL ();
980 static const String& TZERO ();
981 static const String& TDIM ();
982 const String&
format ()
const;
983 const String&
unit ()
const;
984 const String&
name ()
const;
993 template <
typename S>
994 void write (
const std::vector<S>& indata,
long firstRow);
996 void write (
const std::vector<std::complex<float> >& indata,
long firstRow);
998 void write (
const std::vector<std::complex<double> >& indata,
long firstRow);
1000 template <
typename S>
1001 void write (
const std::valarray<S>& indata,
long firstRow);
1003 void write (
const std::valarray<std::complex<float> >& indata,
long firstRow);
1005 void write (
const std::valarray<std::complex<double> >& indata,
long firstRow);
1007 template <
typename S>
1008 void write (S* indata,
long nRows,
long firstRow);
1011 template <
typename S>
1012 void write (
const std::vector<S>& indata,
long firstRow, S* nullValue);
1014 template <
typename S>
1015 void write (
const std::valarray<S>& indata,
long firstRow, S* nullValue);
1017 template <
typename S>
1018 void write (S* indata,
long nRows,
long firstRow, S* nullValue);
1028 template <
typename S>
1029 void write (
const std::valarray<S>& indata,
long nRows,
long firstRow);
1031 void write (
const std::valarray<std::complex<float> >& indata,
long nRows,
long firstRow);
1033 void write (
const std::valarray<std::complex<double> >& indata,
long nRows,
long firstRow);
1036 template <
typename S>
1037 void write (
const std::vector<S>& indata,
long nRows,
long firstRow);
1039 void write (
const std::vector<std::complex<float> >& indata,
long nRows,
long firstRow);
1041 void write (
const std::vector<std::complex<double> >& indata,
long nRows,
long firstRow);
1045 template <
typename S>
1046 void write (S* indata,
long nElements,
long nRows,
long firstRow);
1049 template <
typename S>
1050 void write (
const std::valarray<S>& indata,
long nRows,
long firstRow, S* nullValue);
1053 template <
typename S>
1054 void write (
const std::vector<S>& indata,
long nRows,
long firstRow, S* nullValue);
1056 template <
typename S>
1057 void write (S* indata,
long nElements,
long nRows,
long firstRow, S* nullValue);
1061 template <
typename S>
1062 void write (
const std::valarray<S>& indata,
1063 const std::vector<long>& vectorLengths,
1066 void write (
const std::valarray<std::complex<float> >& indata,
1067 const std::vector<long>& vectorLengths,
1070 void write (
const std::valarray<std::complex<double> >& indata,
1071 const std::vector<long>& vectorLengths,
1074 template <
typename S>
1075 void write (
const std::vector<S>& indata,
1076 const std::vector<long>& vectorLengths,
1081 void write (
const std::vector<std::complex<float> >& indata,
1082 const std::vector<long>& vectorLengths,
1085 void write (
const std::vector<std::complex<double> >& indata,
1086 const std::vector<long>& vectorLengths,
1089 template <
typename S>
1090 void write (S* indata,
long nElements,
1091 const std::vector<long>& vectorLengths,
1094 template <
typename S>
1095 void writeArrays (
const std::vector<std::valarray<S> >& indata,
long firstRow);
1097 void writeArrays (
const std::vector<std::valarray<std::complex<float> > >& indata,
long firstRow);
1099 void writeArrays (
const std::vector<std::valarray<std::complex<double> > >& indata,
long firstRow);
1101 template <
typename S>
1102 void writeArrays (
const std::vector<std::valarray<S> >& indata,
long firstRow, S* nullValue);
1108 template <
typename S>
1109 void read(std::vector<S>& vals,
long first,
long last) ;
1112 void read(std::vector< std::complex<float> >& ,
long first,
long last);
1114 void read(std::vector< std::complex<double> >& ,
long first,
long last);
1116 void read(std::vector<String>& vals,
long first,
long last);
1119 template <
typename S>
1120 void read(std::valarray<S>& vals,
long first,
long last) ;
1122 void read(std::valarray<std::complex<float> >& vals,
long first,
long last) ;
1124 void read(std::valarray<std::complex<double> >& vals,
long first,
long last) ;
1127 template <
typename S>
1128 void read(std::valarray<S>& vals,
long rows) ;
1130 void read(std::valarray<std::complex<float> >& vals,
long rows) ;
1132 void read(std::valarray<std::complex<double> >& vals,
long rows) ;
1135 template <
typename S>
1136 void readArrays(std::vector<std::valarray<S> >& vals,
long first,
long last) ;
1138 void readArrays(std::vector<std::valarray<std::complex<float> > >& vals,
long first,
long last) ;
1140 void readArrays(std::vector<std::valarray<std::complex<double> > >& vals,
long first,
long last) ;
1146 template <
typename S>
1147 void read(std::vector<S>& vals,
long first,
long last, S* nullValue) ;
1150 template <
typename S>
1151 void read(std::valarray<S>& vals,
long first,
long last, S* nullValue);
1154 template <
typename S>
1155 void read(std::valarray<S>& vals,
long rows, S* nullValue) ;
1158 template <
typename S>
1159 void readArrays(std::vector<std::valarray<S> >& vals,
long first,
long last, S* nullValue);
1162 template <
typename T>
1166 template <
typename T>
1169 void write (
const std::vector<String>& indata,
long firstRow);
1177 friend void Table::initRead();
1179 friend void Table::reindex();
1181 friend void Table::copyData(
const Table& right);
1184 const String &columnName,
1188 int rpt = 1,
long w = 1,
const String &
comment =
"");
1191 virtual bool compare (
const Column &right)
const;
1197 virtual std::ostream&
put (std::ostream& s)
const;
1199 static const String& TBCOL ();
1200 static const String& TTYPE ();
1201 static const String& TUNIT ();
1202 static const String& TNULL ();
1203 static const String& TLMIN ();
1204 static const String& TLMAX ();
1205 static const String& TDMAX ();
1206 static const String& TDMIN ();
1207 static const std::vector<String>& columnKeys ();
1208 const String&
comment ()
const;
1216 virtual void insertRows (
long first,
long number = 1) = 0;
1217 virtual void deleteRows (
long first,
long number = 1) = 0;
1218 static void loadColumnKeys ();
1219 void name (
const String& value);
1220 void format (
const String& value);
1221 long numberOfElements (
long& first,
long& last);
1224 static const String s_TBCOL;
1225 static const String s_TTYPE;
1226 static const String s_TFORM;
1227 static const String s_TDISP;
1228 static const String s_TUNIT;
1229 static const String s_TSCAL;
1230 static const String s_TZERO;
1231 static const String s_TDIM;
1232 static const String s_TNULL;
1233 static const String s_TLMIN;
1234 static const String s_TLMAX;
1235 static const String s_TDMAX;
1236 static const String s_TDMIN;
1252 static const short LLIMITSHORT;
1253 static const long LLIMITLONG;
1254 static const unsigned short LLIMITUSHORT;
1255 static const unsigned long LLIMITULONG;
1256 static const unsigned char LLIMITUCHAR;
1257 static const float LLIMITFLOAT;
1258 static const double LLIMITDOUBLE;
1259 static const short ULIMITSHORT;
1260 static const long ULIMITLONG;
1261 static const unsigned short ULIMITUSHORT;
1262 static const unsigned long ULIMITULONG;
1263 static const unsigned char ULIMITUCHAR;
1264 static const float ULIMITFLOAT;
1265 static const double ULIMITDOUBLE;
1266 static const int LLIMITINT;
1267 static const int ULIMITINT;
1268 static const unsigned int LLIMITUINT;
1269 static const unsigned int ULIMITUINT;
1270 static const LONGLONG LLIMITLONGLONG;
1271 static const LONGLONG ULIMITLONGLONG;
1275 static std::vector<String> s_columnKeys;
1313 return right.
put(s);
1316 inline bool operator < (
const Column& left,
const Column& right)
1319 return left.m_index < right.m_index;
1322 inline bool operator > (
const Column& left,
const Column& right)
1325 return left.m_index > right.m_index;
1420 inline const String& Column::TBCOL ()
1425 inline const String& Column::TTYPE ()
1430 inline const String& Column::TFORM ()
1435 inline const String& Column::TDISP ()
1440 inline const String& Column::TUNIT ()
1445 inline const String& Column::TSCAL ()
1450 inline const String& Column::TZERO ()
1455 inline const String& Column::TDIM ()
1460 inline const String& Column::TNULL ()
1465 inline const String& Column::TLMIN ()
1470 inline const String& Column::TLMAX ()
1475 inline const String& Column::TDMAX ()
1480 inline const String& Column::TDMIN ()
1485 inline const std::vector<String>& Column::columnKeys ()
1487 return s_columnKeys;