casacore
Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Friends | List of all members
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. More...
 
FitsKeywordoperator= (const FitsKeyword &)
 
 ~FitsKeyword ()
 
const char * name () const
 get info about the name More...
 
int namelen () const
 
Bool isreserved () const
 
Bool isindexed () const
 
const ReservedFitsKeywordkw () const
 
int index () const
 
const char * comm () const
 access the keyword comment More...
 
int commlen () const
 
int err () const
 access the error status More...
 
FITS::ValueType type () const
 the datatype of the keyword More...
 
Bool asBool () const
 access the value of the keyword More...
 
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 More...
 
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 More...
 
void name (const char *)
 change the name of the keyword More...
 

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 More...
 
 FitsKeyword (const ReservedFitsKeyword *, int, FITS::ValueType, const void *, int, const char *, int)
 constructs reserved keywords parms: resword, index, val, vallen, comm, commlen More...
 

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 More...
 
const ReservedFitsKeywordkw_
 
int ndx
 
short namelen_
 
char * comm_
 the keyword comment if comm_ is 0, there is no comment More...
 
short commlen_
 
FITS::ValueType type_
 the keyword value More...
 
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 515 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 643 of file fits.h.

References init().

◆ ~FitsKeyword()

casacore::FitsKeyword::~FitsKeyword ( )
inline

Definition at line 647 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 669 of file fits.h.

References bval.

◆ asComplex()

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

Definition at line 708 of file fits.h.

References val.

◆ asDComplex()

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

Definition at line 710 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 706 of file fits.h.

References val.

◆ asInt()

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

Definition at line 673 of file fits.h.

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

◆ asString()

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

Definition at line 670 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 663 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 665 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 666 of file fits.h.

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

◆ err() [2/2]

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

◆ index()

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

Definition at line 661 of file fits.h.

References ndx.

◆ init()

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

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

◆ isindexed()

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

Definition at line 660 of file fits.h.

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

◆ isreserved()

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

Definition at line 654 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 653 of file fits.h.

References kw_.

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

◆ memchk()

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

◆ name() [1/2]

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

get info about the name

Definition at line 657 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 659 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 713 of file fits.h.

References bval, casacore::FITS::LOGICAL, and type_.

◆ operator=() [2/9]

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

Definition at line 723 of file fits.h.

References casacore::FITS::COMPLEX, type_, and val.

◆ operator=() [3/9]

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

◆ operator=() [4/9]

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

Definition at line 645 of file fits.h.

References comm_, del_val(), init(), and name_.

◆ operator=() [5/9]

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

Definition at line 725 of file fits.h.

References casacore::FITS::DCOMPLEX, type_, and val.

◆ operator=() [6/9]

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

Definition at line 719 of file fits.h.

References casacore::FITS::DOUBLE, dval, and type_.

◆ operator=() [7/9]

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

Definition at line 717 of file fits.h.

References casacore::FITS::FLOAT, fval, and type_.

◆ operator=() [8/9]

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

Definition at line 721 of file fits.h.

References casacore::FITS::ICOMPLEX, type_, and val.

◆ operator=() [9/9]

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

Definition at line 715 of file fits.h.

References 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 667 of file fits.h.

References type_.

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

◆ valStrlen()

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

Definition at line 672 of file fits.h.

References vallen.

◆ value()

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

Friends And Related Function Documentation

◆ FitsKeywordList

friend class FitsKeywordList
friend

Definition at line 516 of file fits.h.

◆ FitsParse

friend class FitsParse
friend

Definition at line 517 of file fits.h.

Member Data Documentation

◆ 

union { ... }

◆ bval

Bool casacore::FitsKeyword::bval

Definition at line 608 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 599 of file fits.h.

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

◆ commlen_

short casacore::FitsKeyword::commlen_
private

Definition at line 600 of file fits.h.

Referenced by commlen().

◆ dval

double casacore::FitsKeyword::dval

Definition at line 611 of file fits.h.

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

◆ fval

float casacore::FitsKeyword::fval

Definition at line 610 of file fits.h.

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

◆ ival

Int casacore::FitsKeyword::ival

Definition at line 609 of file fits.h.

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

◆ kw_

const ReservedFitsKeyword* casacore::FitsKeyword::kw_
private

Definition at line 591 of file fits.h.

Referenced by 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 590 of file fits.h.

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

◆ namelen_

short casacore::FitsKeyword::namelen_
private

Definition at line 593 of file fits.h.

Referenced by name(), and namelen().

◆ ndx

int casacore::FitsKeyword::ndx
private

Definition at line 592 of file fits.h.

Referenced by index(), and isindexed().

◆ next_

FitsKeyword* casacore::FitsKeyword::next_
private

Definition at line 583 of file fits.h.

◆ prev_

FitsKeyword* casacore::FitsKeyword::prev_
private

Definition at line 584 of file fits.h.

◆ type_

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

the keyword value

Definition at line 606 of file fits.h.

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

◆ val

void* casacore::FitsKeyword::val
private

Definition at line 613 of file fits.h.

Referenced by asComplex(), asDComplex(), asIComplex(), asString(), and operator=().

◆ vallen

short casacore::FitsKeyword::vallen
private

Definition at line 614 of file fits.h.

Referenced by asString(), and valStrlen().


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