casacore
Public Member Functions | Private Member Functions | Private Attributes | List of all members
casacore::FitsKeywordList Class Reference

linked list of FITS keywords More...

#include <fits.h>

Public Member Functions

 FitsKeywordList ()
 
 ~FitsKeywordList ()
 
 FitsKeywordList (const FitsKeywordList &)
 
 FitsKeywordList (ConstFitsKeywordList &)
 
FitsKeywordListoperator= (const FitsKeywordList &)
 
std::string toString () const
 Convert the list to a string containing the 80-byte FITS headers. More...
 
void del ()
 delete the current keyword (the thing returned by curr()) from the list More...
 
void mk (FITS::ReservedName k, Bool v, const char *c=0)
 Add (make) a reserved keyword with the given value and optional comment The comment will be truncated if necessary to fit the available space. More...
 
void mk (FITS::ReservedName k, const char *v=0, const char *c=0)
 
void mk (FITS::ReservedName k, Int v, const char *c=0)
 
void mk (FITS::ReservedName k, long v, const char *c=0)
 
void mk (FITS::ReservedName k, double v, const char *c=0)
 
void mk (int n, FITS::ReservedName k, Bool v, const char *c=0)
 Add (make) an indexed reserved keyword with the given value and optional comment The comment will be truncated if necessary to fit the available space. More...
 
void mk (int n, FITS::ReservedName k, const char *v, const char *c=0)
 
void mk (int n, FITS::ReservedName k, Int v, const char *c=0)
 
void mk (int n, FITS::ReservedName k, long v, const char *c=0)
 
void mk (int n, FITS::ReservedName k, double v, const char *c=0)
 
void mk (const char *n, Bool v, const char *c=0)
 Add (make) a user defined keyword with the given name, value and optional comment. More...
 
void mk (const char *n, const char *v=0, const char *c=0)
 
void mk (const char *n, Int v, const char *c=0)
 
void mk (const char *n, long v, const char *c=0)
 
void mk (const char *n, float v, const char *c=0)
 
void mk (const char *n, double v, const char *c=0)
 
void mk (const char *n, Int r, Int i, const char *c=0)
 
void mk (const char *n, float r, float i, const char *c=0)
 
void mk (const char *n, double r, double i, const char *c=0)
 
void spaces (const char *n=0, const char *c=0)
 add a spaces line More...
 
void comment (const char *n=0, const char *c=0)
 add a comment card More...
 
void history (const char *c=0)
 add a history card More...
 
void end ()
 add the end card. More...
 
FitsKeywordoperator() (int)
 Retrieve specific keywords – these also set the current mark. More...
 
FitsKeywordoperator() (const FITS::ReservedName &)
 return first and next non-indexed reserved keyword More...
 
FitsKeywordnext (const FITS::ReservedName &)
 
FitsKeywordoperator() (const FITS::ReservedName &, int)
 return first and next indexed reserved keyword More...
 
FitsKeywordnext (const FITS::ReservedName &, int)
 
FitsKeywordoperator() (const char *)
 return first and next user-defined keyword More...
 
FitsKeywordnext (const char *)
 
Bool isempty () const
 
void first ()
 
void last ()
 
FitsKeywordnext ()
 
FitsKeywordprev ()
 
FitsKeywordcurr ()
 
void delete_all ()
 
int rules (FitsKeyword &, FITSErrorHandler errhandler=FITSError::defaultHandler)
 
int rules (FITSErrorHandler errhandler=FITSError::defaultHandler)
 
Bool basic_rules ()
 
void parse (const char *, int)
 For parsing a single string. More...
 
int no_parse_errs () const
 
const char * parse_err (int) const
 
void insert (FitsKeyword &)
 

Private Member Functions

FitsKeywordmake (const char *nm, FITS::ValueType t, const void *v, const char *c)
 
FitsKeywordmake (FITS::ReservedName nm, FITS::ValueType t, const void *v, const char *c)
 
FitsKeywordmake (int ind, FITS::ReservedName nm, FITS::ValueType t, const void *v, const char *c)
 
FitsKeywordmakeErrKeyword (const char *name, FITS::ValueType type, const void *val, const char *errmsg)
 construct an error keyword - this happens when a name is invalid (NULL or more than 8 characters) or a string value is too long (more than 69 characters). More...
 

Private Attributes

FitsKeywordbeg_
 
FitsKeywordend_
 
FitsKeywordpos
 
int total
 
int cursor
 
FitsParse card
 

Detailed Description

linked list of FITS keywords

Review Status

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

Synopsis

A linked list of FITS keywords.

Definition at line 737 of file fits.h.

Constructor & Destructor Documentation

◆ FitsKeywordList() [1/3]

casacore::FitsKeywordList::FitsKeywordList ( )
inline

