CCfits: ColumnCreator.h Source File

CCfits 2.7

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List

ColumnCreator.h

    00001 //  Astrophysics Science Division,
    00002 //  NASA/ Goddard Space Flight Center
    00003 //  HEASARC
    00004 //  http://heasarc.gsfc.nasa.gov
    00005 //  e-mail: ccfits@legacy.gsfc.nasa.gov
    00006 //
    00007 //  Original author: Ben Dorman
    00008
    00009 #ifndef COLUMNCREATOR_H
    00010 #define COLUMNCREATOR_H 1
    00011 #include <iostream>
    00012
    00013 // ColumnVectorData
    00014 #include "ColumnVectorData.h"
    00015 // ColumnData
    00016 #include "ColumnData.h"
    00017
    00018 namespace CCfits {
    00019   class Table;
    00020   class Column;
    00021
    00022 } // namespace CCfits
    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         //  getColumn is a calling function for MakeColumn, i.e.
    00040         //  it specifies a column in an existing file to be  "got"
    00041         Column * getColumn (int number, const String& name, const String& format, const String& unit = "");
    00042         //  createColumn is for specifying input data for creating
    00043         //  new columns in tables.
    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       // Additional Public Declarations
    00047
    00048     protected:
    00049         //  MakeColumn is a virtual function that makes a Column
    00050         //  object with appropriate data member from an existing
    00051         //  column in a file.
    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       // Additional Protected Declarations
    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       // Additional Private Declarations
    00062
    00063     private: //## implementation
    00064       // Data Members for Class Attributes
    00065         Column *m_column;
    00066         Table* m_parent;
    00067
    00068       // Additional Implementation Declarations
    00069
    00070   };
    00071
    00072   // Class CCfits::ColumnCreator
    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 } // namespace CCfits
    00090
    00091
    00092 #endif