00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef COLUMNCREATOR_H
00010 #define COLUMNCREATOR_H 1
00011 #include <iostream>
00012
00013
00014 #include "ColumnVectorData.h"
00015
00016 #include "ColumnData.h"
00017
00018 namespace CCfits {
00019 class Table;
00020 class Column;
00021
00022 }
00023 #include <string>
00024 #include <vector>
00025
00026
00027 namespace CCfits {
00028
00029
00030
00031 class ColumnCreator
00032 {
00033
00034 public:
00035 ColumnCreator (Table* p);
00036 virtual ~ColumnCreator();
00037
00038 void reset ();
00039
00040
00041 Column * getColumn (int number, const String& name, const String& format, const String& unit = "");
00042
00043
00044 Column * createColumn (int number, ValueType type, const String &name, const String &format, const String &unit, long repeat = 1, long width = 1, double scaleFactor = 1., double offset = 0, const String &comment = "");
00045
00046
00047
00048 protected:
00049
00050
00051
00052 virtual Column * MakeColumn (const int index, const String &name, const String &format, const String &unit, const long repeat, const long width, const String &comment = "", const int decimals = 0);
00053
00054
00055
00056 private:
00057 void getScaling (int index, int& type, long& repeat, long& width, double& tscale, double& tzero);
00058 const Table* parent () const;
00059 void parent (Table* value);
00060
00061
00062
00063 private:
00064
00065 Column *m_column;
00066 Table* m_parent;
00067
00068
00069
00070 };
00071
00072
00073
00074 inline void ColumnCreator::reset ()
00075 {
00076 m_column = 0;
00077 }
00078
00079 inline const Table* ColumnCreator::parent () const
00080 {
00081 return m_parent;
00082 }
00083
00084 inline void ColumnCreator::parent (Table* value)
00085 {
00086 m_parent = value;
00087 }
00088
00089 }
00090
00091
00092 #endif