File: ColumnCreator.h

package info (click to toggle)
ccfits 2.5%2Bdfsg-2
  • links: PTS
  • area: main
  • in suites: bullseye
  • size: 3,620 kB
  • sloc: cpp: 15,148; sh: 10,115; makefile: 91
file content (92 lines) | stat: -rw-r--r-- 2,358 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
//	Astrophysics Science Division,
//	NASA/ Goddard Space Flight Center
//	HEASARC
//	http://heasarc.gsfc.nasa.gov
//	e-mail: ccfits@legacy.gsfc.nasa.gov
//
//	Original author: Ben Dorman

#ifndef COLUMNCREATOR_H
#define COLUMNCREATOR_H 1
#include <iostream>

// ColumnVectorData
#include "ColumnVectorData.h"
// ColumnData
#include "ColumnData.h"

namespace CCfits {
  class Table;
  class Column;

} // namespace CCfits
#include <string>
#include <vector>


namespace CCfits {



  class ColumnCreator 
  {

    public:
        ColumnCreator (Table* p);
        virtual ~ColumnCreator();

        void reset ();
        //	getColumn is a calling function for MakeColumn, i.e.
        //	it specifies a column in an existing file to be  "got"
        Column * getColumn (int number, const String& name, const String& format, const String& unit = "");
        //	createColumn is for specifying input data for creating
        //	new columns in tables.
        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 = "");

      // Additional Public Declarations

    protected:
        //	MakeColumn is a virtual function that makes a Column
        //	object with appropriate data member from an existing
        //	column in a file.
        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);

      // Additional Protected Declarations

    private:
        void getScaling (int index, int& type, long& repeat, long& width, double& tscale, double& tzero);
        const Table* parent () const;
        void parent (Table* value);

      // Additional Private Declarations

    private: //## implementation
      // Data Members for Class Attributes
        Column *m_column;
        Table* m_parent;

      // Additional Implementation Declarations

  };

  // Class CCfits::ColumnCreator 

  inline void ColumnCreator::reset ()
  {
    m_column = 0;
  }

  inline const Table* ColumnCreator::parent () const
  {
    return m_parent;
  }

  inline void ColumnCreator::parent (Table* value)
  {
    m_parent = value;
  }

} // namespace CCfits


#endif