casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 519 of file fits.h.

Constructor & Destructor Documentation

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

References init().

casacore::FitsKeyword::~FitsKeyword ( )
inline

Definition at line 651 of file fits.h.

References comm_, del_val(), and name_.

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

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

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

access the value of the keyword

Definition at line 673 of file fits.h.

References bval.

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

Definition at line 712 of file fits.h.

References val.

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

Definition at line 714 of file fits.h.

References val.

double casacore::FitsKeyword::asDouble ( ) const
inline
float casacore::FitsKeyword::asFloat ( ) const
inline
IComplex casacore::FitsKeyword::asIComplex ( ) const
inline

Definition at line 710 of file fits.h.

References val.

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

Definition at line 677 of file fits.h.

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

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

Definition at line 674 of file fits.h.

References val, and vallen.

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

access the keyword comment

Definition at line 667 of file fits.h.

References comm_.

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

change the comment of the keyword

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

Definition at line 669 of file fits.h.

References commlen_.

void casacore::FitsKeyword::del_val ( )
private

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

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

access the error status

Definition at line 670 of file fits.h.

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

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

Definition at line 665 of file fits.h.

References ndx.

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

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

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

Definition at line 664 of file fits.h.

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

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

Definition at line 658 of file fits.h.

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

Referenced by name().

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

Definition at line 657 of file fits.h.

References kw_.

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

static void casacore::FitsKeyword::memchk ( void *  )
staticprivate
const char * casacore::FitsKeyword::name ( ) const
inline

get info about the name

Definition at line 661 of file fits.h.

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

Referenced by err(), and isreserved().

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

change the name of the keyword

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

Definition at line 663 of file fits.h.

References namelen_.

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

Definition at line 649 of file fits.h.

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

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

change the value of the keyword

Definition at line 717 of file fits.h.

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

FitsKeyword& casacore::FitsKeyword::operator= ( const char *  )
FitsKeyword & casacore::FitsKeyword::operator= ( Int  x)
inline

Definition at line 719 of file fits.h.

References ival, casacore::FITS::LONG, and type_.

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

Definition at line 721 of file fits.h.

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

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

Definition at line 723 of file fits.h.

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

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

Definition at line 725 of file fits.h.

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

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

Definition at line 727 of file fits.h.

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

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

Definition at line 729 of file fits.h.

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

void casacore::FitsKeyword::setcomm ( const char *  ,
int   
)
private
void casacore::FitsKeyword::setval ( const FITS::ValueType ,
const void *  ,
int   
)
private
FITS::ValueType casacore::FitsKeyword::type ( ) const
inline

the datatype of the keyword

Definition at line 671 of file fits.h.

References type_.

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

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

Definition at line 676 of file fits.h.

References vallen.

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

Friends And Related Function Documentation

friend class FitsKeywordList
friend

Definition at line 520 of file fits.h.

friend class FitsParse
friend

Definition at line 521 of file fits.h.

Member Data Documentation

union { ... }
Bool casacore::FitsKeyword::bval

Definition at line 612 of file fits.h.

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

char* casacore::FitsKeyword::comm_
private

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

Definition at line 603 of file fits.h.

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

short casacore::FitsKeyword::commlen_
private

Definition at line 604 of file fits.h.

Referenced by commlen().

double casacore::FitsKeyword::dval

Definition at line 615 of file fits.h.

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

float casacore::FitsKeyword::fval

Definition at line 614 of file fits.h.

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

Int casacore::FitsKeyword::ival

Definition at line 613 of file fits.h.

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

const ReservedFitsKeyword* casacore::FitsKeyword::kw_
private

Definition at line 595 of file fits.h.

Referenced by kw().

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

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

short casacore::FitsKeyword::namelen_
private

Definition at line 597 of file fits.h.

Referenced by name(), and namelen().

int casacore::FitsKeyword::ndx
private

Definition at line 596 of file fits.h.

Referenced by index(), and isindexed().

FitsKeyword* casacore::FitsKeyword::next_
private

Definition at line 587 of file fits.h.

FitsKeyword* casacore::FitsKeyword::prev_
private

Definition at line 588 of file fits.h.

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

the keyword value

Definition at line 610 of file fits.h.

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

void* casacore::FitsKeyword::val
private

Definition at line 617 of file fits.h.

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

short casacore::FitsKeyword::vallen
private

Definition at line 618 of file fits.h.

Referenced by asString(), and valStrlen().


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