Definition at line 870 of file fits.h.

◆ ~FitsKeywordList()

casacore::FitsKeywordList::~FitsKeywordList ( )
inline

Definition at line 872 of file fits.h.

References delete_all().

◆ FitsKeywordList() [2/3]

casacore::FitsKeywordList::FitsKeywordList ( const FitsKeywordList )

◆ FitsKeywordList() [3/3]

casacore::FitsKeywordList::FitsKeywordList ( ConstFitsKeywordList )

Member Function Documentation

◆ basic_rules()

Bool casacore::FitsKeywordList::basic_rules ( )

◆ comment()

void casacore::FitsKeywordList::comment ( const char *  n = 0,
const char *  c = 0 
)
inline

add a comment card

Definition at line 938 of file fits.h.

References casacore::C::c, casacore::FITS::COMMENT, insert(), make(), and casacore::FITS::NOVALUE.

Referenced by casacore::HeaderDataUnit::comment().

◆ curr()

FitsKeyword * casacore::FitsKeywordList::curr ( )
inline

Definition at line 876 of file fits.h.

References pos.

Referenced by casacore::ConstFitsKeywordList::curr(), and casacore::HeaderDataUnit::currkw().

◆ del()

void casacore::FitsKeywordList::del ( )

delete the current keyword (the thing returned by curr()) from the list

◆ delete_all()

void casacore::FitsKeywordList::delete_all ( )

Referenced by ~FitsKeywordList().

◆ end()

void casacore::FitsKeywordList::end ( )
inline

add the end card.

This must be at the end of the list.

Definition at line 944 of file fits.h.

References casacore::FITS::END, insert(), make(), and casacore::FITS::NOVALUE.

◆ first()

void casacore::FitsKeywordList::first ( )
inline

Definition at line 874 of file fits.h.

References beg_, cursor, and pos.

Referenced by casacore::ConstFitsKeywordList::first(), casacore::HeaderDataUnit::firstkw(), and operator()().

◆ history()

void casacore::FitsKeywordList::history ( const char *  c = 0)
inline

add a history card

Definition at line 942 of file fits.h.

References casacore::C::c, casacore::FITS::HISTORY, insert(), make(), and casacore::FITS::NOVALUE.

Referenced by casacore::HeaderDataUnit::history().

◆ insert()

void casacore::FitsKeywordList::insert ( FitsKeyword )

Referenced by comment(), end(), history(), mk(), parse(), and spaces().

◆ isempty()

Bool casacore::FitsKeywordList::isempty ( ) const
inline

Definition at line 873 of file fits.h.

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

Referenced by casacore::ConstFitsKeywordList::isempty().

◆ last()

void casacore::FitsKeywordList::last ( )
inline

Definition at line 875 of file fits.h.

References cursor, end_, pos, and total.

Referenced by casacore::ConstFitsKeywordList::last(), and casacore::HeaderDataUnit::lastkw().

◆ make() [1/3]

FitsKeyword& casacore::FitsKeywordList::make ( const char *  nm,
FITS::ValueType  t,
const void *  v,
const char *  c 
)
private

Referenced by comment(), end(), history(), mk(), and spaces().

◆ make() [2/3]

FitsKeyword& casacore::FitsKeywordList::make ( FITS::ReservedName  nm,
FITS::ValueType  t,
const void *  v,
const char *  c 
)
private

◆ make() [3/3]

FitsKeyword& casacore::FitsKeywordList::make ( int  ind,
FITS::ReservedName  nm,
FITS::ValueType  t,
const void *  v,
const char *  c 
)
private

◆ makeErrKeyword()

FitsKeyword& casacore::FitsKeywordList::makeErrKeyword ( const char *  name,
FITS::ValueType  type,
const void *  val,
const char *  errmsg 
)
private

construct an error keyword - this happens when a name is invalid (NULL or more than 8 characters) or a string value is too long (more than 69 characters).

It is the responsibility of the caller to the several mk functions to ensure that that doesn't happen. By the time it gets here, it is assumed that such problems are true errors. This is used by the private make functions.

◆ mk() [1/19]

void casacore::FitsKeywordList::mk ( const char *  n,
Bool  v,
const char *  c = 0 
)
inline

Add (make) a user defined keyword with the given name, value and optional comment.

FitsKeyword constructors for User-Defined keywords.

The comment will be truncated if necessary to fit the available space. The name must be no longer than 8 characters. Names longer than that will result in an ERROR keyword instead of the desired keyword. String values must no longer than 69 characters. String values longer than that will result in an ERROR keyword instead of the desired keyword.

Definition at line 913 of file fits.h.

References casacore::C::c, insert(), casacore::FITS::LOGICAL, and make().

◆ mk() [2/19]

