Ignore:
Timestamp:
Nov 29, 1999, 3:16:10 PM (26 years ago)
Author:
ansari
Message:

Ajout de classes deleguees PPersist et correction integration - Sophie 29/11/99

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaLib/SkyT/specrespvector.cc

    r610 r668  
    11//--------------------------------------------------------------------------
    22// File and Version Information:
    3 //      $Id: specrespvector.cc,v 1.3 1999-11-21 23:25:47 ansari Exp $
     3//      $Id: specrespvector.cc,v 1.4 1999-11-29 14:16:09 ansari Exp $
    44//
    55// Description:
     
    2222#include "specrespvector.h"
    2323#include "pexceptions.h"
    24 
    2524//----------------
    2625// Constructor --
    2726//----------------
     27SpecRespVec::SpecRespVec()
     28        : SpectralResponse()
     29{
     30}
     31
    2832SpecRespVec::SpecRespVec(Vector const & nu, Vector const & fdenu, double numin, double numax)
    2933        : SpectralResponse(numin, numax)
     
    3539  _numin = nu(0);
    3640  _numax = nu(nu.NElts()-1);
     41  _size = nu.NElts();
    3742  if(_vecOfNu.NElts() != _vecOfFDeNu.NElts()) cout << "vectors are not compatible" << exit;
    3843}
     
    9196
    9297}
     98
     99
     100void
     101ObjFileIO<SpecRespVec>::WriteSelf(POutPersist& s) const
     102{
     103  if(dobj == NULL)
     104    {
     105      cout << " ObjFileIO<SpecRespVec>::WriteSelf:: dobj= null " << endl;
     106      return;
     107    }
     108
     109  int_4 version, nothing;
     110  version = 1;
     111  nothing = 0;   // Reserved for future use
     112  s.PutI4(version);
     113  s.PutI4(nothing);
     114
     115  s.PutR8(dobj->minFreq());
     116  s.PutR8(dobj->maxFreq());
     117
     118  // TVector<T> has Persistence Manager
     119  s <<  dobj->getNuVec();
     120  s <<  dobj->getTNuVec();
     121}
     122
     123void
     124ObjFileIO<SpecRespVec>::ReadSelf(PInPersist& s)
     125{
     126  int_4 version, nothing;
     127  version = 1;
     128  nothing = 0;   // Reserved for future use
     129  s.GetI4(version);
     130  s.GetI4(nothing);
     131
     132  if(dobj == NULL)
     133    {
     134      Vector v1(10);
     135      Vector v2(10);
     136      dobj= new SpecRespVec();
     137      ownobj= true;
     138    }
     139 
     140  r_8 minf, maxf;
     141  s.GetR8(minf);
     142  s.GetR8(maxf);
     143  dobj->setMinMaxFreq(minf, maxf);
     144  // TVector<T> has Persistence Manager
     145  s >>  dobj->getNuVec();
     146  s >>  dobj->getTNuVec();
     147}
     148
     149
     150#ifdef __CXX_PRAGMA_TEMPLATES__
     151#pragma define_template ObjFileIO<SpecRespVec>
     152#endif
     153
     154#if defined(ANSI_TEMPLATES) || defined(GNU_TEMPLATES)
     155template class ObjFileIO<SpecRespVec>;
     156#endif
Note: See TracChangeset for help on using the changeset viewer.