diff --git a/src/Bnd/Bnd_BoundSortBox.cxx b/src/Bnd/Bnd_BoundSortBox.cxx index 30438dd1fe..9957b1cb03 100644 --- a/src/Bnd/Bnd_BoundSortBox.cxx +++ b/src/Bnd/Bnd_BoundSortBox.cxx @@ -123,7 +123,10 @@ static long unsigned _P2[32] = { 1,2,4,8, 16,32,64,128, 256,512,1024,2048, 1048576,2097152,4194304,8388608, 16777216,33554432,67108864,134217728, 268435456,536870912,1073741824,2147483648U}; -class BSB_T3Bits { //-- size is power of 2 > 4 + +//-- size is power of 2 > 4 +class BSB_T3Bits +{ public: Standard_Integer _DECAL; @@ -162,26 +165,36 @@ public: Standard_Integer NbAxisZ(const Standard_Integer i) { return(axisZ[0][i]); } inline Standard_Integer GrilleInteger(Standard_Integer ix, - Standard_Integer iy, - Standard_Integer iz) { + Standard_Integer iy, + Standard_Integer iz) + { Standard_Integer tz = iz<<_DECAL2; Standard_Integer ty = iy<<_DECAL; Standard_Integer t = ix; - t|=ty; t|=tz; + t|=ty; + t|=tz; return(t); } - + inline void IntegerGrille(Standard_Integer t, - Standard_Integer &ix, - Standard_Integer &iy, - Standard_Integer &iz) { + Standard_Integer &ix, + Standard_Integer &iy, + Standard_Integer &iz) + { ix = t & _BASEM1; t>>=_DECAL; iy = t & _BASEM1; t>>=_DECAL; iz = t; } + +private: + + BSB_T3Bits (const BSB_T3Bits&); + BSB_T3Bits& operator= (const BSB_T3Bits&); }; + //======================================================================= -BSB_T3Bits::~BSB_T3Bits() { +BSB_T3Bits::~BSB_T3Bits() +{ if(p) { delete [] p; p=0; } #if DEBUG printf("\n BASE:%d\n",_BASE); diff --git a/src/IntPatch/IntPatch_PrmPrmIntersection.cxx b/src/IntPatch/IntPatch_PrmPrmIntersection.cxx index 683e2c89e9..8c6728367c 100644 --- a/src/IntPatch/IntPatch_PrmPrmIntersection.cxx +++ b/src/IntPatch/IntPatch_PrmPrmIntersection.cxx @@ -2998,7 +2998,14 @@ public: const Standard_Integer j) { return myP2[Index(i,j)]; }; -protected: + +private: + + IntPatch_InfoPD (const IntPatch_InfoPD&); + IntPatch_InfoPD& operator=(const IntPatch_InfoPD&); + +private: + Standard_Integer myNBI; char *myP1DS2; char *myP2DS1; diff --git a/src/LDOM/LDOM_OSStream.cxx b/src/LDOM/LDOM_OSStream.cxx index 0dee401691..c4f6969144 100644 --- a/src/LDOM/LDOM_OSStream.cxx +++ b/src/LDOM/LDOM_OSStream.cxx @@ -14,33 +14,22 @@ // commercial license or contractual agreement. #include -#include #include #include #include #include -// One element of sequence -/* Can only be allocated by the allocator and assumes it is IncAllocator, so - no destructor is required. -*/ -class LDOM_StringElem +//======================================================================= +//function : LDOM_StringElem() +//purpose : Constructor +//======================================================================= +LDOM_SBuffer::LDOM_StringElem::LDOM_StringElem + ( const int theLength, const Handle_NCollection_BaseAllocator& theAlloc ) +: buf (reinterpret_cast(theAlloc->Allocate (theLength))), + len (0), + next(0) { - char* buf; // pointer on data string - int len; // quantity of really written data - LDOM_StringElem* next; // pointer on the next element of a sequence - - DEFINE_NCOLLECTION_ALLOC - - LDOM_StringElem (int aLen, const Handle_NCollection_BaseAllocator& theAlloc) : - buf (reinterpret_cast (theAlloc->Allocate (aLen))), - len (0), - next (0) - { - } - -friend class LDOM_SBuffer; -}; +} //======================================================================= //function : LDOM_SBuffer() diff --git a/src/LDOM/LDOM_OSStream.hxx b/src/LDOM/LDOM_OSStream.hxx index ce1b316ee2..2648b9253e 100644 --- a/src/LDOM/LDOM_OSStream.hxx +++ b/src/LDOM/LDOM_OSStream.hxx @@ -32,6 +32,7 @@ // and current element of sequence, // also it has methods for the sequence management. +#include #include #include #include @@ -39,11 +40,28 @@ #include #include /* EOF */ -class LDOM_StringElem; // defined in cxx file - class LDOM_SBuffer : public streambuf { - public: + // One element of sequence. + // Can only be allocated by the allocator and assumes + // it is IncAllocator, so destructor isn't required. + struct LDOM_StringElem + { + char* buf; //!< pointer on data string + int len; //!< quantity of really written data + LDOM_StringElem* next; //!< pointer on the next element of a sequence + + DEFINE_NCOLLECTION_ALLOC + + LDOM_StringElem(const int, const Handle_NCollection_BaseAllocator&); + ~LDOM_StringElem(); + + private: + LDOM_StringElem (const LDOM_StringElem&); + LDOM_StringElem& operator= (const LDOM_StringElem&); + }; + +public: Standard_EXPORT LDOM_SBuffer (const Standard_Integer theMaxBuf); // Constructor. Sets a default value for the // length of each sequence element. @@ -74,8 +92,8 @@ class LDOM_SBuffer : public streambuf Standard_EXPORT ~LDOM_SBuffer (); // Destructor - private: - +private: + Standard_Integer myMaxBuf; // default length of one element Standard_Integer myLength; // full length of contained data LDOM_StringElem* myFirstString; // the head of the sequence diff --git a/src/PLib/PLib.cxx b/src/PLib/PLib.cxx index 23fa302675..2de1ca60bc 100644 --- a/src/PLib/PLib.cxx +++ b/src/PLib/PLib.cxx @@ -264,6 +264,10 @@ public: return Standard_Real (myBinom[N][P]); } +private: + BinomAllocator (const BinomAllocator&); + BinomAllocator& operator= (const BinomAllocator&); + private: Standard_Integer** myBinom; Standard_Integer myMaxBinom; diff --git a/src/ProjLib/ProjLib_ProjectOnSurface.cxx b/src/ProjLib/ProjLib_ProjectOnSurface.cxx index 5098b3f061..c71c2ce0f1 100644 --- a/src/ProjLib/ProjLib_ProjectOnSurface.cxx +++ b/src/ProjLib/ProjLib_ProjectOnSurface.cxx @@ -85,10 +85,7 @@ static Standard_Boolean OnSurface_D1(const Standard_Real , // U, class ProjLib_OnSurface : public AppCont_Function { - Handle(Adaptor3d_HCurve) myCurve; - Extrema_ExtPS *myExtPS; - - public : +public: ProjLib_OnSurface(const Handle(Adaptor3d_HCurve) & C, const Handle(Adaptor3d_HSurface) & S) @@ -125,6 +122,14 @@ class ProjLib_OnSurface : public AppCont_Function gp_Pnt aPnt; return OnSurface_D1(theT, aPnt, theVec(1), myCurve, myExtPS); } + +private: + ProjLib_OnSurface (const ProjLib_OnSurface&); + ProjLib_OnSurface& operator= (const ProjLib_OnSurface&); + +private: + Handle(Adaptor3d_HCurve) myCurve; + Extrema_ExtPS* myExtPS; }; diff --git a/src/Select3D/Select3D_PointData.hxx b/src/Select3D/Select3D_PointData.hxx index e294b67f9d..1d6b9492ec 100644 --- a/src/Select3D/Select3D_PointData.hxx +++ b/src/Select3D/Select3D_PointData.hxx @@ -106,9 +106,10 @@ public: } private: + Select3D_PointData (const Select3D_PointData&); + Select3D_PointData& operator= (const Select3D_PointData&); - // Default constructor - Select3D_PointData () {} +private: Select3D_Pnt* mypolyg3d; Select3D_Pnt2d* mypolyg2d; diff --git a/src/Standard/Standard.cxx b/src/Standard/Standard.cxx index 4f79abb650..8cdd855bfb 100644 --- a/src/Standard/Standard.cxx +++ b/src/Standard/Standard.cxx @@ -46,12 +46,18 @@ // used to construct appropriate memory manager according // to environment settings, and to ensure destruction upon exit //======================================================================= - -class Standard_MMgrFactory { - public: - Standard_MMgrFactory(); +class Standard_MMgrFactory +{ +public: + static Standard_MMgrRoot* GetMMgr(); ~Standard_MMgrFactory(); - public: + +private: + Standard_MMgrFactory(); + Standard_MMgrFactory (const Standard_MMgrFactory&); + Standard_MMgrFactory& operator= (const Standard_MMgrFactory&); + +private: Standard_MMgrRoot* myFMMgr; }; @@ -157,11 +163,8 @@ Standard_MMgrFactory::Standard_MMgrFactory() Standard_MMgrFactory::~Standard_MMgrFactory() { - if ( myFMMgr ) { + if ( myFMMgr ) myFMMgr->Purge(Standard_True); -// delete myFMMgr; -// myFMMgr = 0; - } } //======================================================================= @@ -205,8 +208,7 @@ Standard_MMgrFactory::~Standard_MMgrFactory() // be counting calls to Allocate() and Free()... // //======================================================================= - -static Standard_MMgrRoot* GetMMgr() +Standard_MMgrRoot* Standard_MMgrFactory::GetMMgr() { static Standard_MMgrFactory aFactory; return aFactory.myFMMgr; @@ -219,7 +221,7 @@ static Standard_MMgrRoot* GetMMgr() Standard_Address Standard::Allocate(const Standard_Size size) { - return GetMMgr()->Allocate(size); + return Standard_MMgrFactory::GetMMgr()->Allocate(size); } //======================================================================= @@ -229,7 +231,7 @@ Standard_Address Standard::Allocate(const Standard_Size size) void Standard::Free (Standard_Address theStorage) { - GetMMgr()->Free(theStorage); + Standard_MMgrFactory::GetMMgr()->Free(theStorage); } //======================================================================= @@ -240,7 +242,7 @@ void Standard::Free (Standard_Address theStorage) Standard_Address Standard::Reallocate (Standard_Address theStorage, const Standard_Size theSize) { - return GetMMgr()->Reallocate (theStorage, theSize); + return Standard_MMgrFactory::GetMMgr()->Reallocate (theStorage, theSize); } //======================================================================= @@ -250,7 +252,7 @@ Standard_Address Standard::Reallocate (Standard_Address theStorage, Standard_Integer Standard::Purge() { - return GetMMgr()->Purge(); + return Standard_MMgrFactory::GetMMgr()->Purge(); } //=======================================================================