Changeset 267 in Sophya for trunk/SophyaLib/BaseTools/ndatablock.cc
- Timestamp:
- Apr 23, 1999, 7:57:19 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/BaseTools/ndatablock.cc
r265 r267 67 67 { 68 68 Delete(); 69 } 70 71 template <class T> 72 void NDataBlock<T>::SetTemp(bool temp) 73 // Set temporary 74 { 75 mIsTemp=temp; 76 #ifdef DEBUG_NDATABLOCK 77 cout<<"DEBUG_NDataBlock::SetTemp("<<this<<","<<temp 78 <<"), mSz="<<mSz<<" mSRef="<<mSRef<<" IsTemp="<<mIsTemp<<endl; 79 #endif 69 80 } 70 81 … … 89 100 { 90 101 #ifdef DEBUG_NDATABLOCK 91 cout<<"DEBUG_NDataBlock::Alloc(" 92 <<n<<","<<data<<","<<br<<") mSRef="<<mSRef<<endl; 102 cout<<"DEBUG_NDataBlock::Alloc("<<this<<"," 103 <<n<<","<<data<<","<<br<<") mSz="<<mSz 104 <<" mSRef="<<mSRef<<" IsTemp="<<mIsTemp<<endl; 93 105 #endif 94 106 if(n==0) throw(SzMismatchError("NDataBlock::Alloc n==0\n")); … … 101 113 #ifdef DEBUG_NDATABLOCK 102 114 if(!data) NallocData++; NallocSRef++; 103 cout<<"...DEBUG_NDataBlock::Alloc ("<<n<<")mSRef="<<mSRef115 cout<<"...DEBUG_NDataBlock::Alloc mSz="<<mSz<<" mSRef="<<mSRef 104 116 <<" mSRef->nref="<<mSRef->nref<<" mSRef->data="<< mSRef->data 117 <<" mSRef->bridge="<<mSRef->bridge<<" IsTemp="<<mIsTemp 105 118 <<" Total("<<NallocData<<","<<NallocSRef<<")"<<endl; 106 119 #endif … … 112 125 { 113 126 #ifdef DEBUG_NDATABLOCK 114 cout<<"DEBUG_NDataBlock::Clone("<<&a<<") a.mSz=" 115 <<a.mSz<<" a.mSRef="<<a.mSRef<<" a.IsTemp="<<a.IsTemp()<<endl; 127 cout<<"DEBUG_NDataBlock::Clone("<<this<<","<<&a<<") a.(mSz=" 128 <<a.mSz<<" mSRef="<<a.mSRef<<" IsTemp="<<a.IsTemp() 129 <<"), mSz="<<mSz<<" mSRef="<<mSRef<<" IsTemp="<<mIsTemp<<endl; 116 130 #endif 117 131 if(!a.mSRef) {mSz=0; mSRef=NULL;} // cas ou "a" est cree par defaut … … 125 139 { 126 140 #ifdef DEBUG_NDATABLOCK 127 cout<<"DEBUG_NDataBlock::Share("<<&a<<") a.mSRef="<<a.mSRef<<" mSRef="<<mSRef<<endl; 141 cout<<"DEBUG_NDataBlock::Share("<<this<<","<<&a<<")"; 142 if(&a!=NULL) cout<<" a.(mSz="<<a.mSz<<" mSRef="<<a.mSRef 143 <<" IsTemp="<<a.IsTemp()<<")"; 144 cout<<", mSz="<<mSz<<" mSRef="<<mSRef<<" IsTemp="<<mIsTemp<<endl; 128 145 #endif 129 146 if(&a==NULL) throw(NullPtrError("NDataBlock::Share &a==NULL\n")); … … 133 150 mSz = a.mSz; mSRef = a.mSRef; mSRef->nref++; 134 151 #ifdef DEBUG_NDATABLOCK 135 cout<<"...DEBUG_NDataBlock::Share("<<&a<<") mSRef="<<mSRef 136 <<" mSRef->nref="<<mSRef->nref<<" mSRef->data="<< mSRef->data<<endl; 152 cout<<"...DEBUG_NDataBlock::Share mSz="<<mSz<<" mSRef="<<mSRef 153 <<" mSRef->nref="<<mSRef->nref<<" mSRef->data="<< mSRef->data 154 <<" mSRef->bridge="<<mSRef->bridge<<" IsTemp="<<mIsTemp<<endl; 137 155 #endif 138 156 } … … 143 161 { 144 162 #ifdef DEBUG_NDATABLOCK 145 cout<<"DEBUG_NDataBlock::Delete() mSRef="<<mSRef; 146 if(mSRef) cout<<" mSRef->nref="<<mSRef->nref<<" mSRef->data="<<mSRef->data; 163 cout<<"DEBUG_NDataBlock::Delete("<<this<<") mSz="<<mSz 164 <<" mSRef="<<mSRef<<" IsTemp="<<mIsTemp; 165 if(mSRef) 166 cout<<" mSRef->nref="<<mSRef->nref<<" mSRef->data=" 167 <<mSRef->data<<" mSRef->bridge="<<mSRef->bridge; 147 168 cout<<endl; 148 169 #endif … … 206 227 { 207 228 size_t nr = 0; 208 T* p = NULL; 209 if(mSRef) {nr = mSRef->nref; p = mSRef->data;} 210 cout<<"NDataBlock::Print nel="<<mSz<<" nref="<<nr<<" ("<<p<<")"<<endl; 229 T* p = NULL; Bridge* br = NULL; 230 if(mSRef) {nr = mSRef->nref; p = mSRef->data; br = mSRef->bridge;} 231 cout<<"NDataBlock::Print("<<this<<",Sz="<<mSz<<",IsTemp="<<mIsTemp<<")\n" 232 <<" mSRef="<<mSRef<<"(nref="<<nr<<",data="<<p 233 <<",bridge="<<br<<")"<<endl; 211 234 if(i1>=mSz || n<=0 || !p) return; 212 235 size_t i2 = i1+n; if(i2>mSz) i2=mSz;
Note:
See TracChangeset
for help on using the changeset viewer.