Ignore:
Timestamp:
Oct 3, 2011, 6:32:44 PM (14 years ago)
Author:
cmv
Message:

read/write string, complex, bufferisation enlevee pour FitsABTColRd1F, cmv 03/10/2011

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaExt/FitsIOServer/fabtcolread.h

    r4023 r4025  
    8585  double Read(LONGLONG n,long nfirstel,bool usebuffer=true);
    8686  inline double Read(LONGLONG n,bool usebuffer=true) {return Read(n,0,usebuffer);}
     87  complex<r_8> ReadComplex(LONGLONG n,long nfirstel=0);
     88  char* ReadInStr(LONGLONG n,long nfirstel=0);
    8789
    8890  LONGLONG Read(LONGLONG n1,LONGLONG n2,TVector<uint_2>& data);
     
    161163
    162164  string ColLabel,ColTUnit,ColTForm;
    163   int ColNum,ColTypeCode,NBcol;
     165  int ColNum,ColTypeCode,ColDispWidth,NBcol;
    164166  long ColRepeat;
    165167  LONGLONG NBline;
     168  char *StrBuff;
    166169
    167170  double NulVal;
     
    195198
    196199///////////////////////////////////////////////////////////////////
    197 //! Class for reading ALL the columns in a FITS ASCII or BINARY table
     200//! Class for reading ALL the columns in a FITS ASCII or BINARY table (no bufferisation)
    198201class FitsABTColRd1F : public AnyDataObj {
    199202public:
    200   FitsABTColRd1F(FitsOpenFile* fof,int ihdu=0
    201               ,long blen=100,long bsens=1,int lp=0);
     203  FitsABTColRd1F(FitsOpenFile* fof,int ihdu=0,int lp=0);
    202204  virtual ~FitsABTColRd1F();
    203 
    204   void ChangeBuffer(long blen=100,long bsens=1);
    205205
    206206  double    ReadKey(const char *keyname);
     
    209209  string    ReadKeyS(const char *keyname);
    210210
    211   double Read(int ColNum,LONGLONG n,long nfirstel,bool usebuffer=true);
    212   inline double Read(int ColNum,LONGLONG n,bool usebuffer=true) {return Read(ColNum,n,0,usebuffer);}
     211  double Read(int ColNum,LONGLONG n,long nfirstel);
     212  inline double Read(int ColNum,LONGLONG n) {return Read(ColNum,n,0);}
     213  complex<r_8> ReadComplex(int ColNum,LONGLONG n,long nfirstel=0);
     214  char* ReadInStr(int ColNum,LONGLONG n,long nfirstel=0);
    213215  int GetColNum(const char *colname);
    214216
     
    252254  inline long GetColRepeat(int ColNum) const
    253255         {if(ColNum<0 || ColNum>=NBcol) return -999; else return ColRepeat[ColNum];}
    254   //! Get the read requested buffer length
    255   inline long GetBLen(void) const {return BuffLen;}
    256   //! Get the read buffer direction
    257   inline long GetBSens(void) const {return BuffSens;}
    258256  //! Print to os
    259257  virtual void Print(ostream& os,int lp=1) const;
     
    261259  inline  void Print(int lp=1) const {Print(cout,lp);}
    262260  //! Get the read effective buffer length
    263   inline long GetNBuffer(void) const {return NBuffer;}
    264   //! Get the read bufferpointer
    265   inline double* GetBuffer(int ColNum)
    266          {if(ColNum<0 || ColNum>=NBcol) return NULL; else return Buffer[ColNum];}
    267261
    268262protected:
    269   void Init(FitsOpenFile* fof,int ihdu,long blen,long bsens,int lp);
     263  void Init(FitsOpenFile* fof,int ihdu,int lp);
    270264  void Delete(void);
    271265
    272266  vector<string> ColLabel,ColTUnit,ColTForm;
    273   vector<int> ColTypeCode;
     267  vector<int> ColTypeCode, ColDispWidth;
    274268  vector<long> ColRepeat;
    275269  int NBcol;
    276270  LONGLONG NBline;
     271  vector<char*> StrBuff;
    277272
    278273  double NulVal;
    279274  unsigned short DbgLevel;
    280   long BuffLen, BuffSens;
    281275
    282276  FitsOpenFile* FitsOF;
    283   vector<LONGLONG> LineDeb, LineFin;
    284   double **Buffer;
    285   long NBuffer;
    286277};
    287278
     
    291282class FitsABTColRead1F : public FitsABTColRd1F {
    292283public:
    293   FitsABTColRead1F(string fname,int ihdu=0
    294                 ,long blen=100,long bsens=1,int lp=0);
    295   FitsABTColRead1F(const char *cfname,int ihdu=0
    296                 ,long blen=100,long bsens=1,int lp=0);
     284  FitsABTColRead1F(string fname,int ihdu=0,int lp=0);
     285  FitsABTColRead1F(const char *cfname,int ihdu=0,int lp=0);
    297286  virtual ~FitsABTColRead1F();
    298287};
Note: See TracChangeset for help on using the changeset viewer.