mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]
Loading...
Searching...
No Matches

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 108 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)
 Writes this card to a FITS file using fits_write_key.

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 686 of file fitsHeaderCard.hpp.

Referenced by fitsHeaderCard(), and operator=().

◆ 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 691 of file fitsHeaderCard.hpp.

References mx::fits::fitsType(), m_comment, m_keyword, m_type, m_valueGood, m_valueStr, and m_valueStrGood.

◆ 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 705 of file fitsHeaderCard.hpp.

References mx::fits::fitsType(), m_comment, m_keyword, m_type, m_valueGood, m_valueStr, and m_valueStrGood.

◆ 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 718 of file fitsHeaderCard.hpp.

References mx::fits::fitsType(), m_comment, m_keyword, m_type, m_valueGood, m_valueStr, and m_valueStrGood.

◆ 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 731 of file fitsHeaderCard.hpp.

References m_comment, m_keyword, m_type, m_valueGood, m_valueStr, m_valueStrGood, and type().

◆ 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 747 of file fitsHeaderCard.hpp.

References mx::fits::fitsType(), m_comment, m_keyword, m_type, m_valueGood, and m_valueStrGood.

◆ 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 757 of file fitsHeaderCard.hpp.

References mx::fits::fitsType(), m_comment, m_keyword, m_type, m_valueGood, and m_valueStrGood.

◆ 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 767 of file fitsHeaderCard.hpp.

References m_keyword.

◆ 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 773 of file fitsHeaderCard.hpp.

References m_keyword, m_type, and type().

◆ 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 781 of file fitsHeaderCard.hpp.

References m_comment, m_keyword, and value().

◆ fitsHeaderCard() [11/11]

template<class verboseT>
mx::fits::fitsHeaderCard< verboseT >::fitsHeaderCard ( const fitsHeaderCard< verboseT > & card)

Copy constructor.

Definition at line 789 of file fitsHeaderCard.hpp.

References fitsHeaderCard(), m_comment, m_keyword, m_type, m_valueGood, m_valueStr, and m_valueStrGood.

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 1333 of file fitsHeaderCard.hpp.

References value().

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

◆ comment() [1/2]

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

◆ 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 1485 of file fitsHeaderCard.hpp.

References m_comment, and 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 918 of file fitsHeaderCard.hpp.

References mx::fits::fitsType(), mx::invalidarg, m_keyword, m_type, mx::internal::mxlib_error_report(), mx::noerror, and mx::notimpl.

Referenced by convertValue(), and valueNonString().

◆ 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 897 of file fitsHeaderCard.hpp.

References mx::fits::fitsType(), m_type, m_valueGood, m_valueStr, mx::noerror, and mx::ioutils::stoT().

Referenced by valueNonString().

◆ 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 820 of file fitsHeaderCard.hpp.

References mx::fits::fitsType(), mx::invalidarg, m_keyword, m_type, m_valueGood, m_valueStr, m_valueStrGood, mx::internal::mxlib_error_report(), mx::noerror, and mx::paramnotset.

Referenced by convertValue(), value(), and valueStr().

◆ 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 1021 of file fitsHeaderCard.hpp.

References convertedValue(), convertToString(), mx::fits::fitsType(), mx::invalidarg, m_keyword, m_type, m_valueGood, mx::internal::mxlib_error_report(), mx::noerror, and mx::notimpl.

Referenced by type().

◆ 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 1405 of file fitsHeaderCard.hpp.

References value().

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

◆ 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 1393 of file fitsHeaderCard.hpp.

References value().

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

◆ 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 1357 of file fitsHeaderCard.hpp.

References value().

Referenced by mx::unitTest::fitsTest::fitsHeaderCardTest::TEST_CASE(), mx::unitTest::fitsTest::fitsHeaderCardTest::TEST_CASE(), mx::unitTest::fitsTest::fitsHeaderCardTest::TEST_CASE(), and 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 1143 of file fitsHeaderCard.hpp.

References m_keyword, and 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 1369 of file fitsHeaderCard.hpp.

References value().

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

◆ 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 1381 of file fitsHeaderCard.hpp.

References value().

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

◆ operator=()

template<class verboseT>
fitsHeaderCard< verboseT > & mx::fits::fitsHeaderCard< verboseT >::operator= ( const fitsHeaderCard< verboseT > & card)

Assignment.

Definition at line 801 of file fitsHeaderCard.hpp.

References fitsHeaderCard(), m_comment, m_keyword, m_type, m_valueGood, m_valueStr, and m_valueStrGood.

◆ 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 1345 of file fitsHeaderCard.hpp.

References value().

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

◆ String()

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

◆ 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 1156 of file fitsHeaderCard.hpp.

References convertValue(), m_type, m_valueGood, m_valueStrGood, and 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 1339 of file fitsHeaderCard.hpp.

References value().

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

◆ 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 1363 of file fitsHeaderCard.hpp.

References value().

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

◆ 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 1375 of file fitsHeaderCard.hpp.

References value().

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

◆ 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 1387 of file fitsHeaderCard.hpp.

References value().

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

◆ 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 1351 of file fitsHeaderCard.hpp.

References value().

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

◆ 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 1418 of file fitsHeaderCard.hpp.

References value().

◆ 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 1426 of file fitsHeaderCard.hpp.

References mx::fits::fitsType(), m_type, m_valueGood, m_valueStr, m_valueStrGood, and 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 1444 of file fitsHeaderCard.hpp.

References mx::fits::fitsType(), m_type, m_valueGood, m_valueStrGood, and 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 1234 of file fitsHeaderCard.hpp.

References valueNonString().

◆ 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 1300 of file fitsHeaderCard.hpp.

References valueNonString().

◆ 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 1294 of file fitsHeaderCard.hpp.

References valueNonString().

◆ 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 1258 of file fitsHeaderCard.hpp.

References valueNonString().

◆ 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 1270 of file fitsHeaderCard.hpp.

References valueNonString().

◆ 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 1282 of file fitsHeaderCard.hpp.

References valueNonString().

◆ 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 1246 of file fitsHeaderCard.hpp.

References valueNonString().

◆ value() [11/17]

◆ 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 1240 of file fitsHeaderCard.hpp.

References valueNonString().

◆ 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 1264 of file fitsHeaderCard.hpp.

References valueNonString().

◆ 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 1276 of file fitsHeaderCard.hpp.

References valueNonString().

◆ 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 1288 of file fitsHeaderCard.hpp.

References valueNonString().

◆ 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 1252 of file fitsHeaderCard.hpp.

References valueNonString().

◆ 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 1307 of file fitsHeaderCard.hpp.

References m_keyword, mx::internal::mxlib_error_report(), mx::noerror, and value().

◆ valueGood()

◆ 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 1187 of file fitsHeaderCard.hpp.

References convertedValue(), convertFromString(), mx::fits::fitsType(), m_type, m_valueGood, and mx::noerror.

Referenced by value(), value(), value(), value(), value(), value(), value(), value(), value(), value(), value(), and value().

◆ valueStr()

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

Get the current value string.

Returns
m_valueStr;

Definition at line 1455 of file fitsHeaderCard.hpp.

References convertToString(), m_valueStr, and m_valueStrGood.

Referenced by mx::unitTest::fitsTest::fitsHeaderCardTest::TEST_CASE(), and 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 1473 of file fitsHeaderCard.hpp.

References m_valueStrGood.

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

◆ write()

Member Data Documentation

◆ m_comment

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

◆ m_keyword

◆ m_type

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

◆ m_valueGood

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

◆ 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

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