mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]
Loading...
Searching...
No Matches
mx::fits::fitsHeaderCard< verboseT > Class Template Reference

template<class verboseT = verbose::d>
class mx::fits::fitsHeaderCard< verboseT >

Class to manage the three components of a FITS header card.

Since FITS does not provide the type in keyword=value pairs in a FITS header, it is up to the user to determine the type. Furthermore, since we want to read values from files, type conversions must be done at runtime. The result is that we must be able to accept a string, which is converted to a given type on demand as determined at runtime.

Conversion from string to native type, or vice versa, only occurs when needed. So if you set the value to, say, a double, the value is not converted to string format unless specifically requested. If the write function is called when in this state, the cfitsio routine is called directly. This conversion only on demand is most important for values read from a file, then written to another file. In this case, no conversion to its double (etc) representation occurs.

Note that because of the checks to determine the type and appropriate return values, accessing the value in a card is possibly slower than accessing a variable due to various if statements and error checking. This means that you should typically do so once and use a local variable for repeated use.

Definition at line 118 of file fitsHeaderCard.hpp.

#include <ioutils/fits/fitsHeaderCard.hpp>

Classes

union  values
 The native type is held in a union. More...
 

Public Member Functions

template<typename typeT >
typeT value (mx::error_t *errc=nullptr)
 Get the value.
 
std::string String (error_t *errc=nullptr)
 Get the value as a string.
 
char Char (error_t *errc=nullptr)
 Get the value as a char.
 
unsigned char UChar (error_t *errc=nullptr)
 Get the value as an unsigned char.
 
short Short (error_t *errc=nullptr)
 Get the value as a short.
 
unsigned short UShort (error_t *errc=nullptr)
 Get the value as an unsigned short.
 
int Int (error_t *errc=nullptr)
 Get the value as a int.
 
unsigned int UInt (error_t *errc=nullptr)
 Get the value as an unsigned int.
 
long Long (error_t *errc=nullptr)
 Get the value as a long.
 
unsigned long ULong (error_t *errc=nullptr)
 Get the value as an unsigned long.
 
long long LongLong (error_t *errc=nullptr)
 Get the value as a long long.
 
unsigned long long ULongLong (error_t *errc=nullptr)
 Get the value as an unsigned long long.
 
float Float (error_t *errc=nullptr)
 Get the value as a float.
 
std::complex< float > complexFloat (error_t *errc=nullptr)
 Get the value as a std::complex<float>
 
double Double (error_t *errc=nullptr)
 Get the value as a double.
 
std::complex< double > complexDouble (error_t *errc=nullptr)
 Get the value as a std::complex<double>
 
error_t value (const char *v)
 Set the value to a char * string.
 
error_t value (const std::string &v)
 Set the value to a std::string.
 
template<typename typeT >
mx::error_t value (const typeT &v)
 Set the value for a non-string type.
 
std::string valueStr ()
 Get the current value string.
 
bool valueGood ()
 Get the current value good flag.
 
bool valueStrGood ()
 Get the current value string good flag.
 
const std::string & comment ()
 Get the comment.
 
error_t comment (const std::string &c)
 Set the comment.
 
Constructors
 fitsHeaderCard ()
 Basic c'tor.
 
 fitsHeaderCard (const std::string &k, const std::string &v, const std::string &c="")
 Construct from the three components for a value of string type.
 
 fitsHeaderCard (const std::string &k, char *v, const std::string &c="")
 Construct from the three components for a value of string type.
 
 fitsHeaderCard (const std::string &k, const char *v, const std::string &c="")
 Construct from the three components for a value of string type.
 
 fitsHeaderCard (const std::string &k, const std::string &v, const int &type, const std::string &c="")
 Construct from the three components, when already in a string format.
 
 fitsHeaderCard (const std::string &k, fitsCommentType v, const std::string &c)
 Construct from the three components, when it's really a comment card.
 
 fitsHeaderCard (const std::string &k, fitsHistoryType v, const std::string &c)
 Construct from the three components, when it's really a history card.
 
 fitsHeaderCard (const std::string &k)
 Construct from just keyword, when value's type is unknown.
 
 fitsHeaderCard (const std::string &k, const int type)
 Construct from just keyword, when value's type known.
 
