<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <title>CCfits: CCfits::Keyword Class Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="doxygen.css" rel="stylesheet" type="text/css"/> </head> <body> <!-- Generated by Doxygen 1.6.1 --> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> </ul> </div> <div class="tabs"> <ul> <li><a href="annotated.html"><span>Class List</span></a></li> <li><a href="classes.html"><span>Class Index</span></a></li> <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> <li><a href="functions.html"><span>Class Members</span></a></li> </ul> </div> <div class="navpath"><b>CCfits</b>::<a class="el" href="classCCfits_1_1Keyword.html">Keyword</a> </div> </div> <div class="contents"> <h1>CCfits::Keyword Class Reference</h1><!-- doxytag: class="CCfits::Keyword" --> <p>Abstract base class defining the interface for <a class="el" href="classCCfits_1_1Keyword.html" title="Abstract base class defining the interface for Keyword objects.">Keyword</a> objects. <a href="#_details">More...</a></p> <p><code>#include <<a class="el" href="Keyword_8h_source.html">Keyword.h</a>></code></p> <p>Inherited by CCfits::KeyData< T >.</p> <p><a href="classCCfits_1_1Keyword-members.html">List of all members.</a></p> <table border="0" cellpadding="0" cellspacing="0"> <tr><td colspan="2"><h2>Public Member Functions</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a627a4ffc2199b90952dd7adf9b1ec956"></a><!-- doxytag: member="CCfits::Keyword::~Keyword" ref="a627a4ffc2199b90952dd7adf9b1ec956" args="()" --> virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="classCCfits_1_1Keyword.html#a627a4ffc2199b90952dd7adf9b1ec956">~Keyword</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">virtual destructor <br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac92a807de0401fa32f6cdbfe96dd3083"></a><!-- doxytag: member="CCfits::Keyword::clone" ref="ac92a807de0401fa32f6cdbfe96dd3083" args="() const =0" --> virtual <a class="el" href="classCCfits_1_1Keyword.html">Keyword</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classCCfits_1_1Keyword.html#ac92a807de0401fa32f6cdbfe96dd3083">clone</a> () const =0</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">virtual copy constructor <br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac0e829b447ad71bb4405d196a693a8c6"></a><!-- doxytag: member="CCfits::Keyword::comment" ref="ac0e829b447ad71bb4405d196a693a8c6" args="() const " --> const String & </td><td class="memItemRight" valign="bottom"><a class="el" href="classCCfits_1_1Keyword.html#ac0e829b447ad71bb4405d196a693a8c6">comment</a> () const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">return the comment field of the keyword <br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a92d1b379da32e959be3b2fb2fb93548e"></a><!-- doxytag: member="CCfits::Keyword::fitsPointer" ref="a92d1b379da32e959be3b2fb2fb93548e" args="() const " --> fitsfile * </td><td class="memItemRight" valign="bottom"><a class="el" href="classCCfits_1_1Keyword.html#a92d1b379da32e959be3b2fb2fb93548e">fitsPointer</a> () const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">return a pointer to the <a class="el" href="classCCfits_1_1FITS.html" title="Memory object representation of a disk FITS file.">FITS</a> file containing the parent <a class="el" href="classCCfits_1_1HDU.html" title="Base class for all HDU [Header-Data Unit] objects.">HDU</a>. <br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae0f6c4a86159817d3b0cde818d329a25"></a><!-- doxytag: member="CCfits::Keyword::name" ref="ae0f6c4a86159817d3b0cde818d329a25" args="() const " --> const String & </td><td class="memItemRight" valign="bottom"><a class="el" href="classCCfits_1_1Keyword.html#ae0f6c4a86159817d3b0cde818d329a25">name</a> () const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">return the name of a keyword <br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="abe80f519c298067a52c0792482048d53"></a><!-- doxytag: member="CCfits::Keyword::operator!=" ref="abe80f519c298067a52c0792482048d53" args="(const Keyword &right) const " --> bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classCCfits_1_1Keyword.html#abe80f519c298067a52c0792482048d53">operator!=</a> (const <a class="el" href="classCCfits_1_1Keyword.html">Keyword</a> &right) const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">inequality operator <br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a96af1f6a8a73dc4d8ec3e2ad159bb23e"></a><!-- doxytag: member="CCfits::Keyword::operator=" ref="a96af1f6a8a73dc4d8ec3e2ad159bb23e" args="(const Keyword &right)" --> <a class="el" href="classCCfits_1_1Keyword.html">Keyword</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classCCfits_1_1Keyword.html#a96af1f6a8a73dc4d8ec3e2ad159bb23e">operator=</a> (const <a class="el" href="classCCfits_1_1Keyword.html">Keyword</a> &right)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">assignment operator <br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae9278cc3de41df8efd54e44009dd50b8"></a><!-- doxytag: member="CCfits::Keyword::operator==" ref="ae9278cc3de41df8efd54e44009dd50b8" args="(const Keyword &right) const " --> bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classCCfits_1_1Keyword.html#ae9278cc3de41df8efd54e44009dd50b8">operator==</a> (const <a class="el" href="classCCfits_1_1Keyword.html">Keyword</a> &right) const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">equality operator <br/></td></tr> <tr><td class="memTemplParams" colspan="2">template<typename T > </td></tr> <tr><td class="memTemplItemLeft" align="right" valign="top">void </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classCCfits_1_1Keyword.html#acea55c0e27787efff3711a7111f79eb3">setValue</a> (const T &newValue)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">modify the value of an existing <a class="el" href="classCCfits_1_1Keyword.html" title="Abstract base class defining the interface for Keyword objects.">Keyword</a> and write it to the file <a href="#acea55c0e27787efff3711a7111f79eb3"></a><br/></td></tr> <tr><td class="memTemplParams" colspan="2">template<typename T > </td></tr> <tr><td class="memTemplItemLeft" align="right" valign="top">T & </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classCCfits_1_1Keyword.html#a4f064dcdcafe756d21c7af2a97dc2e61">value</a> (T &val) const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">get the keyword value <a href="#a4f064dcdcafe756d21c7af2a97dc2e61"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classCCfits_1_1Keyword.html#aebeab56157e11d0344076602bd10594d">write</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">left in for historical reasons, this seldom needs to be called by users <a href="#aebeab56157e11d0344076602bd10594d"></a><br/></td></tr> <tr><td colspan="2"><h2>Protected Member Functions</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classCCfits_1_1Keyword.html#a775cd61e991612a512d62fa722b7e64a">Keyword</a> (const String &keyname, ValueType keytype, <a class="el" href="classCCfits_1_1HDU.html">HDU</a> *p, const String &comment="")</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight"><a class="el" href="classCCfits_1_1Keyword.html" title="Abstract base class defining the interface for Keyword objects.">Keyword</a> constructor. <a href="#a775cd61e991612a512d62fa722b7e64a"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="afbcc174e856a3f0be7d77d1634ab0075"></a><!-- doxytag: member="CCfits::Keyword::Keyword" ref="afbcc174e856a3f0be7d77d1634ab0075" args="(const Keyword &right)" --> </td><td class="memItemRight" valign="bottom"><a class="el" href="classCCfits_1_1Keyword.html#afbcc174e856a3f0be7d77d1634ab0075">Keyword</a> (const <a class="el" href="classCCfits_1_1Keyword.html">Keyword</a> &right)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">copy constructor <br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab8dbaacd101e7b1bc3ebf5aa62493823"></a><!-- doxytag: member="CCfits::Keyword::keytype" ref="ab8dbaacd101e7b1bc3ebf5aa62493823" args="(ValueType value)" --> void </td><td class="memItemRight" valign="bottom"><a class="el" href="classCCfits_1_1Keyword.html#ab8dbaacd101e7b1bc3ebf5aa62493823">keytype</a> (ValueType value)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">set keyword type. <br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a818711c7e71c3d867bb8e9445ddf1335"></a><!-- doxytag: member="CCfits::Keyword::keytype" ref="a818711c7e71c3d867bb8e9445ddf1335" args="() const " --> ValueType </td><td class="memItemRight" valign="bottom"><a class="el" href="classCCfits_1_1Keyword.html#a818711c7e71c3d867bb8e9445ddf1335">keytype</a> () const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">return the type of a keyword <br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aee44ef253c61cbcb4ef77e3645439583"></a><!-- doxytag: member="CCfits::Keyword::parent" ref="aee44ef253c61cbcb4ef77e3645439583" args="() const " --> const <a class="el" href="classCCfits_1_1HDU.html">HDU</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classCCfits_1_1Keyword.html#aee44ef253c61cbcb4ef77e3645439583">parent</a> () const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">return a pointer to parent <a class="el" href="classCCfits_1_1HDU.html" title="Base class for all HDU [Header-Data Unit] objects.">HDU</a>. <br/></td></tr> </table> <hr/><a name="_details"></a><h2>Detailed Description</h2> <p>Abstract base class defining the interface for <a class="el" href="classCCfits_1_1Keyword.html" title="Abstract base class defining the interface for Keyword objects.">Keyword</a> objects. </p> <p><a class="el" href="classCCfits_1_1Keyword.html" title="Abstract base class defining the interface for Keyword objects.">Keyword</a> object creation is normally performed inside <a class="el" href="classCCfits_1_1FITS.html" title="Memory object representation of a disk FITS file.">FITS</a> constructors or <a class="el" href="classCCfits_1_1FITS.html#a3640e3ad1c29931b37a13ac91106504e" title="get data from single HDU from disk file.">FITS::read</a>, <a class="el" href="classCCfits_1_1HDU.html#a14e36d51401c4a0028f71d1398785616" title="read a keyword of specified type from the header of a disk FITS file and return its...">HDU::readKey</a>, and <a class="el" href="classCCfits_1_1HDU.html#a6c1b83b64794e608f71e2270c74a61d6" title="create a new keyword in the HDU with specified value and comment fields">HDU::addKey</a> functions. Output is performed in <a class="el" href="classCCfits_1_1HDU.html#a6c1b83b64794e608f71e2270c74a61d6" title="create a new keyword in the HDU with specified value and comment fields">HDU::addKey</a> functions and <a class="el" href="classCCfits_1_1Keyword.html#acea55c0e27787efff3711a7111f79eb3" title="modify the value of an existing Keyword and write it to the file">Keyword::setValue</a>.</p> <p>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.</p> <p>Typically, the mandatory keywords for a given <a class="el" href="classCCfits_1_1HDU.html" title="Base class for all HDU [Header-Data Unit] objects.">HDU</a> type are not stored as object of type <a class="el" href="classCCfits_1_1Keyword.html" title="Abstract base class defining the interface for Keyword objects.">Keyword</a>, but as intrinsic data types. The <a class="el" href="classCCfits_1_1Keyword.html" title="Abstract base class defining the interface for Keyword objects.">Keyword</a> hierarchy is used to store user-supplied information. </p> <hr/><h2>Constructor & Destructor Documentation</h2> <a class="anchor" id="a775cd61e991612a512d62fa722b7e64a"></a><!-- doxytag: member="CCfits::Keyword::Keyword" ref="a775cd61e991612a512d62fa722b7e64a" args="(const String &keyname, ValueType keytype, HDU *p, const String &comment="")" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">CCfits::Keyword::Keyword </td> <td>(</td> <td class="paramtype">const String & </td> <td class="paramname"> <em>keyname</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">ValueType </td> <td class="paramname"> <em>keytype</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="classCCfits_1_1HDU.html">HDU</a> * </td> <td class="paramname"> <em>p</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const String & </td> <td class="paramname"> <em>comment</em> = <code>""</code></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td><code> [protected]</code></td> </tr> </table> </div> <div class="memdoc"> <p><a class="el" href="classCCfits_1_1Keyword.html" title="Abstract base class defining the interface for Keyword objects.">Keyword</a> constructor. </p> <p>This is the common behavior of Keywords of any type. Constructor is protected as the class is abstract. </p> </div> </div> <hr/><h2>Member Function Documentation</h2> <a class="anchor" id="acea55c0e27787efff3711a7111f79eb3"></a><!-- doxytag: member="CCfits::Keyword::setValue" ref="acea55c0e27787efff3711a7111f79eb3" args="(const T &newValue)" --> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<typename T > </div> <table class="memname"> <tr> <td class="memname">void CCfits::Keyword::setValue </td> <td>(</td> <td class="paramtype">const T & </td> <td class="paramname"> <em>newValue</em></td> <td> ) </td> <td><code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>modify the value of an existing <a class="el" href="classCCfits_1_1Keyword.html" title="Abstract base class defining the interface for Keyword objects.">Keyword</a> and write it to the file </p> <p>Parameters: </p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>newValue</em> </td><td>(T) New value for the <a class="el" href="classCCfits_1_1Keyword.html" title="Abstract base class defining the interface for Keyword objects.">Keyword</a></td></tr> </table> </dd> </dl> <p><b>Allowed T types:</b> This must copy <em>newValue</em> to a data member of type U in the <a class="el" href="classCCfits_1_1Keyword.html" title="Abstract base class defining the interface for Keyword objects.">Keyword</a> subclass <b>KeyData<U></b> (see description for <a class="el" href="classCCfits_1_1Keyword.html#a4f064dcdcafe756d21c7af2a97dc2e61" title="get the keyword value">Keyword::value</a> (T& val) for more details). To avoid compilation errors, it is generally best to provide a <em>newValue</em> of type T = type U, though the following type conversions will also be handled:</p> <table border="0" align="left" cellspacing="3" cellpadding="3"> <tr> <td><p><b>T</b> (from newValue)</p> </td><td><p><b>U</b> (to <a class="el" href="classCCfits_1_1Keyword.html" title="Abstract base class defining the interface for Keyword objects.">Keyword</a> obj) </p> </td></tr> <tr> <td><p>float</p> </td><td><p>double, float </p> </td></tr> <tr> <td><p>double</p> </td><td><p>double, float (will lose precision) </p> </td></tr> <tr> <td><p>int</p> </td><td><p>double, float, int, integer string </p> </td></tr> </table> </div> </div> <a class="anchor" id="a4f064dcdcafe756d21c7af2a97dc2e61"></a><!-- doxytag: member="CCfits::Keyword::value" ref="a4f064dcdcafe756d21c7af2a97dc2e61" args="(T &val) const " --> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<typename T > </div> <table class="memname"> <tr> <td class="memname">T & CCfits::Keyword::value </td> <td>(</td> <td class="paramtype">T & </td> <td class="paramname"> <em>val</em></td> <td> ) </td> <td> const<code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>get the keyword value </p> <p>Parameters: </p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>val</em> </td><td>(T) Will be filled with the keyword value, and is also the function return value.</td></tr> </table> </dd> </dl> <p><b>Allowed T types:</b> CCfits stores keyword values of type U in a templated subclass of <a class="el" href="classCCfits_1_1Keyword.html" title="Abstract base class defining the interface for Keyword objects.">Keyword</a>, <b>KeyData<U></b>. Normally U is set when reading the <a class="el" href="classCCfits_1_1Keyword.html" title="Abstract base class defining the interface for Keyword objects.">Keyword</a> in from the file, and is limited to types int, double, string, bool, and complex<float>. (The exception is when the user has created and added a new <a class="el" href="classCCfits_1_1Keyword.html" title="Abstract base class defining the interface for Keyword objects.">Keyword</a> using an <a class="el" href="classCCfits_1_1HDU.html#a6c1b83b64794e608f71e2270c74a61d6" title="create a new keyword in the HDU with specified value and comment fields">HDU::addKey</a> function, in which case they might have specified other types for U.) To avoid compilation errors, the user should generally try to provide a <em>val</em> of type T = type U, though there is some flexibility here as the following conversions are handled:</p> <table border="0" align="left" cellspacing="3" cellpadding="3"> <tr> <td><p><b>T</b> (to val)</p> </td><td><p><b>U</b> (from <a class="el" href="classCCfits_1_1Keyword.html" title="Abstract base class defining the interface for Keyword objects.">Keyword</a> obj) </p> </td></tr> <tr> <td><p>float</p> </td><td><p>double (will lose precision), float, int, integer string </p> </td></tr> <tr> <td><p>double</p> </td><td><p>double, float, int, integer string </p> </td></tr> <tr> <td><p>int</p> </td><td><p>int, integer string </p> </td></tr> </table> <p>More conversions may be added in the future as the need arises. </p> </div> </div> <a class="anchor" id="aebeab56157e11d0344076602bd10594d"></a><!-- doxytag: member="CCfits::Keyword::write" ref="aebeab56157e11d0344076602bd10594d" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void CCfits::Keyword::write </td> <td>(</td> <td class="paramname"></td> <td> ) </td> <td><code> [virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p>left in for historical reasons, this seldom needs to be called by users </p> <p>This writes the <a class="el" href="classCCfits_1_1Keyword.html" title="Abstract base class defining the interface for Keyword objects.">Keyword</a> to the file, and is called internally during <a class="el" href="classCCfits_1_1HDU.html#a6c1b83b64794e608f71e2270c74a61d6" title="create a new keyword in the HDU with specified value and comment fields">HDU::addKey</a> operations or the <a class="el" href="classCCfits_1_1Keyword.html#acea55c0e27787efff3711a7111f79eb3" title="modify the value of an existing Keyword and write it to the file">Keyword::setValue</a> function. It shouldn't normally need to be called explicitly. </p> </div> </div> <hr/>The documentation for this class was generated from the following files:<ul> <li><a class="el" href="Keyword_8h_source.html">Keyword.h</a></li> <li>Keyword.cxx</li> <li><a class="el" href="KeywordT_8h_source.html">KeywordT.h</a></li> </ul> </div> <hr size="1"/><address style="text-align: right;"><small>Generated on Wed Sep 9 11:59:47 2009 for CCfits by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address> </body> </html>