casacore
Loading...
Searching...
No Matches
casacore::FitsKeyword Class Reference

FITS keyword. More...

#include <fits.h>

Public Member Functions

 FitsKeyword (const FitsKeyword &)
 A word about friends: FitsKeywordList accesses the next and prev pointers and the FitsKeyword constructors.
FitsKeywordoperator= (const FitsKeyword &)
 ~FitsKeyword ()
const char * name () const
 get info about the name
int namelen () const
Bool isreserved () const
Bool isindexed () const
const ReservedFitsKeywordkw () const
int index () const
const char * comm () const
 access the keyword comment
int commlen () const
int err () const
 access the error status
FITS::ValueType type () const
 the datatype of the keyword
Bool asBool () const
 access the value of the keyword
const char * asString () const
int valStrlen () const
Int asInt () const
float asFloat () const
double asDouble () const
IComplex asIComplex () const
Complex asComplex () const
DComplex asDComplex () const
const void * value () const
FitsKeywordoperator= (Bool)
 change the value of the keyword
FitsKeywordoperator= (const char *)
FitsKeywordoperator= (Int)
FitsKeywordoperator= (float)
FitsKeywordoperator= (double)
FitsKeywordoperator= (IComplex)
FitsKeywordoperator= (Complex)
FitsKeywordoperator= (DComplex)
void comm (const char *)
 change the comment of the keyword
void name (const char *)
 change the name of the keyword

Private Member Functions

void del_val ()
void init (const FitsKeyword &)
void setval (const FITS::ValueType &, const void *, int)
void setcomm (const char *, int)
 FitsKeyword (const char *, int, FITS::ValueType, const void *, int, const char *, int)
 private constructors for use by friends
 FitsKeyword (const ReservedFitsKeyword *, int, FITS::ValueType, const void *, int, const char *, int)
 constructs reserved keywords parms: resword, index, val, vallen, comm, commlen

Static Private Member Functions

static void err (const char *, const FITS::ValueType &, const void *, const char *)
static void memchk (void *)

Private Attributes

FitsKeywordnext_
FitsKeywordprev_
char * name_
 the keyword name if name_ is 0, keyword is not a user defined name if ndx is 0, there is no index
const ReservedFitsKeywordkw_
int ndx
short namelen_
char * comm_
 the keyword comment if comm_ is 0, there is no comment
short commlen_
FITS::ValueType type_
 the keyword value
union { 
   Bool   bval 
   Int   ival 
   float   fval 
   double   dval 
}; 
void * val
short vallen

Friends

class FitsKeywordList
class FitsParse

Detailed Description

FITS keyword.

Review Status

Reviewed By:
UNKNOWN
Date Reviewed:
before2004/08/25

Synopsis

A FITS keyword contains a name, a value and a comment.

Definition at line 634 of file fits.h.

Constructor & Destructor Documentation

◆ FitsKeyword() [1/3]

casacore::FitsKeyword::FitsKeyword ( const FitsKeyword & k)
inline

A word about friends: FitsKeywordList accesses the next and prev pointers and the FitsKeyword constructors.

FitsParse only accesses the FitsKeyword constructors.

Definition at line 762 of file fits.h.

References comm_, FitsKeyword(), casacore::init(), kw_, name_, next_, prev_, and val.

Referenced by FitsKeyword(), FitsParse, init(), operator=(), operator=(), operator=(), operator=(), operator=(), operator=(), operator=(), operator=(), operator=(), and value().

◆ ~FitsKeyword()

casacore::FitsKeyword::~FitsKeyword ( )
inline

Definition at line 766 of file fits.h.

References comm_, del_val(), and name_.

◆ FitsKeyword() [2/3]

casacore::FitsKeyword::FitsKeyword ( const char * ,
int ,
FITS::ValueType ,
const void * ,
int ,
const char * ,
int  )
private

private constructors for use by friends

constructs user-defined keywords parms: name, namelen, type, val, vallen, comm, commlen

◆ FitsKeyword() [3/3]

casacore::FitsKeyword::FitsKeyword ( const ReservedFitsKeyword * ,
int ,
FITS::ValueType ,
const void * ,
int ,
const char * ,
int  )
private

constructs reserved keywords parms: resword, index, val, vallen, comm, commlen

Member Function Documentation

◆ asBool()

Bool casacore::FitsKeyword::asBool ( ) const
inline

access the value of the keyword

Definition at line 788 of file fits.h.

References bval.

◆ asComplex()