template<typename typeT >
 fitsHeaderCard (const std::string &k, const typeT v, const std::string &c="")
 Construct from the three components for a char.
 
 fitsHeaderCard (const fitsHeaderCard &card)
 Copy constructor.
 
fitsHeaderCardoperator= (const fitsHeaderCard &card)
 Assignment.
 
Accessors
const std::string & keyword () const
 Get the keyword.
 
error_t keyword (const std::string &kw)
 Set the keyword.
 
int type () const
 Get the type.
 
error_t type (const int &t)
 Set the type.
 
Output
mx::error_t write (fitsfile *fptr)
 

Protected Member Functions

Converters
mx::error_t convertToString ()
 Convert from the type to a string.
 
template<typename typeT >
error_t convertFromString ()
 Convert from string to the type.
 
template<typename typeT >
error_t convertedValue (typeT &cval)
 Get the value from its type converted to a different type.
 
error_t convertValue (int newtype)
 Convert the value from its type to a different type.
 
tag dispatching for getting value
template<typename typeT >
typeT valueNonString (mx::error_t &errc)
 Get value for anything not a string.
 
std::string value (meta::tagT< std::string >, mx::error_t &errc)
 Get value tag dispatcher for std::string.
 
char value (meta::tagT< char >, mx::error_t &errc)
 Get value tag dispatcher for char.
 
unsigned char value (meta::tagT< unsigned char >, mx::error_t &errc)
 Get value tag dispatcher for unsigned char.
 
short value (meta::tagT< short >, mx::error_t &errc)
 Get value tag dispatcher for short.
 
unsigned short value (meta::tagT< unsigned short >, mx::error_t &errc)
 Get value tag dispatcher for unsigned short.
 
int value (meta::tagT< int >, mx::error_t &errc)
 Get value tag dispatcher for int.
 
unsigned int value (meta::tagT< unsigned int >, mx::error_t &errc)
 Get value tag dispatcher for unsigned int.
 
long value (meta::tagT< long >, mx::error_t &errc)
 Get value tag dispatcher for long.
 
unsigned long value (meta::tagT< unsigned long >, mx::error_t &errc)
 Get value tag dispatcher for unsigned long.
 
long long value (meta::tagT< long long >, mx::error_t &errc)
 Get value tag dispatcher for long long.
 
unsigned long long value (meta::tagT< unsigned long long >, mx::error_t &errc)
 Get value tag dispatcher for unsigned long long.
 
float value (meta::tagT< float >, mx::error_t &errc)
 Get value tag dispatcher for float.
 
double value (meta::tagT< double >, mx::error_t &errc)
 Get value tag dispatcher for double.
 

Protected Attributes

std::string m_keyword
 The keyword.
 
int m_type { fitsType<fitsUnknownType>() }
 The FITS type of the value, and indicates which member of m_values to access.
 
std::stringstream m_valueStr
 The value in string form.
 
bool m_valueGood { false }
 Flag indicating if the value is valid.
 
bool m_valueStrGood { false }
 Flag indicating if the value string is valid.
 
std::string m_comment
 The comment.
 

Constructor & Destructor Documentation

◆ fitsHeaderCard() [1/11]

template<class verboseT >
mx::fits::fitsHeaderCard< verboseT >::fitsHeaderCard ( )

Basic c'tor.

Definition at line 697 of file fitsHeaderCard.hpp.

◆ fitsHeaderCard() [2/11]

template<class verboseT >
mx::fits::fitsHeaderCard< verboseT >::fitsHeaderCard ( const std::string &  k,
const std::string &  v,
const std::string &  c = "" 
)

Construct from the three components for a value of string type.

Parameters
[in]kthe keyword
[in]vthe value string
[in]cthe comment

Definition at line 702 of file fitsHeaderCard.hpp.

◆ fitsHeaderCard() [3/11]

template<class verboseT >
mx::fits::fitsHeaderCard< verboseT >::fitsHeaderCard ( const std::string &  k,
char *  v,
const std::string &  c = "" 
)

Construct from the three components for a value of string type.

Have to provide overload for char * to avoid template version

Parameters
[in]kthe keyword
[in]vthe value string
[in]cthe comment

Definition at line 716 of file fitsHeaderCard.hpp.

