CCfits 2.6

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

- File List

NewKeyword.h
1 // Astrophysics Science Division,
2 // NASA/ Goddard Space Flight Center
3 // HEASARC
4 // http://heasarc.gsfc.nasa.gov
5 // e-mail: ccfits@legacy.gsfc.nasa.gov
6 //
7 // Original author: Ben Dorman
8
9 #ifndef NEWKEYWORD_H
10 #define NEWKEYWORD_H 1
11
12 // KeywordCreator
13 #include "KeywordCreator.h"
14 // KeyData
15 #include "KeyData.h"
16 // FITSUtil
17 #include "FITSUtil.h"
18
19
20 namespace CCfits {
21
22
23
24 template <typename T>
25 class NewKeyword : public KeywordCreator //## Inherits: <unnamed>%39355AA90209
26 {
27
28 public:
29 // Parameterized Class NewKeyword
30 NewKeyword (HDU* p, T value);
31 virtual ~NewKeyword();
32
33 // Additional Protected Declarations
34 virtual Keyword* MakeKeyword (const String& keyName, const String& keyComment = String(""), bool isLongStr = false);
35 const T keyData () const;
36 void keyData (T value);
37
38 // Additional Public Declarations
39
40 protected:
41 // Additional Protected Declarations
42
43 private:
44 NewKeyword();
45
46 NewKeyword(const NewKeyword< T > &right);
47 NewKeyword< T > & operator=(const NewKeyword< T > &right);
48
49 // Additional Private Declarations
50
51 private: //## implementation
52 // Data Members for Class Attributes
53 T m_keyData;
54
55 // Additional Implementation Declarations
56
57 };
58
59 // Parameterized Class CCfits::NewKeyword
60
61 template <typename T>
62 inline const T NewKeyword<T>::keyData () const
63 {
64 return m_keyData;
65 }
66
67 template <typename T>
68 inline void NewKeyword<T>::keyData (T value)
69 {
70 m_keyData = value;
71 }
72
73 // Parameterized Class CCfits::NewKeyword
74
75 template <typename T>
76 NewKeyword<T>::NewKeyword (HDU* p, T value)
77 : KeywordCreator(p), m_keyData(value)
78 {
79 }
80
81
82 template <typename T>
83 NewKeyword<T>::~NewKeyword()
84 {
85 }
86
87
88 template <typename T>
89 Keyword* NewKeyword<T>::MakeKeyword (const String& keyName, const String& keyComment, bool isLongStr)
90 {
91 FITSUtil::MatchType<T> keyType;
92 return new KeyData<T>(keyName,keyType(),m_keyData,forHDU(),keyComment,isLongStr);
93 }
94
95 // Additional Declarations
96
97 } // namespace CCfits
98
99
100 #endif