Ignore:
Timestamp:
Oct 3, 2003, 3:39:33 PM (22 years ago)
Author:
ansari
Message:

1) Premiere serie des modifications et ajout fonctionalites pour les PPersist:

  • Ecriture/lecture complex<> et tableaux de complex
  • Ecriture/lecture int_1, uint_1 et tableaux de
  • Tag de positionnement et table de tag de positionnement

2) Adaptation de Read/Write NDataBlock et suppression du fichier piocmplx.h

Reza 03/10/2003

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaLib/BaseTools/fiondblock.cc

    r2322 r2441  
    88#include <complex>
    99#include "pexceptions.h"
     10#include "datatype.h"
    1011#include "fiondblock.h"
    11 #include "datatype.h"
    1212#include <typeinfo>
    1313
     
    2424*/
    2525
    26 // Pour pouvoir ecrire des tableaux de complex, en attendant
    27 // PIn/POutPersist::Get/Put(complex<>)
    28 #include "piocmplx.h"
    2926
    3027template <class T>
     
    110107}
    111108
     109//---------------------------------------------------------------------------
     110// Pour compatibilite de lecture avec PPF V2
     111inline void PIOSReadArray(PInPersist & is, uint_1 * arr, size_t n)
     112{ is.GetBytes(arr, n); }
     113inline void PIOSReadArray(PInPersist & is, uint_2 * arr, size_t n)
     114{ is.Get(arr, n); }
     115inline void PIOSReadArray(PInPersist & is, int_2 * arr, size_t n)
     116{ is.Get(arr, n); }
     117inline void PIOSReadArray(PInPersist & is, uint_4 * arr, size_t n)
     118{ is.Get(arr, n); }
     119inline void PIOSReadArray(PInPersist & is, int_4 * arr, size_t n)
     120{ is.Get(arr, n); }
     121inline void PIOSReadArray(PInPersist & is, uint_8 * arr, size_t n)
     122{ is.Get(arr, n); }
     123inline void PIOSReadArray(PInPersist & is, int_8 * arr, size_t n)
     124{ is.Get(arr, n); }
     125inline void PIOSReadArray(PInPersist & is, r_4 * arr, size_t n)
     126{ is.Get(arr, n); }
     127inline void PIOSReadArray(PInPersist & is, r_8 * arr, size_t n)
     128{ is.Get(arr, n); }
     129inline void PIOSReadArray(PInPersist & is, complex<float> * arr, size_t n)
     130{ r_4 * pr = (r_4 *)arr; is.Get(pr, n*2); }
     131inline void PIOSReadArray(PInPersist & is, complex<double> * arr, size_t n)
     132{ r_8 * pr = (r_8 *)arr; is.Get(pr, n*2); }
     133//---------------------------------------------------------------------------
     134
    112135template <class T>
    113136void FIO_NDataBlock<T>::ReadSelf(PInPersist& is)
     
    119142else if (itab[1] != dobj->Size()) dobj->ReSize(itab[1]);
    120143// On lit le tableau de nombres
    121 PIOSReadArray(is, dobj->Data(), dobj->Size());
     144if (is.Version() <= 2)   // lecture ancienne version PPF
     145  PIOSReadArray(is, dobj->Data(), dobj->Size());
     146else is.Get(dobj->Data(), dobj->Size());
    122147}
    123148
     
    135160os.Put(itab, 3);
    136161//  On ecrit le tableau de nombres
    137 PIOSWriteArray(os, dobj->Data(), dobj->Size());
     162os.Put(dobj->Data(), dobj->Size());
    138163}
    139164
Note: See TracChangeset for help on using the changeset viewer.