Ignore:
Timestamp:
Apr 23, 1999, 7:57:19 PM (26 years ago)
Author:
ansari
Message:

encore version inter cmv 23/4/99

File:
1 edited

Legend:

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

    r265 r267  
    6767{
    6868Delete();
     69}
     70
     71template <class T>
     72void NDataBlock<T>::SetTemp(bool temp)
     73// Set temporary
     74{
     75mIsTemp=temp;
     76    #ifdef DEBUG_NDATABLOCK
     77    cout<<"DEBUG_NDataBlock::SetTemp("<<this<<","<<temp
     78        <<"), mSz="<<mSz<<" mSRef="<<mSRef<<" IsTemp="<<mIsTemp<<endl;
     79    #endif
    6980}
    7081
     
    89100{
    90101    #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;
    93105    #endif
    94106if(n==0) throw(SzMismatchError("NDataBlock::Alloc n==0\n"));
     
    101113    #ifdef DEBUG_NDATABLOCK
    102114    if(!data) NallocData++; NallocSRef++;
    103     cout<<"...DEBUG_NDataBlock::Alloc("<<n<<") mSRef="<<mSRef
     115    cout<<"...DEBUG_NDataBlock::Alloc mSz="<<mSz<<" mSRef="<<mSRef
    104116        <<" mSRef->nref="<<mSRef->nref<<" mSRef->data="<< mSRef->data
     117        <<" mSRef->bridge="<<mSRef->bridge<<" IsTemp="<<mIsTemp
    105118        <<" Total("<<NallocData<<","<<NallocSRef<<")"<<endl;
    106119    #endif
     
    112125{
    113126    #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;
    116130    #endif
    117131if(!a.mSRef) {mSz=0; mSRef=NULL;} // cas ou "a" est cree par defaut
     
    125139{
    126140    #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;
    128145    #endif
    129146if(&a==NULL) throw(NullPtrError("NDataBlock::Share  &a==NULL\n"));
     
    133150mSz = a.mSz; mSRef = a.mSRef; mSRef->nref++;
    134151    #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;
    137155    #endif
    138156}
     
    143161{
    144162    #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;
    147168    cout<<endl;
    148169    #endif
     
    206227{
    207228size_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;
     229T* p = NULL; Bridge* br = NULL;
     230if(mSRef) {nr = mSRef->nref; p = mSRef->data; br = mSRef->bridge;}
     231cout<<"NDataBlock::Print("<<this<<",Sz="<<mSz<<",IsTemp="<<mIsTemp<<")\n"
     232    <<"            mSRef="<<mSRef<<"(nref="<<nr<<",data="<<p
     233    <<",bridge="<<br<<")"<<endl;
    211234if(i1>=mSz || n<=0 || !p) return;
    212235size_t i2 = i1+n; if(i2>mSz) i2=mSz;
Note: See TracChangeset for help on using the changeset viewer.