Complex casacore::FitsKeyword::asComplex ( ) const
inline

Definition at line 827 of file fits.h.

References val.

◆ asDComplex()

DComplex casacore::FitsKeyword::asDComplex ( ) const
inline

Definition at line 829 of file fits.h.

References val.

◆ asDouble()

double casacore::FitsKeyword::asDouble ( ) const
inline

◆ asFloat()

float casacore::FitsKeyword::asFloat ( ) const
inline

◆ asIComplex()

IComplex casacore::FitsKeyword::asIComplex ( ) const
inline

Definition at line 825 of file fits.h.

References val.

◆ asInt()

Int casacore::FitsKeyword::asInt ( ) const
inline

Definition at line 792 of file fits.h.

References ival, casacore::FITS::LONG, and type().

◆ asString()

const char * casacore::FitsKeyword::asString ( ) const
inline

Definition at line 789 of file fits.h.

References val, and vallen.

◆ comm() [1/2]

const char * casacore::FitsKeyword::comm ( ) const
inline

access the keyword comment

Definition at line 782 of file fits.h.

References comm_.

◆ comm() [2/2]

void casacore::FitsKeyword::comm ( const char * )

change the comment of the keyword

◆ commlen()

int casacore::FitsKeyword::commlen ( ) const
inline

Definition at line 784 of file fits.h.

References commlen_.

◆ del_val()

void casacore::FitsKeyword::del_val ( )
private

Referenced by operator=(), and ~FitsKeyword().

◆ err() [1/2]

int casacore::FitsKeyword::err ( ) const
inline

access the error status

Definition at line 785 of file fits.h.

References casacore::FITS::ERRWORD, kw(), and name().

◆ err() [2/2]

void casacore::FitsKeyword::err ( const char * ,
const FITS::ValueType & ,
const void * ,
const char *  )
staticprivate

◆ index()

int casacore::FitsKeyword::index ( ) const
inline

Definition at line 780 of file fits.h.

References ndx.

◆ init()

void casacore::FitsKeyword::init ( const FitsKeyword & )
private

References FitsKeyword().

◆ isindexed()

Bool casacore::FitsKeyword::isindexed ( ) const
inline

Definition at line 779 of file fits.h.

References casacore::False, ndx, and casacore::True.

◆ isreserved()

Bool casacore::FitsKeyword::isreserved ( ) const
inline

Definition at line 773 of file fits.h.

References casacore::FITS::ERRWORD, casacore::False, kw(), name(), casacore::True, and casacore::FITS::USER_DEF.

Referenced by name().

◆ kw()

const ReservedFitsKeyword & casacore::FitsKeyword::kw ( ) const
inline

Definition at line 772 of file fits.h.

References kw_.

Referenced by err(), isreserved(), and name().

◆ memchk()

void casacore::FitsKeyword::memchk ( void * )
staticprivate

◆ name() [1/2]

const char * casacore::FitsKeyword::name ( ) const
inline

get info about the name

Definition at line 776 of file fits.h.

References casacore::ReservedFitsKeyword::aname(), isreserved(), kw(), name_, and namelen_.

Referenced by err(), and isreserved().

◆ name() [2/2]

void casacore::FitsKeyword::name ( const char * )

change the name of the keyword

◆ namelen()

int casacore::FitsKeyword::namelen ( ) const
inline

Definition at line 778 of file fits.h.

References namelen_.

◆ operator=() [1/9]

FitsKeyword & casacore::FitsKeyword::operator= ( Bool x)
inline

change the value of the keyword

Definition at line 832 of file fits.h.

References bval, FitsKeyword(), casacore::FITS::LOGICAL, and type_.

◆ operator=() [2/9]

FitsKeyword & casacore::FitsKeyword::operator= ( Complex x)
inline

Definition at line 842 of file fits.h.

References casacore::FITS::COMPLEX, FitsKeyword(), type_, and val.

◆ operator=() [3/9]

FitsKeyword & casacore::FitsKeyword::operator= ( const char * )

References FitsKeyword().

◆ operator=() [4/9]

FitsKeyword & casacore::FitsKeyword::operator= ( const FitsKeyword & k)
inline

Definition at line 764 of file fits.h.

References comm_, del_val(), FitsKeyword(), casacore::init(), and name_.

◆ operator=() [5/9]

FitsKeyword & casacore::FitsKeyword::operator= ( DComplex x)
inline

Definition at line 844 of file fits.h.

References casacore::FITS::DCOMPLEX, FitsKeyword(), type_, and val.

