Changeset 3658 in Sophya for trunk/AddOn/TAcq/minifits.h


Ignore:
Timestamp:
Oct 18, 2009, 11:10:33 AM (16 years ago)
Author:
ansari
Message:

1/ Gestion multi-fibre ds RAcqMemZoneMgr et les DMAReader/DiskWriter (brproc.cc)
2/ Possibilite d'ajout de mot cle ds l'entete FITS par la classe MiniFITSFile

Reza , 18/10/2009

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/AddOn/TAcq/minifits.h

    r3592 r3658  
    33
    44#include <stdio.h>
     5#include <exception>
    56#include <string>
    67
     
    1415using namespace std;
    1516
    16 class MiniFITSException {
     17#define MFEX_MAXMSGLEN 160
     18
     19class MiniFITSException : public std::exception {
    1720  public:
    18   explicit MiniFITSException(const char * m) { msg = m; }
    19   explicit MiniFITSException(const string& m) { msg = m; }
    20   virtual ~MiniFITSException() { }
    21   virtual string const& Msg() const  {return msg;}
     21  explicit MiniFITSException(const char * m) throw() ;
     22  explicit MiniFITSException(const string& m) throw() ;
     23  virtual ~MiniFITSException() throw() ;
     24    //! Implementation of std::exception what() method, returning the exception message
     25  virtual const char* what() const throw();
     26  virtual string const Msg() const ;
    2227 private:
    23   string msg;
     28  char msg_[MFEX_MAXMSGLEN];
    2429};
    2530
     
    6873    { return ( Write((void *)data, nel*sizeof(Float32)) ); }
    6974
     75  // Ajout de mots-cle a l'entete FITS
     76  int AddKeyI(const char* key, long val, const char* comm=NULL);
     77  inline int AddKeyI(string const& key, long val)
     78    { return AddKeyI(key.c_str(), val); }
     79  inline int AddKeyI(string const& key, long val, string const& comm)
     80    { return AddKeyI(key.c_str(), val, comm.c_str()); }
     81  int AddKeyD(const char* key, double val, const char* comm=NULL);
     82  inline int AddKeyD(string const& key, double val)
     83    { return AddKeyD(key.c_str(), val); }
     84  inline int AddKeyD(string const& key, double val, string const& comm)
     85    { return AddKeyD(key.c_str(), val, comm.c_str()); }
     86  int AddKeyS(const char* key, const char* val, const char* comm=NULL);
     87  inline int AddKeyS(string const& key, string const& val)
     88    { return AddKeyS(key.c_str(), val.c_str()); }
     89  inline int AddKeyS(string const& key, string const& val, string const& comm)
     90    { return AddKeyS(key.c_str(), val.c_str(), comm.c_str()); }
     91
    7092  //  string getKey(string& key);
    7193 protected:
     
    80102  size_t totwsz;  // total bytes ecrits
    81103  char* header; //  entete FITS
     104  int nkeya_; //
    82105};
    83106
Note: See TracChangeset for help on using the changeset viewer.