◆ fitsHeaderCard() [4/11]

template<class verboseT >
mx::fits::fitsHeaderCard< verboseT >::fitsHeaderCard ( const std::string &  k,
const char *  v,
const std::string &  c = "" 
)

Construct from the three components for a value of string type.

Have to provide overload for const char * to avoid template version

Parameters
[in]kthe keyword
[in]vthe value string
[in]cthe comment

Definition at line 729 of file fitsHeaderCard.hpp.

◆ fitsHeaderCard() [5/11]

template<class verboseT >
mx::fits::fitsHeaderCard< verboseT >::fitsHeaderCard ( const std::string &  k,
const std::string &  v,
const int &  type,
const std::string &  c = "" 
)

Construct from the three components, when already in a string format.

Use this when the value is not a string

Parameters
[in]kthe keyword
[in]vthe value string
[in]typethe type of the value
[in]cthe comment

Definition at line 742 of file fitsHeaderCard.hpp.

◆ fitsHeaderCard() [6/11]

template<class verboseT >
mx::fits::fitsHeaderCard< verboseT >::fitsHeaderCard ( const std::string &  k,
fitsCommentType  v,
const std::string &  c 
)

Construct from the three components, when it's really a comment card.

This overload is provided to facilitate handling of comments when re-writing the file.

Parameters
[in]kthe keyword
[in]van object of type fitsCommentType
[in]cthe comment

Definition at line 758 of file fitsHeaderCard.hpp.

◆ fitsHeaderCard() [7/11]

template<class verboseT >
mx::fits::fitsHeaderCard< verboseT >::fitsHeaderCard ( const std::string &  k,
fitsHistoryType  v,
const std::string &  c 
)

Construct from the three components, when it's really a history card.

This overload is provided to facilitate handling of history when re-writing the file.

Parameters
[in]kthe keyword
[in]van object of type fitsHistoryType
[in]cthe comment

Definition at line 768 of file fitsHeaderCard.hpp.

◆ fitsHeaderCard() [8/11]

template<class verboseT >
mx::fits::fitsHeaderCard< verboseT >::fitsHeaderCard ( const std::string &  k)
explicit

Construct from just keyword, when value's type is unknown.

Parameters
[in]kthe keyword

Definition at line 778 of file fitsHeaderCard.hpp.

◆ fitsHeaderCard() [9/11]

template<class verboseT >
mx::fits::fitsHeaderCard< verboseT >::fitsHeaderCard ( const std::string &  k,
const int  type 
)

Construct from just keyword, when value's type known.

Parameters
[in]kthe keyword
[in]typethe type

Definition at line 784 of file fitsHeaderCard.hpp.

◆ fitsHeaderCard() [10/11]

template<class verboseT >
template<typename typeT >
mx::fits::fitsHeaderCard< verboseT >::fitsHeaderCard ( const std::string &  k,
const typeT  v,
const std::string &  c = "" 
)

Construct from the three components for a char.

Parameters
[in]kthey keyword
[in]vthe value
[in]cthe comment

Definition at line 792 of file fitsHeaderCard.hpp.

◆ fitsHeaderCard() [11/11]

Member Function Documentation

◆ Char()

template<class verboseT >
char mx::fits::fitsHeaderCard< verboseT >::Char ( error_t errc = nullptr)

Get the value as a char.

This calls value<char>().

Returns
the value converted to char as necessary
Parameters
[in]errc[optional] error code

Definition at line 1341 of file fitsHeaderCard.hpp.

◆ comment() [1/2]

template<class verboseT >
const std::string & mx::fits::fitsHeaderCard< verboseT >::comment ( )

Get the comment.

Returns
the value of m_comment

Definition at line 1487 of file fitsHeaderCard.hpp.

Referenced by mx::unitTest::fitsTest::fitsHeaderCardTest::TEST_CASE(), and mx::unitTest::fitsTest::fitsHeaderCardTest::TEST_CASE().

◆ comment() [2/2]

template<class verboseT >
error_t mx::fits::fitsHeaderCard< verboseT >::comment ( const std::string &  c)

Set the comment.

Returns
error_t::noerror on success
Parameters
[in]cthe new comment

Definition at line 1493 of file fitsHeaderCard.hpp.

References mx::noerror.

