17 #include "FitsError.h"
439 friend bool operator<(
const ExtHDU &left,
const ExtHDU &right);
441 friend bool operator>(
const ExtHDU &left,
const ExtHDU &right);
443 friend bool operator<=(
const ExtHDU &left,
const ExtHDU &right);
445 friend bool operator>=(
const ExtHDU &left,
const ExtHDU &right);
447 static void readHduName (
const fitsfile* fptr,
int hduIndex, String& hduName,
int& hduVersion);
448 virtual void readData (
bool readFlag =
false,
const std::vector<String>& keys = std::vector<String>()) = 0;
449 const String&
name ()
const;
450 virtual HDU *
clone (FITSBase* p)
const = 0;
457 virtual Column&
column (
const String& colName,
bool caseSensitive =
true)
const;
459 virtual long rows ()
const;
460 virtual void addColumn (
ValueType type,
const String& columnName,
long repeatWidth,
const String& colUnit = String(
""),
long decimals = -1,
size_t columnNumber = 0);
464 virtual const std::map<string, Column*>&
column ()
const;
469 static const String& missHDU ();
470 static void setMissHDU (
const String& value);
481 template <
typename S>
482 void write(
const std::vector<long>& first,
484 const std::valarray<S>& data,
488 template <
typename S>
489 void write(
long first,
491 const std::valarray<S>& data,
494 template <
typename S>
495 void write(
const std::vector<long>& first,
497 const std::valarray<S>& data);
500 template <
typename S>
501 void write(
long first,
503 const std::valarray<S>& data);
505 template <
typename S>
506 void write(
const std::vector<long>& firstVertex,
507 const std::vector<long>& lastVertex,
508 const std::valarray<S>& data);
515 template <
typename S>
516 void read (std::valarray<S>& image) ;
519 void read (std::valarray<S>& image,
525 void read (std::valarray<S>& image,
526 const std::vector<long>& first,
531 void read (std::valarray<S>& image,
532 const std::vector<long>& firstVertex,
533 const std::vector<long>& lastVertex,
534 const std::vector<long>& stride) ;
537 void read (std::valarray<S>& image,
542 void read (std::valarray<S>& image,
543 const std::vector<long>& first,
547 void read (std::valarray<S>& image,
548 const std::vector<long>& firstVertex,
549 const std::vector<long>& lastVertex,
550 const std::vector<long>& stride,
555 ExtHDU (FITSBase* p, HduType xtype,
const String &hduName,
int version);
558 ExtHDU (FITSBase* p, HduType xtype,
const String &hduName,
int bitpix,
int naxis,
const std::vector<long>&
axes,
int version);
562 ExtHDU (FITSBase* p, HduType xtype,
int number);
564 virtual std::ostream & put (std::ostream &s)
const = 0;
565 virtual void setColumn (
const String& colname,
Column* value);
566 virtual void checkExtensionType ()
const;
578 virtual void initRead () = 0;
579 void checkXtension ();
589 static String s_missHDU;
602 inline bool operator<(
const ExtHDU &left,
const ExtHDU &right)
604 if (left.m_name < right.m_name)
return true;
605 if (left.m_name > right.m_name)
return false;
606 if (left.m_name == right.m_name)
608 if (left.m_version < right.m_version)
return true;
613 inline bool operator>(
const ExtHDU &left,
const ExtHDU &right)
615 return !operator<=(left,right);
618 inline bool operator<=(
const ExtHDU &left,
const ExtHDU &right)
620 if (left.m_name <= right.m_name)
622 if (left.m_version <= right.m_version)
return true;
627 inline bool operator>=(
const ExtHDU &left,
const ExtHDU &right)
629 return !operator<(left,right);
679 inline const String& ExtHDU::missHDU ()
684 inline void ExtHDU::setMissHDU (
const String& value)