mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0028832: MMgt_TShared can be replaced by Standard_Transient
This commit is contained in:
@@ -25,7 +25,7 @@
|
||||
#include <iomanip>
|
||||
|
||||
|
||||
IMPLEMENT_STANDARD_RTTIEXT(NCollection_BaseAllocator,MMgt_TShared)
|
||||
IMPLEMENT_STANDARD_RTTIEXT(NCollection_BaseAllocator,Standard_Transient)
|
||||
|
||||
//=======================================================================
|
||||
//function : Allocate
|
||||
|
@@ -27,7 +27,7 @@
|
||||
#ifndef NCollection_BaseAllocator_HeaderFile
|
||||
#define NCollection_BaseAllocator_HeaderFile
|
||||
|
||||
#include <MMgt_TShared.hxx>
|
||||
#include <Standard_Transient.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <NCollection_TypeDef.hxx>
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
* CommonBaseAllocator.
|
||||
* Note that this object is managed by Handle.
|
||||
*/
|
||||
class NCollection_BaseAllocator : public MMgt_TShared
|
||||
class NCollection_BaseAllocator : public Standard_Transient
|
||||
{
|
||||
public:
|
||||
// ---------- PUBLIC METHODS ------------
|
||||
@@ -78,9 +78,9 @@ class NCollection_BaseAllocator : public MMgt_TShared
|
||||
|
||||
public:
|
||||
// ---------- CasCade RunTime Type Information
|
||||
DEFINE_STANDARD_RTTIEXT(NCollection_BaseAllocator,MMgt_TShared)
|
||||
DEFINE_STANDARD_RTTIEXT(NCollection_BaseAllocator,Standard_Transient)
|
||||
};
|
||||
|
||||
DEFINE_STANDARD_HANDLE(NCollection_BaseAllocator,MMgt_TShared)
|
||||
DEFINE_STANDARD_HANDLE(NCollection_BaseAllocator,Standard_Transient)
|
||||
|
||||
#endif
|
||||
|
@@ -20,12 +20,12 @@
|
||||
|
||||
#include <Standard_Type.hxx>
|
||||
#include <NCollection_DefineArray1.hxx>
|
||||
#include <MMgt_TShared.hxx>
|
||||
#include <Standard_Transient.hxx>
|
||||
|
||||
// Declaration of Array1 class managed by Handle
|
||||
|
||||
#define DEFINE_HARRAY1(HClassName, _Array1Type_) \
|
||||
class HClassName : public _Array1Type_, public MMgt_TShared { \
|
||||
class HClassName : public _Array1Type_, public Standard_Transient { \
|
||||
public: \
|
||||
DEFINE_STANDARD_ALLOC \
|
||||
DEFINE_NCOLLECTION_ALLOC \
|
||||
@@ -39,9 +39,9 @@ class HClassName : public _Array1Type_, public MMgt_TShared { \
|
||||
HClassName (const _Array1Type_& theOther) : _Array1Type_(theOther) {} \
|
||||
const _Array1Type_& Array1 () const { return *this; } \
|
||||
_Array1Type_& ChangeArray1 () { return *this; } \
|
||||
DEFINE_STANDARD_RTTI_INLINE(HClassName,MMgt_TShared) \
|
||||
DEFINE_STANDARD_RTTI_INLINE(HClassName,Standard_Transient) \
|
||||
}; \
|
||||
DEFINE_STANDARD_HANDLE (HClassName, MMgt_TShared)
|
||||
DEFINE_STANDARD_HANDLE (HClassName, Standard_Transient)
|
||||
|
||||
#define IMPLEMENT_HARRAY1(HClassName)
|
||||
|
||||
|
@@ -20,12 +20,12 @@
|
||||
|
||||
#include <Standard_Type.hxx>
|
||||
#include <NCollection_DefineArray2.hxx>
|
||||
#include <MMgt_TShared.hxx>
|
||||
#include <Standard_Transient.hxx>
|
||||
|
||||
// Declaration of Array2 class managed by Handle
|
||||
|
||||
#define DEFINE_HARRAY2(HClassName, _Array2Type_) \
|
||||
class HClassName : public _Array2Type_, public MMgt_TShared { \
|
||||
class HClassName : public _Array2Type_, public Standard_Transient { \
|
||||
public: \
|
||||
DEFINE_STANDARD_ALLOC \
|
||||
DEFINE_NCOLLECTION_ALLOC \
|
||||
@@ -44,9 +44,9 @@ class HClassName : public _Array2Type_, public MMgt_TShared { \
|
||||
HClassName (const _Array2Type_& theOther) : _Array2Type_(theOther) {} \
|
||||
const _Array2Type_& Array2 () const { return *this; } \
|
||||
_Array2Type_& ChangeArray2 () { return *this; } \
|
||||
DEFINE_STANDARD_RTTI_INLINE(HClassName,MMgt_TShared) \
|
||||
DEFINE_STANDARD_RTTI_INLINE(HClassName,Standard_Transient) \
|
||||
}; \
|
||||
DEFINE_STANDARD_HANDLE (HClassName, MMgt_TShared)
|
||||
DEFINE_STANDARD_HANDLE (HClassName, Standard_Transient)
|
||||
|
||||
#define IMPLEMENT_HARRAY2(HClassName)
|
||||
|
||||
|
@@ -20,12 +20,12 @@
|
||||
|
||||
#include <Standard_Type.hxx>
|
||||
#include <NCollection_DefineSequence.hxx>
|
||||
#include <MMgt_TShared.hxx>
|
||||
#include <Standard_Transient.hxx>
|
||||
|
||||
// Declaration of Sequence class managed by Handle
|
||||
|
||||
#define DEFINE_HSEQUENCE(HClassName, _SequenceType_) \
|
||||
class HClassName : public _SequenceType_, public MMgt_TShared { \
|
||||
class HClassName : public _SequenceType_, public Standard_Transient { \
|
||||
public: \
|
||||
DEFINE_STANDARD_ALLOC \
|
||||
DEFINE_NCOLLECTION_ALLOC \
|
||||
@@ -44,9 +44,9 @@ class HClassName : public _SequenceType_, public MMgt_TShared { \
|
||||
typename std::enable_if<std::is_base_of<HClassName, T>::value>::type * = 0) { \
|
||||
_SequenceType_::Append (theOther->ChangeSequence()); \
|
||||
} \
|
||||
DEFINE_STANDARD_RTTI_INLINE(HClassName,MMgt_TShared) \
|
||||
DEFINE_STANDARD_RTTI_INLINE(HClassName,Standard_Transient) \
|
||||
}; \
|
||||
DEFINE_STANDARD_HANDLE (HClassName, MMgt_TShared)
|
||||
DEFINE_STANDARD_HANDLE (HClassName, Standard_Transient)
|
||||
|
||||
#define IMPLEMENT_HSEQUENCE(HClassName)
|
||||
|
||||
|
@@ -18,7 +18,7 @@
|
||||
|
||||
#include <NCollection_UBTree.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <MMgt_TShared.hxx>
|
||||
#include <Standard_Transient.hxx>
|
||||
#include <NCollection_List.hxx>
|
||||
#include <TColStd_SequenceOfInteger.hxx>
|
||||
#include <NCollection_DataMap.hxx>
|
||||
|
@@ -16,7 +16,8 @@
|
||||
#ifndef NCollection_Handle_HeaderFile
|
||||
#define NCollection_Handle_HeaderFile
|
||||
|
||||
#include <MMgt_TShared.hxx>
|
||||
#include <Standard_Transient.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
//! Purpose: This template class is used to define Handle adaptor
|
||||
//! for allocated dynamically objects of arbitrary type.
|
||||
@@ -27,7 +28,7 @@
|
||||
//! Handle(Standard_Transient) in OCCT components.
|
||||
|
||||
template <class T>
|
||||
class NCollection_Handle : public Handle(Standard_Transient)
|
||||
class NCollection_Handle : public opencascade::handle<Standard_Transient>
|
||||
{
|
||||
private:
|
||||
|
||||
@@ -39,7 +40,7 @@ class NCollection_Handle : public Handle(Standard_Transient)
|
||||
public:
|
||||
|
||||
//! Constructor: stores pointer to the object
|
||||
Ptr (T* theObj) { myPtr = theObj; }
|
||||
Ptr (T* theObj) : myPtr (theObj) {}
|
||||
|
||||
//! Destructor deletes the object
|
||||
~Ptr () { if ( myPtr ) delete myPtr; myPtr = 0; }
|
||||
@@ -60,7 +61,7 @@ class NCollection_Handle : public Handle(Standard_Transient)
|
||||
//! Note that additional argument is used to avoid ambiguity with
|
||||
//! public constructor from pointer when Handle is intilialized by 0.
|
||||
NCollection_Handle (Ptr* thePtr, int)
|
||||
: Handle(Standard_Transient) (thePtr) {}
|
||||
: opencascade::handle<Standard_Transient> (thePtr) {}
|
||||
|
||||
public:
|
||||
|
||||
@@ -71,13 +72,13 @@ class NCollection_Handle : public Handle(Standard_Transient)
|
||||
|
||||
//! Constructor of handle from pointer on newly allocated object
|
||||
NCollection_Handle (T* theObject)
|
||||
: Handle(Standard_Transient) (theObject ? new Ptr (theObject) : 0) {}
|
||||
: opencascade::handle<Standard_Transient> (theObject ? new Ptr (theObject) : 0) {}
|
||||
|
||||
//! Cast handle to contained type
|
||||
T* get () { return ((Ptr*)Handle(Standard_Transient)::get())->myPtr; }
|
||||
T* get () { return ((Ptr*)opencascade::handle<Standard_Transient>::get())->myPtr; }
|
||||
|
||||
//! Cast handle to contained type
|
||||
const T* get () const { return ((Ptr*)Handle(Standard_Transient)::get())->myPtr; }
|
||||
const T* get () const { return ((Ptr*)opencascade::handle<Standard_Transient>::get())->myPtr; }
|
||||
|
||||
//! Cast handle to contained type
|
||||
T* operator -> () { return get(); }
|
||||
@@ -93,7 +94,7 @@ class NCollection_Handle : public Handle(Standard_Transient)
|
||||
|
||||
//! Downcast arbitrary Handle to the argument type if contained
|
||||
//! object is Handle for this type; returns null otherwise
|
||||
static NCollection_Handle<T> DownCast (const Handle(Standard_Transient)& theOther)
|
||||
static NCollection_Handle<T> DownCast (const opencascade::handle<Standard_Transient>& theOther)
|
||||
{
|
||||
return NCollection_Handle<T>(dynamic_cast<Ptr*>(theOther.get()), 0);
|
||||
}
|
||||
|
@@ -444,7 +444,7 @@ Standard_Integer NCollection_UBTree<TheObjType,TheBndType>::Select
|
||||
* _HUBTREE - the desired name of handled class
|
||||
* _OBJTYPE - the name of the object type
|
||||
* _BNDTYPE - the name of the bounding box type
|
||||
* _HPARENT - the name of parent class (usually MMgt_TShared)
|
||||
* _HPARENT - the name of parent class (usually Standard_Transient)
|
||||
*/
|
||||
#define DEFINE_HUBTREE(_HUBTREE, _OBJTYPE, _BNDTYPE, _HPARENT) \
|
||||
class _HUBTREE : public _HPARENT \
|
||||
|
Reference in New Issue
Block a user