◆ operator=() [6/9]

FitsKeyword & casacore::FitsKeyword::operator= ( double x)
inline

Definition at line 838 of file fits.h.

References casacore::FITS::DOUBLE, dval, FitsKeyword(), and type_.

◆ operator=() [7/9]

FitsKeyword & casacore::FitsKeyword::operator= ( float x)
inline

Definition at line 836 of file fits.h.

References FitsKeyword(), casacore::FITS::FLOAT, fval, and type_.

◆ operator=() [8/9]

FitsKeyword & casacore::FitsKeyword::operator= ( IComplex x)
inline

Definition at line 840 of file fits.h.

References FitsKeyword(), casacore::FITS::ICOMPLEX, type_, and val.

◆ operator=() [9/9]

FitsKeyword & casacore::FitsKeyword::operator= ( Int x)
inline

Definition at line 834 of file fits.h.

References FitsKeyword(), ival, casacore::FITS::LONG, and type_.

◆ setcomm()

void casacore::FitsKeyword::setcomm ( const char * ,
int  )
private

◆ setval()

void casacore::FitsKeyword::setval ( const FITS::ValueType & ,
const void * ,
int  )
private

◆ type()

FITS::ValueType casacore::FitsKeyword::type ( ) const
inline

the datatype of the keyword

Definition at line 786 of file fits.h.

References type_.

Referenced by asDouble(), asFloat(), and asInt().

◆ valStrlen()

int casacore::FitsKeyword::valStrlen ( ) const
inline

Definition at line 791 of file fits.h.

References vallen.

◆ value()

const void * casacore::FitsKeyword::value ( ) const

References FitsKeyword().

◆ FitsKeywordList

friend class FitsKeywordList
friend

Definition at line 635 of file fits.h.

References FitsKeywordList.

Referenced by FitsKeywordList.

◆ FitsParse

friend class FitsParse
friend

Definition at line 636 of file fits.h.

References FitsKeyword(), and FitsParse.

Referenced by FitsParse.

Member Data Documentation

◆ [union]

union { ... } casacore::FitsKeyword

◆ bval

Bool casacore::FitsKeyword::bval

Definition at line 727 of file fits.h.

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

◆ comm_

char* casacore::FitsKeyword::comm_
private

the keyword comment if comm_ is 0, there is no comment

Definition at line 718 of file fits.h.

Referenced by comm(), FitsKeyword(), operator=(), and ~FitsKeyword().

◆ commlen_

short casacore::FitsKeyword::commlen_
private

Definition at line 719 of file fits.h.

Referenced by commlen().

◆ dval

double casacore::FitsKeyword::dval

Definition at line 730 of file fits.h.

Referenced by asDouble(), asFloat(), and operator=().

◆ fval

float casacore::FitsKeyword::fval

Definition at line 729 of file fits.h.

Referenced by asDouble(), asFloat(), and operator=().

◆ ival

Int casacore::FitsKeyword::ival

Definition at line 728 of file fits.h.

Referenced by asDouble(), asFloat(), asInt(), and operator=().

◆ kw_

const ReservedFitsKeyword* casacore::FitsKeyword::kw_
private

Definition at line 710 of file fits.h.

Referenced by FitsKeyword(), and kw().

◆ name_

char* casacore::FitsKeyword::name_
private

the keyword name if name_ is 0, keyword is not a user defined name if ndx is 0, there is no index

Definition at line 709 of file fits.h.

Referenced by FitsKeyword(), name(), operator=(), and ~FitsKeyword().

◆ namelen_

short casacore::FitsKeyword::namelen_
private

Definition at line 712 of file fits.h.

Referenced by name(), and namelen().

◆ ndx

int casacore::FitsKeyword::ndx
private

Definition at line 711 of file fits.h.

Referenced by index(), and isindexed().

◆ next_

FitsKeyword* casacore::FitsKeyword::next_
private

Definition at line 702 of file fits.h.

Referenced by FitsKeyword().

◆ prev_

FitsKeyword* casacore::FitsKeyword::prev_
private

Definition at line 703 of file fits.h.

Referenced by FitsKeyword().

◆ type_

FITS::ValueType casacore::FitsKeyword::type_
private

the keyword value

Definition at line 725 of file fits.h.

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

◆ val

void* casacore::FitsKeyword::val
private

◆ vallen

short casacore::FitsKeyword::vallen
private

Definition at line 733 of file fits.h.

Referenced by asString(), and valStrlen().


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