void casacore::FitsKeywordList::mk ( const char *  n,
const char *  v = 0,
const char *  c = 0 
)
inline

Definition at line 915 of file fits.h.

References casacore::C::c, insert(), make(), and casacore::FITS::STRING.

◆ mk() [3/19]

void casacore::FitsKeywordList::mk ( const char *  n,
double  r,
double  i,
const char *  c = 0 
)
inline

Definition at line 930 of file fits.h.

References casacore::C::c, casacore::FITS::DCOMPLEX, insert(), and make().

◆ mk() [4/19]

void casacore::FitsKeywordList::mk ( const char *  n,
double  v,
const char *  c = 0 
)
inline

Definition at line 923 of file fits.h.

References casacore::C::c, casacore::FITS::DOUBLE, insert(), and make().

◆ mk() [5/19]

void casacore::FitsKeywordList::mk ( const char *  n,
float  r,
float  i,
const char *  c = 0 
)
inline

Definition at line 928 of file fits.h.

References casacore::C::c, casacore::FITS::COMPLEX, insert(), and make().

◆ mk() [6/19]

void casacore::FitsKeywordList::mk ( const char *  n,
float  v,
const char *  c = 0 
)
inline

Definition at line 921 of file fits.h.

References casacore::C::c, casacore::FITS::FLOAT, insert(), and make().

◆ mk() [7/19]

void casacore::FitsKeywordList::mk ( const char *  n,
Int  r,
Int  i,
const char *  c = 0 
)
inline

Definition at line 925 of file fits.h.

References casacore::C::c, casacore::FITS::ICOMPLEX, insert(), and make().

◆ mk() [8/19]

void casacore::FitsKeywordList::mk ( const char *  n,
Int  v,
const char *  c = 0 
)
inline

Definition at line 917 of file fits.h.

References casacore::C::c, insert(), casacore::FITS::LONG, and make().

◆ mk() [9/19]

void casacore::FitsKeywordList::mk ( const char *  n,
long  v,
const char *  c = 0 
)
inline

Definition at line 919 of file fits.h.

References casacore::C::c, insert(), casacore::FITS::LONG, and make().

◆ mk() [10/19]

void casacore::FitsKeywordList::mk ( FITS::ReservedName  k,
Bool  v,
const char *  c = 0 
)
inline

Add (make) a reserved keyword with the given value and optional comment The comment will be truncated if necessary to fit the available space.

FitsKeyword constructors for non-indexed Reserved keywords.

String values must be less than 69 characters. String values longer than that will result in an ERROR keyword instead of the desired keyword.

Definition at line 890 of file fits.h.

References casacore::C::c, insert(), casacore::FITS::LOGICAL, and make().

Referenced by casacore::HeaderDataUnit::mk().

◆ mk() [11/19]

void casacore::FitsKeywordList::mk ( FITS::ReservedName  k,
const char *  v = 0,
const char *  c = 0 
)
inline

Definition at line 892 of file fits.h.

References casacore::C::c, insert(), make(), and casacore::FITS::STRING.

◆ mk() [12/19]

void casacore::FitsKeywordList::mk ( FITS::ReservedName  k,
double  v,
const char *  c = 0 
)
inline

Definition at line 898 of file fits.h.

References casacore::C::c, casacore::FITS::DOUBLE, insert(), and make().

◆ mk() [13/19]

void casacore::FitsKeywordList::mk ( FITS::ReservedName  k,
Int  v,
const char *  c = 0 
)
inline

Definition at line 894 of file fits.h.

References casacore::C::c, insert(), casacore::FITS::LONG, and make().

◆ mk() [14/19]

void casacore::FitsKeywordList::mk ( FITS::ReservedName  k,
long  v,
const char *  c = 0 
)
inline

Definition at line 896 of file fits.h.

References casacore::C::c, insert(), casacore::FITS::LONG, and make().

◆ mk() [15/19]

void casacore::FitsKeywordList::mk ( int  n,
FITS::ReservedName  k,
Bool  v,
const char *  c = 0 
)
inline

Add (make) an indexed reserved keyword with the given value and optional comment The comment will be truncated if necessary to fit the available space.

FitsKeyword constructors for indexed Reserved keywords.

String values must be less than 69 characters. String values longer than that will result in an ERROR keyword instead of the desired keyword.

Definition at line 901 of file fits.h.

References casacore::C::c, insert(), casacore::FITS::LOGICAL, and make().

◆ mk() [16/19]

void casacore::FitsKeywordList::mk ( int  n,
FITS::ReservedName  k,
const char *  v,
const char *  c = 0 
)
inline

Definition at line 904 of file fits.h.

References casacore::C::c, insert(), make(), and casacore::FITS::STRING.

◆ mk() [17/19]