◆ complexDouble()

template<class verboseT = verbose::d>
std::complex< double > mx::fits::fitsHeaderCard< verboseT >::complexDouble ( error_t errc = nullptr)

Get the value as a std::complex<double>

This calls value<std::complex<double>>().

Returns
the value converted to std::complex<double> as necessary
Parameters
[in]errc[optional] error code

◆ complexFloat()

template<class verboseT = verbose::d>
std::complex< float > mx::fits::fitsHeaderCard< verboseT >::complexFloat ( error_t errc = nullptr)

Get the value as a std::complex<float>

This calls value<std::complex<float>>().

Returns
the value converted to std::complex<float> as necessary
Parameters
[in]errc[optional] error code

◆ convertedValue()

template<class verboseT >
template<typename typeT >
error_t mx::fits::fitsHeaderCard< verboseT >::convertedValue ( typeT &  cval)
protected

Get the value from its type converted to a different type.

Parameters
[out]cvalthe converted value

Definition at line 924 of file fitsHeaderCard.hpp.

References mx::invalidarg, mx::noerror, and mx::notimpl.

◆ convertFromString()

template<class verboseT >
template<typename typeT >
error_t mx::fits::fitsHeaderCard< verboseT >::convertFromString ( )
protected

Convert from string to the type.

This populates the appropriate union field and sets m_valueGood so that this conversion only occurs once.

Definition at line 903 of file fitsHeaderCard.hpp.

References mx::noerror.

◆ convertToString()

template<class verboseT >
mx::error_t mx::fits::fitsHeaderCard< verboseT >::convertToString ( )
protected

Convert from the type to a string.

This populates m_valueStr and sets m_valueStrGood so that this conversion only occurs once.

Definition at line 826 of file fitsHeaderCard.hpp.

References mx::invalidarg, mx::noerror, and mx::paramnotset.

◆ convertValue()

template<class verboseT >
error_t mx::fits::fitsHeaderCard< verboseT >::convertValue ( int  newtype)
protected

Convert the value from its type to a different type.

Parameters
[in]newtypethe new type

Definition at line 1027 of file fitsHeaderCard.hpp.

References mx::invalidarg, mx::noerror, and mx::notimpl.

◆ Double()

template<class verboseT >
double mx::fits::fitsHeaderCard< verboseT >::Double ( error_t errc = nullptr)

Get the value as a double.

This calls value<double>().

Returns
the value converted to double as necessary
Parameters
[in]errc[optional] error code

Definition at line 1413 of file fitsHeaderCard.hpp.

◆ Float()

template<class verboseT >
float mx::fits::fitsHeaderCard< verboseT >::Float ( error_t errc = nullptr)

Get the value as a float.

This calls value<float>().

Returns
the value converted to float as necessary
Parameters
[in]errc[optional] error code

Definition at line 1401 of file fitsHeaderCard.hpp.

◆ Int()

template<class verboseT >
int mx::fits::fitsHeaderCard< verboseT >::Int ( error_t errc = nullptr)

Get the value as a int.

This calls value<int>().

Returns
the value converted to int as necessary
Parameters
[in]errc[optional] error code

Definition at line 1365 of file fitsHeaderCard.hpp.

Referenced by mx::unitTest::fitsTest::fitsHeaderCardTest::TEST_CASE().

◆ keyword() [1/2]

◆ keyword() [2/2]

template<class verboseT >
error_t mx::fits::fitsHeaderCard< verboseT >::keyword ( const std::string &  kw)

Set the keyword.

Returns
error_t::noerror on success
Parameters
[in]kwthe new keyword

Definition at line 1155 of file fitsHeaderCard.hpp.

References mx::noerror.

◆ Long()

template<class verboseT >
long mx::fits::fitsHeaderCard< verboseT >::Long ( error_t errc = nullptr)

Get the value as a long.

This calls value<long>().

Returns
the value converted to long as necessary
Parameters
[in]errc[optional] error code

Definition at line 1377 of file fitsHeaderCard.hpp.

◆ LongLong()

template<class verboseT >
long long mx::fits::fitsHeaderCard< verboseT >::LongLong ( error_t errc = nullptr)

Get the value as a long long.

This calls value<long long>().

Returns
the value converted to long long as necessary
Parameters
[in]errc[optional] error code

