#include <Keyword.h>
Inherited by CCfits::KeyData< T >.
Public Member Functions | |
| virtual | ~Keyword () |
| virtual destructor | |
| Keyword & | operator= (const Keyword &right) |
| assignment operator | |
| bool | operator== (const Keyword &right) const |
| equality operator | |
| bool | operator!= (const Keyword &right) const |
| inequality operator | |
| virtual Keyword * | clone () const =0 |
| virtual copy constructor | |
| virtual void | write () |
| left in for historical reasons, this seldom needs to be called by users | |
| fitsfile * | fitsPointer () const |
| return a pointer to the FITS file containing the parent HDU. | |
| const String & | comment () const |
| return the comment field of the keyword | |
| const String & | name () const |
| return the name of a keyword | |
| template<typename T> | |
| T & | value (T &val) const |
| get the keyword value | |
| template<typename T> | |
| void | setValue (const T &newValue) |
| modify the value of an existing Keyword and write it to the file | |
Protected Member Functions | |
| Keyword (const Keyword &right) | |
| copy constructor | |
| Keyword (const String &keyname, ValueType keytype, HDU *p, const String &comment="") | |
| Keyword constructor. | |
| ValueType | keytype () const |
| return the type of a keyword | |
| void | keytype (ValueType value) |
| set keyword type. | |
| const HDU * | parent () const |
| return a pointer to parent HDU. | |
Keyword object creation is normally performed inside FITS constructors or FITS::read, HDU::readKey, and HDU::addKey functions. Output is performed in HDU::addKey functions and Keyword::setValue.
Keywords consists of a name, a value and a comment field. Concrete templated subclasses, KeyData<T>, have a data member that holds the value of keyword.
Typically, the mandatory keywords for a given HDU type are not stored as object of type Keyword, but as intrinsic data types. The Keyword hierarchy is used to store user-supplied information.
| CCfits::Keyword::Keyword | ( | const String & | keyname, | |
| ValueType | keytype, | |||
| HDU * | p, | |||
| const String & | comment = "" | |||
| ) | [protected] |
Keyword constructor.
This is the common behavior of Keywords of any type. Constructor is protected as the class is abstract.
| void CCfits::Keyword::write | ( | ) | [virtual] |
left in for historical reasons, this seldom needs to be called by users
This writes the Keyword to the file, and is called internally during HDU::addKey operations or the Keyword::setValue function. It shouldn't normally need to be called explicitly.
| T & CCfits::Keyword::value | ( | T & | val | ) | const [inline] |
get the keyword value
Parameters:
| val | (T) Will be filled with the keyword value, and is also the function return value. |
| T (to val) | U (from Keyword obj) |
| float | double (will lose precision), float, int, integer string |
| double | double, float, int, integer string |
| int | int, integer string |
| void CCfits::Keyword::setValue | ( | const T & | newValue | ) | [inline] |
modify the value of an existing Keyword and write it to the file
Parameters:
| newValue | (T) New value for the Keyword |
| T (from newValue) | U (to Keyword obj) |
| float | double, float |
| double | double, float (will lose precision) |
| int | double, float, int, integer string |
1.5.4