void casacore::FitsKeywordList::mk ( int  n,
FITS::ReservedName  k,
double  v,
const char *  c = 0 
)
inline

Definition at line 910 of file fits.h.

References casacore::C::c, casacore::FITS::DOUBLE, insert(), and make().

◆ mk() [18/19]

void casacore::FitsKeywordList::mk ( int  n,
FITS::ReservedName  k,
Int  v,
const char *  c = 0 
)
inline

Definition at line 906 of file fits.h.

References casacore::C::c, insert(), casacore::FITS::LONG, and make().

◆ mk() [19/19]

void casacore::FitsKeywordList::mk ( int  n,
FITS::ReservedName  k,
long  v,
const char *  c = 0 
)
inline

Definition at line 908 of file fits.h.

References casacore::C::c, insert(), casacore::FITS::LONG, and make().

◆ next() [1/4]

FitsKeyword* casacore::FitsKeywordList::next ( )

Referenced by operator()().

◆ next() [2/4]

FitsKeyword* casacore::FitsKeywordList::next ( const char *  )

◆ next() [3/4]

FitsKeyword* casacore::FitsKeywordList::next ( const FITS::ReservedName )

◆ next() [4/4]

FitsKeyword* casacore::FitsKeywordList::next ( const FITS::ReservedName ,
int   
)

◆ no_parse_errs()

int casacore::FitsKeywordList::no_parse_errs ( ) const
inline

Definition at line 885 of file fits.h.

References card, and casacore::FitsParse::no_errs().

◆ operator()() [1/4]

FitsKeyword * casacore::FitsKeywordList::operator() ( const char *  w)
inline

return first and next user-defined keyword

Definition at line 881 of file fits.h.

References first(), and next().

◆ operator()() [2/4]

FitsKeyword * casacore::FitsKeywordList::operator() ( const FITS::ReservedName n)
inline

return first and next non-indexed reserved keyword

Definition at line 877 of file fits.h.

References first(), and next().

◆ operator()() [3/4]

FitsKeyword * casacore::FitsKeywordList::operator() ( const FITS::ReservedName n,
int  ndx 
)
inline

return first and next indexed reserved keyword

Definition at line 879 of file fits.h.

References first(), and next().

◆ operator()() [4/4]

FitsKeyword* casacore::FitsKeywordList::operator() ( int  )

Retrieve specific keywords – these also set the current mark.

return the i-th keyword – keyword numbering starts with 0

◆ operator=()

FitsKeywordList& casacore::FitsKeywordList::operator= ( const FitsKeywordList )

◆ parse()

void casacore::FitsKeywordList::parse ( const char *  s,
int  l 
)
inline

For parsing a single string.

Definition at line 883 of file fits.h.

References card, insert(), and casacore::FitsParse::parse().

◆ parse_err()

const char * casacore::FitsKeywordList::parse_err ( int  n) const
inline

Definition at line 886 of file fits.h.

References card, and casacore::FitsParse::err().

◆ prev()

FitsKeyword* casacore::FitsKeywordList::prev ( )

◆ rules() [1/2]

int casacore::FitsKeywordList::rules ( FITSErrorHandler  errhandler = FITSError::defaultHandler)

◆ rules() [2/2]

int casacore::FitsKeywordList::rules ( FitsKeyword ,
FITSErrorHandler  errhandler = FITSError::defaultHandler 
)

◆ spaces()

void casacore::FitsKeywordList::spaces ( const char *  n = 0,
const char *  c = 0 
)
inline

add a spaces line

Additional keyword constructors for commentary, etc.

Definition at line 934 of file fits.h.

References casacore::C::c, insert(), make(), casacore::FITS::NOVALUE, and casacore::FITS::SPACES.

Referenced by casacore::HeaderDataUnit::spaces().

◆ toString()

std::string casacore::FitsKeywordList::toString ( ) const

Convert the list to a string containing the 80-byte FITS headers.

Member Data Documentation

◆ beg_

FitsKeyword* casacore::FitsKeywordList::beg_
private

Definition at line 846 of file fits.h.

Referenced by first().

◆ card

FitsParse casacore::FitsKeywordList::card
private

Definition at line 865 of file fits.h.

Referenced by no_parse_errs(), parse(), and parse_err().

◆ cursor

int casacore::FitsKeywordList::cursor
private

Definition at line 850 of file fits.h.

Referenced by first(), and last().

◆ end_

FitsKeyword* casacore::FitsKeywordList::end_
private

Definition at line 847 of file fits.h.

Referenced by last().

◆ pos

FitsKeyword* casacore::FitsKeywordList::pos
private

Definition at line 848 of file fits.h.

Referenced by curr(), first(), and last().

◆ total

int casacore::FitsKeywordList::total
private

Definition at line 849 of file fits.h.

Referenced by isempty(), and last().


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