Changeset 892 in Sophya


Ignore:
Timestamp:
Apr 12, 2000, 11:26:55 AM (25 years ago)
Author:
ansari
Message:

surcharge operateur =

Location:
trunk/SophyaLib/SkyMap
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaLib/SkyMap/spherehealpix.cc

    r853 r892  
    229229}
    230230
     231template<class T>
     232void SphereHEALPix<T>::CloneOrShare(const SphereHEALPix<T>& a)
     233{
     234  string exmsg = "SphereHEALPix<T>::CloneOrShare()";
     235  if (nSide_ != a.nSide_ )
     236    {
     237      cout << " spheres of different sizes " << endl;
     238      string exmsg = "SphereHEALPix<T>::CloneOrShare()";
     239      throw( ParmError(exmsg) );
     240    }
     241  pixels_.CloneOrShare(a.pixels_);
     242  sliceBeginIndex_.CloneOrShare(a.sliceBeginIndex_);
     243  sliceLenght_.CloneOrShare(a.sliceLenght_);
     244}
     245
     246template<class T>
     247SphereHEALPix<T>& SphereHEALPix<T>::Set(const SphereHEALPix<T>& a)
     248   {
     249  if (this != &a)
     250    {
     251      CloneOrShare(a);
     252      nSide_= a.nSide_;
     253     nPix_ = a.nPix_;
     254     omeg_ = a.omeg_;
     255     if (mInfo_) delete mInfo_;
     256     if (a.mInfo_) mInfo_ = new DVList(*(a.mInfo_));
     257    }
     258  return(*this);
     259   }
     260
     261
    231262//++
    232263// Titre        Destructor
  • trunk/SophyaLib/SkyMap/spherehealpix.h

    r853 r892  
    203203/* impression */
    204204void print(ostream& os) const;
    205          
     205
     206
     207 void CloneOrShare(const SphereHEALPix<T>& a);
     208
     209 SphereHEALPix<T>& Set(const SphereHEALPix<T>& a);
     210
     211inline  SphereHEALPix<T>& operator = (const SphereHEALPix<T>& a)
     212                                                       {return Set(a);}
     213       
    206214private :
    207215
Note: See TracChangeset for help on using the changeset viewer.