Warnings on vc14 were eliminated
[occt.git] / src / MMgt / MMgt_TShared.hxx
CommitLineData
42cf5bc1 1// Created on: 1992-10-13
2// Created by: Ramin BARRETO, CLE (1994 Standard Light)
3// Copyright (c) 1992-1999 Matra Datavision
4// Copyright (c) 1999-2014 OPEN CASCADE SAS
5//
6// This file is part of Open CASCADE Technology software library.
7//
8// This library is free software; you can redistribute it and/or modify it under
9// the terms of the GNU Lesser General Public License version 2.1 as published
10// by the Free Software Foundation, with special exception defined in the file
11// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12// distribution for complete text of the license and disclaimer of any warranty.
13//
14// Alternatively, this file may be used under the terms of Open CASCADE
15// commercial license or contractual agreement.
16
17#ifndef _MMgt_TShared_HeaderFile
18#define _MMgt_TShared_HeaderFile
19
20#include <Standard.hxx>
21#include <Standard_Type.hxx>
22
23#include <Standard_Transient.hxx>
24class Standard_OutOfMemory;
25
26
27class MMgt_TShared;
28DEFINE_STANDARD_HANDLE(MMgt_TShared, Standard_Transient)
29
30
31//! Intermediate class between Standard_Transient
32//! and descendants.
33//! The abstract class TShared is the root class of
34//! managed objects. TShared objects are managed
35//! by a memory manager based on reference
36//! counting. They have handle semantics. In other
37//! words, the reference counter is transparently
38//! incremented and decremented according to the
39//! scope of handles. When all handles, which
40//! reference a single object are out of scope, the
41//! reference counter becomes null and the object is
42//! automatically deleted. The deallocated memory is
43//! not given back to the system though. It is
44//! reclaimed for new objects of the same size.
45//! Warning
46//! This memory management scheme does not
47//! work for cyclic data structures. In such cases
48//! (with back pointers for example), you should
49//! interrupt the cycle in a class by using a full C++
50//! pointer instead of a handle.
51class MMgt_TShared : public Standard_Transient
52{
53
54public:
55
56
57 Standard_EXPORT virtual void Delete() const Standard_OVERRIDE;
58
59
60
61
92efcf78 62 DEFINE_STANDARD_RTTIEXT(MMgt_TShared,Standard_Transient)
42cf5bc1 63
64protected:
65
66
67
68
69private:
70
71
72
73
74};
75
76
77
78
79
80
81
82#endif // _MMgt_TShared_HeaderFile