Changeset 2695 in Sophya for trunk/SophyaLib/BaseTools


Ignore:
Timestamp:
Apr 26, 2005, 6:20:21 PM (20 years ago)
Author:
ansari
Message:

1/ Declaration des classes PPF_TPointer_IO< X > avec X=int_1/2/4/8 r_4 ...
remis ds ppftpointerio.h - corps de fonction laisse ds .cc
2/ Ajout de la methode SwapOutBuffer() ds SwSegDataBlock<T>
3/ Ajout du constructeur par defaut ds PPFDataSwapper

Reza 26/4/2005

Location:
trunk/SophyaLib/BaseTools
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaLib/BaseTools/ppfswapper.h

    r2660 r2695  
    2323class PPFDataSwapper : public DataSwapperInterface<T> {
    2424public:
     25  PPFDataSwapper() { ppfos = NULL; ppfis = NULL;}
    2526  PPFDataSwapper(POutPersist & os) { ppfos = &os; ppfis = NULL;}
    2627  PPFDataSwapper(PInPersist & is) { ppfos = NULL; ppfis = &is;}
  • trunk/SophyaLib/BaseTools/ppftpointerio.cc

    r2687 r2695  
    102102
    103103}  // namespace SOPHYA
     104/*
    104105#ifdef __CXX_PRAGMA_TEMPLATES__
    105106#pragma define_template PPF_TPointer_IO< char >
     
    133134template class PPF_TPointer_IO< complex<r_8> >;
    134135#endif
    135 
     136*/
  • trunk/SophyaLib/BaseTools/ppftpointerio.h

    r2687 r2695  
    3737};
    3838
     39// declaration specifique pour ecriture sous forme de tableaux PPF
     40class PPF_TPointer_IO<char> {
     41public:
     42  static void Write(POutPersist & os,  char  const * arr, size_t n);
     43  static void Read(PInPersist & is, char * arr, size_t n);
     44};
     45
     46class PPF_TPointer_IO<int_1> {
     47public:
     48  static void Write(POutPersist & os,  int_1  const * arr, size_t n);
     49  static void Read(PInPersist & is, int_1 * arr, size_t n);
     50};
     51class PPF_TPointer_IO<uint_1> {
     52public:
     53  static void Write(POutPersist & os,  uint_1  const * arr, size_t n);
     54  static void Read(PInPersist & is, uint_1 * arr, size_t n);
     55};
     56
     57class PPF_TPointer_IO<int_2> {
     58public:
     59  static void Write(POutPersist & os,  int_2  const * arr, size_t n);
     60  static void Read(PInPersist & is, int_2 * arr, size_t n);
     61};
     62class PPF_TPointer_IO<uint_2> {
     63public:
     64  static void Write(POutPersist & os,  uint_2  const * arr, size_t n);
     65  static void Read(PInPersist & is, uint_2 * arr, size_t n);
     66};
     67
     68class PPF_TPointer_IO<int_4> {
     69public:
     70  static void Write(POutPersist & os,  int_4  const * arr, size_t n);
     71  static void Read(PInPersist & is, int_4 * arr, size_t n);
     72};
     73class PPF_TPointer_IO<uint_4> {
     74public:
     75  static void Write(POutPersist & os,  uint_4  const * arr, size_t n);
     76  static void Read(PInPersist & is, uint_4 * arr, size_t n);
     77};
     78
     79class PPF_TPointer_IO<int_8> {
     80public:
     81  static void Write(POutPersist & os,  int_8  const * arr, size_t n);
     82  static void Read(PInPersist & is, int_8 * arr, size_t n);
     83};
     84class PPF_TPointer_IO<uint_8> {
     85public:
     86  static void Write(POutPersist & os,  uint_8  const * arr, size_t n);
     87  static void Read(PInPersist & is, uint_8 * arr, size_t n);
     88};
     89
     90class PPF_TPointer_IO<r_4> {
     91public:
     92  static void Write(POutPersist & os,  r_4  const * arr, size_t n);
     93  static void Read(PInPersist & is, r_4 * arr, size_t n);
     94};
     95class PPF_TPointer_IO<r_8> {
     96public:
     97  static void Write(POutPersist & os,  r_8  const * arr, size_t n);
     98  static void Read(PInPersist & is, r_8 * arr, size_t n);
     99};
     100
     101class PPF_TPointer_IO< complex<r_4> > {
     102public:
     103  static void Write(POutPersist & os,  complex<r_4>  const * arr, size_t n);
     104  static void Read(PInPersist & is, complex<r_4> * arr, size_t n);
     105};
     106class PPF_TPointer_IO< complex<r_8> > {
     107public:
     108  static void Write(POutPersist & os,  complex<r_8>  const * arr, size_t n);
     109  static void Read(PInPersist & is, complex<r_8> * arr, size_t n);
     110};
    39111
    40112}  // namespace SOPHYA
  • trunk/SophyaLib/BaseTools/swsegdb.h

    r2692 r2695  
    120120    mSRef = a.mSRef;
    121121    mSRef->nref++;
     122    return *this;
    122123  }
    123124
    124   //! Return the position tag (swap position) table
    125   std::vector< int_8 > & GetSwapPosTagTable() const
    126   { 
     125  //! Empties all memory buffers to swap stream
     126  void SwapOutBuffer() const
     127  {
    127128    if ((mSRef->bidx >= 0) && !mSRef->fgcstbuff) {
    128129      int_8 nswp = mSRef->swapper->WriteToSwap(mSRef->buff, mSRef->segsize, mSRef->bidx,
     
    130131      mSRef->swp[mSRef->bidx] = nswp;
    131132      mSRef->fgwp[mSRef->bidx] = true;
    132     }
     133      mSRef->bidx = -1;
     134      mSRef->fgcstbuff = true; 
     135   }
     136  }
     137  //! Return the position tag (swap position) table, after call to SwapOutBuffer()
     138  std::vector< int_8 > & GetSwapPosTagTable() const
     139  {
     140    SwapOutBuffer();
    133141    return  mSRef->swp;
    134142  }
Note: See TracChangeset for help on using the changeset viewer.