CCfits  2.4
KeywordCreator.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 KEYWORDCREATOR_H
00010 #define KEYWORDCREATOR_H 1
00011 
00012 // KeyData
00013 #include "KeyData.h"
00014 // FitsError
00015 #include "FitsError.h"
00016 
00017 namespace CCfits {
00018   class HDU;
00019 
00020 } // namespace CCfits
00021 
00022 
00023 namespace CCfits {
00024 
00025 
00026 
00027   class KeywordCreator 
00028   {
00029 
00030     public:
00031         KeywordCreator (HDU* p);
00032         virtual ~KeywordCreator();
00033 
00034         virtual Keyword* MakeKeyword (const String& keyName, const String& comment = String("")) = 0;
00035         static Keyword* getKeyword (const String& keyName, HDU* p);
00036         //      Additional Public Declarations
00037         virtual void reset ();
00038         virtual Keyword* createKeyword (const String& keyName, const String& comment = String(""));
00039         //      This version of getKeyword is for reading a keyword
00040         //      in with a specified type.
00041         static Keyword* getKeyword (const String& keyName, ValueType keyType, HDU* p);
00042         static Keyword* getKeyword (int keyNumber, HDU* p);
00043 
00044       // Additional Public Declarations
00045 
00046     protected:
00047         HDU* forHDU ();
00048 
00049       // Additional Protected Declarations
00050 
00051     private:
00052         KeywordCreator(const KeywordCreator &right);
00053         KeywordCreator & operator=(const KeywordCreator &right);
00054 
00055         static Keyword* parseRecord (const String& name, const String& valueString, const String& comment, HDU* hdu);
00056         static bool isContinued (const String& value);
00057         static void getLongValueString (HDU* p, const String& keyName, String& value);
00058 
00059       // Additional Private Declarations
00060 
00061     private: //## implementation
00062       // Data Members for Class Attributes
00063         Keyword *m_keyword;
00064 
00065       // Data Members for Associations
00066         HDU* m_forHDU;
00067 
00068       // Additional Implementation Declarations
00069 
00070   };
00071 
00072   // Class CCfits::KeywordCreator 
00073 
00074   inline void KeywordCreator::reset ()
00075   {
00076     m_keyword=0;
00077 
00078   }
00079 
00080   inline HDU* KeywordCreator::forHDU ()
00081   {
00082     return m_forHDU;
00083   }
00084 
00085 } // namespace CCfits
00086 
00087 
00088 #endif