Definition at line 1389 of file fitsHeaderCard.hpp.

◆ operator=()

◆ Short()

template<class verboseT >
short mx::fits::fitsHeaderCard< verboseT >::Short ( error_t errc = nullptr)

Get the value as a short.

This calls value<short>().

Returns
the value converted to short as necessary
Parameters
[in]errc[optional] error code

Definition at line 1353 of file fitsHeaderCard.hpp.

◆ String()

template<class verboseT >
std::string mx::fits::fitsHeaderCard< verboseT >::String ( error_t errc = nullptr)

Get the value as a string.

This calls value<string>().

Returns
the value converted to string as necessary
Parameters
[in]errc[optional] error code

Definition at line 1335 of file fitsHeaderCard.hpp.

Referenced by mx::unitTest::fitsTest::fitsHeaderCardTest::TEST_CASE(), and mx::unitTest::fitsTest::fitsHeaderCardTest::TEST_CASE().

◆ type() [1/2]

◆ type() [2/2]

template<class verboseT >
error_t mx::fits::fitsHeaderCard< verboseT >::type ( const int &  t)

Set the type.

If this is a change in type and the native type is set in m_value (indicated by m_valueGood == true) then it is converted to the new type. Otherwise, no conversion occurs.

Returns
error_t::noerror on success
Parameters
[in]tthe new type

Definition at line 1168 of file fitsHeaderCard.hpp.

References mx::noerror.

◆ UChar()

template<class verboseT >
unsigned char mx::fits::fitsHeaderCard< verboseT >::UChar ( error_t errc = nullptr)

Get the value as an unsigned char.

This calls value<unsigned char>().

Returns
the value converted to unsigned char as necessary
Parameters
[in]errc[optional] error code

Definition at line 1347 of file fitsHeaderCard.hpp.

◆ UInt()

template<class verboseT >
unsigned int mx::fits::fitsHeaderCard< verboseT >::UInt ( error_t errc = nullptr)

Get the value as an unsigned int.

This calls value<unsigned int>().

Returns
the value converted to unsigned int as necessary
Parameters
[in]errc[optional] error code

Definition at line 1371 of file fitsHeaderCard.hpp.

◆ ULong()

template<class verboseT >
unsigned long mx::fits::fitsHeaderCard< verboseT >::ULong ( error_t errc = nullptr)

Get the value as an unsigned long.

This calls value<unsigned long>().

Returns
the value converted to unsigned long as necessary
Parameters
[in]errc[optional] error code

Definition at line 1383 of file fitsHeaderCard.hpp.

◆ ULongLong()

template<class verboseT >
unsigned long long mx::fits::fitsHeaderCard< verboseT >::ULongLong ( error_t errc = nullptr)

Get the value as an unsigned long long.

This calls value<unsigned long long>().

