Changeset 2441 in Sophya for trunk/SophyaLib/BaseTools/fiondblock.cc
- Timestamp:
- Oct 3, 2003, 3:39:33 PM (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/BaseTools/fiondblock.cc
r2322 r2441 8 8 #include <complex> 9 9 #include "pexceptions.h" 10 #include "datatype.h" 10 11 #include "fiondblock.h" 11 #include "datatype.h"12 12 #include <typeinfo> 13 13 … … 24 24 */ 25 25 26 // Pour pouvoir ecrire des tableaux de complex, en attendant27 // PIn/POutPersist::Get/Put(complex<>)28 #include "piocmplx.h"29 26 30 27 template <class T> … … 110 107 } 111 108 109 //--------------------------------------------------------------------------- 110 // Pour compatibilite de lecture avec PPF V2 111 inline void PIOSReadArray(PInPersist & is, uint_1 * arr, size_t n) 112 { is.GetBytes(arr, n); } 113 inline void PIOSReadArray(PInPersist & is, uint_2 * arr, size_t n) 114 { is.Get(arr, n); } 115 inline void PIOSReadArray(PInPersist & is, int_2 * arr, size_t n) 116 { is.Get(arr, n); } 117 inline void PIOSReadArray(PInPersist & is, uint_4 * arr, size_t n) 118 { is.Get(arr, n); } 119 inline void PIOSReadArray(PInPersist & is, int_4 * arr, size_t n) 120 { is.Get(arr, n); } 121 inline void PIOSReadArray(PInPersist & is, uint_8 * arr, size_t n) 122 { is.Get(arr, n); } 123 inline void PIOSReadArray(PInPersist & is, int_8 * arr, size_t n) 124 { is.Get(arr, n); } 125 inline void PIOSReadArray(PInPersist & is, r_4 * arr, size_t n) 126 { is.Get(arr, n); } 127 inline void PIOSReadArray(PInPersist & is, r_8 * arr, size_t n) 128 { is.Get(arr, n); } 129 inline void PIOSReadArray(PInPersist & is, complex<float> * arr, size_t n) 130 { r_4 * pr = (r_4 *)arr; is.Get(pr, n*2); } 131 inline void PIOSReadArray(PInPersist & is, complex<double> * arr, size_t n) 132 { r_8 * pr = (r_8 *)arr; is.Get(pr, n*2); } 133 //--------------------------------------------------------------------------- 134 112 135 template <class T> 113 136 void FIO_NDataBlock<T>::ReadSelf(PInPersist& is) … … 119 142 else if (itab[1] != dobj->Size()) dobj->ReSize(itab[1]); 120 143 // On lit le tableau de nombres 121 PIOSReadArray(is, dobj->Data(), dobj->Size()); 144 if (is.Version() <= 2) // lecture ancienne version PPF 145 PIOSReadArray(is, dobj->Data(), dobj->Size()); 146 else is.Get(dobj->Data(), dobj->Size()); 122 147 } 123 148 … … 135 160 os.Put(itab, 3); 136 161 // On ecrit le tableau de nombres 137 PIOSWriteArray(os, dobj->Data(), dobj->Size()); 162 os.Put(dobj->Data(), dobj->Size()); 138 163 } 139 164
Note:
See TracChangeset
for help on using the changeset viewer.