|
CCfits
2.4
|
Abstract base class defining the interface for Keyword objects. More...
#include <Keyword.h>
Inherited by CCfits::KeyData< T >.
Public Member Functions | |
| virtual | ~Keyword () |
| virtual destructor | |
| virtual Keyword * | clone () const =0 |
| virtual copy constructor | |
| const String & | comment () const |
| return the comment field of the keyword | |
| fitsfile * | fitsPointer () const |
| return a pointer to the FITS file containing the parent HDU. | |
| ValueType | keytype () const |
| return the type of a keyword | |
| const String & | name () const |
| return the name of a keyword | |
| bool | operator!= (const Keyword &right) const |
| inequality operator | |
| Keyword & | operator= (const Keyword &right) |
| assignment operator | |
| bool | operator== (const Keyword &right) const |
| equality operator | |
| template<typename T > | |
| void | setValue (const T &newValue) |
| modify the value of an existing Keyword and write it to the file More... | |
| virtual void | write () |
| left in for historical reasons, this seldom needs to be called by users More... | |
Protected Member Functions | |
| Keyword (const Keyword &right) | |
| copy constructor | |
| Keyword (const String &keyname, ValueType keytype, HDU *p, const String &comment="") | |
| Keyword constructor. More... | |
| void | keytype (ValueType value) |
| set keyword type. | |
| const HDU * | parent () const |
| return a pointer to parent HDU. | |
Abstract base class defining the interface for Keyword objects.
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.
|
protected |
Keyword constructor.
This is the common behavior of Keywords of any type. Constructor is protected as the class is abstract.
| void CCfits::Keyword::setValue | ( | const T & | newValue | ) |
modify the value of an existing Keyword and write it to the file
| newValue | (T) New value for the Keyword |
Allowed T types: This must copy newValue to a data member of type U in the Keyword subclass KeyData<U> (see description for Keyword::value (T& val) for more details). To avoid compilation errors, it is generally best to provide a newValue of type T = type U, though the following type conversions will also be handled:
| T (from newValue) | U (to Keyword obj) |
| float | double, float |
| double | double, float (will lose precision) |
| int | double, float, int, integer string |
|
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.
1.8.6