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