Returns
the value converted to unsigned long long as necessaryvalue(
Parameters
[in]errc[optional] error code

Definition at line 1395 of file fitsHeaderCard.hpp.

◆ UShort()

template<class verboseT >
unsigned short mx::fits::fitsHeaderCard< verboseT >::UShort ( error_t errc = nullptr)

Get the value as an unsigned short.

This calls value<unsigned short>().

Returns
the value converted to unsigned short as necessary
Parameters
[in]errc[optional] error code

Definition at line 1359 of file fitsHeaderCard.hpp.

◆ value() [1/17]

template<class verboseT >
mx::error_t mx::fits::fitsHeaderCard< verboseT >::value ( const char *  v)

Set the value to a char * string.

Parameters
[in]va character string

Definition at line 1426 of file fitsHeaderCard.hpp.

◆ value() [2/17]

template<class verboseT >
mx::error_t mx::fits::fitsHeaderCard< verboseT >::value ( const std::string &  v)

Set the value to a std::string.

Parameters
[in]va std::string

Definition at line 1434 of file fitsHeaderCard.hpp.

References mx::noerror.

◆ value() [3/17]

template<class verboseT >
template<typename typeT >
mx::error_t mx::fits::fitsHeaderCard< verboseT >::value ( const typeT &  v)

Set the value for a non-string type.

Parameters
[in]vthe value to set

Definition at line 1452 of file fitsHeaderCard.hpp.

References mx::noerror.

◆ value() [4/17]

template<class verboseT >
char mx::fits::fitsHeaderCard< verboseT >::value ( meta::tagT< char >  ,
mx::error_t errc 
)
protected

Get value tag dispatcher for char.

Calls valueNonString

Definition at line 1242 of file fitsHeaderCard.hpp.

◆ value() [5/17]

template<class verboseT >
double mx::fits::fitsHeaderCard< verboseT >::value ( meta::tagT< double >  ,
mx::error_t errc 
)
protected

Get value tag dispatcher for double.

Calls valueNonString

Definition at line 1308 of file fitsHeaderCard.hpp.

◆ value() [6/17]

template<class verboseT >
float mx::fits::fitsHeaderCard< verboseT >::value ( meta::tagT< float >  ,
mx::error_t errc 
)
protected

Get value tag dispatcher for float.

Calls valueNonString

Definition at line 1302 of file fitsHeaderCard.hpp.

◆ value() [7/17]

template<class verboseT >
int mx::fits::fitsHeaderCard< verboseT >::value ( meta::tagT< int >  ,
mx::error_t errc 
)
protected

Get value tag dispatcher for int.

Calls valueNonString

Definition at line 1266 of file fitsHeaderCard.hpp.

◆ value() [8/17]

template<class verboseT >
long mx::fits::fitsHeaderCard< verboseT >::value ( meta::tagT< long >  ,
mx::error_t errc 
)
protected

Get value tag dispatcher for long.

Calls valueNonString

Definition at line 1278 of file fitsHeaderCard.hpp.

◆ value() [9/17]

template<class verboseT >
long long mx::fits::fitsHeaderCard< verboseT >::value ( meta::tagT< long long >  ,
mx::error_t errc 
)
protected

Get value tag dispatcher for long long.

Calls valueNonString

Definition at line 1290 of file fitsHeaderCard.hpp.

◆ value() [10/17]

template<class verboseT >
short mx::fits::fitsHeaderCard< verboseT >::value ( meta::tagT< short >  ,
mx::error_t errc 
)
protected

Get value tag dispatcher for short.

Calls valueNonString

Definition at line 1254 of file fitsHeaderCard.hpp.

◆ value() [11/17]

template<class verboseT >
std::string mx::fits::fitsHeaderCard< verboseT >::value ( meta::tagT< std::string >  ,
mx::error_t errc 
)
protected

Get value tag dispatcher for std::string.

Definition at line 1219 of file fitsHeaderCard.hpp.

References mx::noerror.

Referenced by mx::unitTest::fitsTest::fitsHeaderCardTest::TEST_CASE(), and mx::unitTest::fitsTest::fitsHeaderCardTest::TEST_CASE().

◆ value() [12/17]

template<class verboseT >
unsigned char mx::fits::fitsHeaderCard< verboseT >::value ( meta::tagT< unsigned char >  ,
mx::error_t errc 
)
protected

Get value tag dispatcher for unsigned char.

Calls valueNonString

Definition at line 1248 of file fitsHeaderCard.hpp.

◆ value() [13/17]

template<class verboseT >
unsigned int mx::fits::fitsHeaderCard< verboseT >::value ( meta::tagT< unsigned int >  ,
mx::error_t errc 
)
protected

Get value tag dispatcher for unsigned int.

Calls valueNonString

Definition at line 1272 of file fitsHeaderCard.hpp.

◆ value() [14/17]

template<class verboseT >
unsigned long mx::fits::fitsHeaderCard< verboseT >::value ( meta::tagT< unsigned long >  ,
mx::error_t errc 
)
protected

Get value tag dispatcher for unsigned long.

Calls valueNonString

Definition at line 1284 of file fitsHeaderCard.hpp.

◆ value() [15/17]

template<class verboseT >
unsigned long long mx::fits::fitsHeaderCard< verboseT >::value ( meta::tagT< unsigned long long >  ,
mx::error_t errc 
)
protected

Get value tag dispatcher for unsigned long long.

Calls valueNonString

Definition at line 1296 of file fitsHeaderCard.hpp.

◆ value() [16/17]

template<class verboseT >
unsigned short mx::fits::fitsHeaderCard< verboseT >::value ( meta::tagT< unsigned short >  ,
mx::error_t errc 
)
protected

Get value tag dispatcher for unsigned short.

Calls valueNonString

Definition at line 1260 of file fitsHeaderCard.hpp.

◆ value() [17/17]

template<class verboseT >
template<typename typeT >
typeT mx::fits::fitsHeaderCard< verboseT >::value ( mx::error_t errc = nullptr)

Get the value.

Returns the value as typeT. Conversions occur automatically if necessary.

Returns
the value converted to typeT as necessary

Errors

Parameters
[in]errc[optional] error code

Definition at line 1315 of file fitsHeaderCard.hpp.

References mx::noerror.

◆ valueGood()

template<class verboseT >
bool mx::fits::fitsHeaderCard< verboseT >::valueGood ( )

Get the current value good flag.

Returns
m_valueGood;

Definition at line 1475 of file fitsHeaderCard.hpp.

Referenced by mx::unitTest::fitsTest::fitsHeaderCardTest::TEST_CASE().

◆ valueNonString()

template<class verboseT >
template<typename typeT >
typeT mx::fits::fitsHeaderCard< verboseT >::valueNonString ( mx::error_t errc)
protected

Get value for anything not a string.

Definition at line 1199 of file fitsHeaderCard.hpp.

References mx::noerror.

◆ valueStr()

template<class verboseT >
std::string mx::fits::fitsHeaderCard< verboseT >::valueStr ( )

Get the current value string.

Returns
m_valueStr;

Definition at line 1463 of file fitsHeaderCard.hpp.

Referenced by mx::unitTest::fitsTest::fitsHeaderCardTest::TEST_CASE().

◆ valueStrGood()

template<class verboseT >
bool mx::fits::fitsHeaderCard< verboseT >::valueStrGood ( )

Get the current value string good flag.

Returns
m_valueStrGood;

Definition at line 1481 of file fitsHeaderCard.hpp.

Referenced by mx::unitTest::fitsTest::fitsHeaderCardTest::TEST_CASE().

◆ write()

template<class verboseT >
mx::error_t mx::fits::fitsHeaderCard< verboseT >::write ( fitsfile *  fptr)

Writes this card to a FITS file, using mx::improc::fits_write_key<typename typeT>(fitsfile * fptr, char * keyword, void * value, char * comment).

Definition at line 1550 of file fitsHeaderCard.hpp.

References mx::fits::fits_write_key< bool >(), and mx::invalidarg.

Member Data Documentation

◆ m_comment

template<class verboseT = verbose::d>
std::string mx::fits::fitsHeaderCard< verboseT >::m_comment
protected

◆ m_keyword

template<class verboseT = verbose::d>
std::string mx::fits::fitsHeaderCard< verboseT >::m_keyword
protected

◆ m_type

template<class verboseT = verbose::d>
int mx::fits::fitsHeaderCard< verboseT >::m_type { fitsType<fitsUnknownType>() }
protected

The FITS type of the value, and indicates which member of m_values to access.

Definition at line 126 of file fitsHeaderCard.hpp.

Referenced by mx::fits::fitsHeaderCard< verboseT >::fitsHeaderCard(), and mx::fits::fitsHeaderCard< verboseT >::operator=().

◆ m_valueGood

template<class verboseT = verbose::d>
bool mx::fits::fitsHeaderCard< verboseT >::m_valueGood { false }
protected

Flag indicating if the value is valid.

Definition at line 272 of file fitsHeaderCard.hpp.

Referenced by mx::fits::fitsHeaderCard< verboseT >::fitsHeaderCard(), and mx::fits::fitsHeaderCard< verboseT >::operator=().

◆ m_valueStr

template<class verboseT = verbose::d>
std::stringstream mx::fits::fitsHeaderCard< verboseT >::m_valueStr
protected

◆ m_valueStrGood

template<class verboseT = verbose::d>
bool mx::fits::fitsHeaderCard< verboseT >::m_valueStrGood { false }
protected

Flag indicating if the value string is valid.

Definition at line 273 of file fitsHeaderCard.hpp.

Referenced by mx::fits::fitsHeaderCard< verboseT >::fitsHeaderCard(), and mx::fits::fitsHeaderCard< verboseT >::operator=().


The documentation for this class was generated from the following file: