CCfits  2.4
KeywordCreator.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 KEYWORDCREATOR_H
10 #define KEYWORDCREATOR_H 1
11 
12 // KeyData
13 #include "KeyData.h"
14 // FitsError
15 #include "FitsError.h"
16 
17 namespace CCfits {
18  class HDU;
19 
20 } // namespace CCfits
21 
22 
23 namespace CCfits {
24 
25 
26 
27  class KeywordCreator
28  {
29 
30  public:
31  KeywordCreator (HDU* p);
32  virtual ~KeywordCreator();
33 
34  virtual Keyword* MakeKeyword (const String& keyName, const String& comment = String("")) = 0;
35  static Keyword* getKeyword (const String& keyName, HDU* p);
36  // Additional Public Declarations
37  virtual void reset ();
38  virtual Keyword* createKeyword (const String& keyName, const String& comment = String(""));
39  // This version of getKeyword is for reading a keyword
40  // in with a specified type.
41  static Keyword* getKeyword (const String& keyName, ValueType keyType, HDU* p);
42  static Keyword* getKeyword (int keyNumber, HDU* p);
43 
44  // Additional Public Declarations
45 
46  protected:
47  HDU* forHDU ();
48 
49  // Additional Protected Declarations
50 
51  private:
52  KeywordCreator(const KeywordCreator &right);
53  KeywordCreator & operator=(const KeywordCreator &right);
54 
55  static Keyword* parseRecord (const String& name, const String& valueString, const String& comment, HDU* hdu);
56  static bool isContinued (const String& value);
57  static void getLongValueString (HDU* p, const String& keyName, String& value);
58 
59  // Additional Private Declarations
60 
61  private: //## implementation
62  // Data Members for Class Attributes
63  Keyword *m_keyword;
64 
65  // Data Members for Associations
66  HDU* m_forHDU;
67 
68  // Additional Implementation Declarations
69 
70  };
71 
72  // Class CCfits::KeywordCreator
73 
74  inline void KeywordCreator::reset ()
75  {
76  m_keyword=0;
77 
78  }
79 
80  inline HDU* KeywordCreator::forHDU ()
81  {
82  return m_forHDU;
83  }
84 
85 } // namespace CCfits
86 
87 
88 #endif
ValueType
CCfits value types and their CFITSIO equivalents (in caps)
Definition: CCfits.h:79