CCfits  2.4
NewKeyword.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 NEWKEYWORD_H
00010 #define NEWKEYWORD_H 1
00011 
00012 // KeywordCreator
00013 #include "KeywordCreator.h"
00014 // KeyData
00015 #include "KeyData.h"
00016 // FITSUtil
00017 #include "FITSUtil.h"
00018 
00019 
00020 namespace CCfits {
00021 
00022 
00023 
00024   template <typename T>
00025   class NewKeyword : public KeywordCreator  //## Inherits: <unnamed>%39355AA90209
00026   {
00027 
00028     public:
00029         //      Parameterized Class NewKeyword
00030         NewKeyword (HDU* p, T value);
00031         virtual ~NewKeyword();
00032 
00033         //      Additional Protected Declarations
00034         virtual Keyword* MakeKeyword (const String& keyName, const String& keyComment = String(""));
00035         const T keyData () const;
00036         void keyData (T value);
00037 
00038       // Additional Public Declarations
00039 
00040     protected:
00041       // Additional Protected Declarations
00042 
00043     private:
00044         NewKeyword();
00045 
00046         NewKeyword(const NewKeyword< T > &right);
00047         NewKeyword< T > & operator=(const NewKeyword< T > &right);
00048 
00049       // Additional Private Declarations
00050 
00051     private: //## implementation
00052       // Data Members for Class Attributes
00053         T m_keyData;
00054 
00055       // Additional Implementation Declarations
00056 
00057   };
00058 
00059   // Parameterized Class CCfits::NewKeyword 
00060 
00061   template <typename T>
00062   inline const T NewKeyword<T>::keyData () const
00063   {
00064     return m_keyData;
00065   }
00066 
00067   template <typename T>
00068   inline void NewKeyword<T>::keyData (T value)
00069   {
00070     m_keyData = value;
00071   }
00072 
00073   // Parameterized Class CCfits::NewKeyword 
00074 
00075   template <typename T>
00076   NewKeyword<T>::NewKeyword (HDU* p, T value)
00077       : KeywordCreator(p), m_keyData(value)
00078   {
00079   }
00080 
00081 
00082   template <typename T>
00083   NewKeyword<T>::~NewKeyword()
00084   {
00085   }
00086 
00087 
00088   template <typename T>
00089   Keyword* NewKeyword<T>::MakeKeyword (const String& keyName, const String& keyComment)
00090   {
00091   FITSUtil::MatchType<T> keyType;
00092   return new KeyData<T>(keyName,keyType(),m_keyData,forHDU(),keyComment);
00093   }
00094 
00095   // Additional Declarations
00096 
00097 } // namespace CCfits
00098 
00099 
00100 #endif