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