Open CASCADE Technology  7.1.0.beta
Public Member Functions

MMgt_TShared Class Reference

Intermediate class between Standard_Transient and descendants. The abstract class TShared is the root class of managed objects. TShared objects are managed by a memory manager based on reference counting. They have handle semantics. In other words, the reference counter is transparently incremented and decremented according to the scope of handles. When all handles, which reference a single object are out of scope, the reference counter becomes null and the object is automatically deleted. The deallocated memory is not given back to the system though. It is reclaimed for new objects of the same size. Warning This memory management scheme does not work for cyclic data structures. In such cases (with back pointers for example), you should interrupt the cycle in a class by using a full C++ pointer instead of a handle. More...

#include <MMgt_TShared.hxx>

Inherits Standard_Transient.

Inherited by Adaptor2d_HCurve2d, Adaptor3d_HCurve, Adaptor3d_HSurface, Adaptor3d_HVertex, Adaptor3d_TopolTool, AIS_GlobalStatus, AIS_LocalContext, AIS_LocalStatus, AppDef_SmoothCriterion, Approx_CurvlinFunc, Approx_SweepFunction, Aspect_Grid, Aspect_Window, BinMDF_ADriver, BinMDF_ADriverTable, BOPDS_CommonBlock, BOPDS_PaveBlock, BRep_CurveRepresentation, BRep_PointRepresentation, BRepAlgo_AsDes, BRepAlgo_EdgeConnector, BRepApprox_ApproxLine, BRepBlend_Line, BRepBuilderAPI_Sewing, BRepCheck_Result, BRepFill_LocationLaw, BRepFill_PipeShell, BRepFill_SectionLaw, BRepTools_Modification, BRepTools_ReShape, ChFiDS_Spine, ChFiDS_Stripe, ChFiDS_SurfData, Contap_TheIWLineOfTheIWalking, DBRep_Edge, DBRep_Face, DDataStd_DrawDriver, DDF_Transaction, Draw_Drawable3D, Expr_GeneralExpression, Expr_GeneralFunction, Expr_GeneralRelation, ExprIntrp_Generator, FEmTool_Curve, FEmTool_ElementaryCriterion, FEmTool_SparseMatrix, Font_FontMgr, Font_SystemFont, GccInt_Bisec, Geom2d_Geometry, Geom2d_Transformation, Geom_Geometry, Geom_OsculatingSurface, GeomFill_Boundary, GeomFill_CoonsAlgPatch, GeomFill_Line, GeomFill_LocationLaw, GeomFill_SectionLaw, GeomFill_TgtField, GeomFill_TrihedronLaw, GeomPlate_CurveConstraint, GeomPlate_PointConstraint, GeomTools_UndefinedTypeHandler, Graphic3d_ArrayOfPrimitives, Graphic3d_DataStructureManager, Graphic3d_GraphicDriver, Graphic3d_Group, Graphic3d_Structure, Graphic3d_StructureManager, HeaderSection_FileDescription, HeaderSection_FileName, HeaderSection_FileSchema, HLRAlgo_EdgesBlock, HLRAlgo_PolyAlgo, HLRAlgo_PolyData, HLRAlgo_PolyInternalData, HLRAlgo_PolyInternalNode, HLRAlgo_PolyShellData, HLRAlgo_WiresBlock, HLRBRep_AreaLimit, HLRBRep_Data, HLRBRep_InternalAlgo, HLRBRep_PolyAlgo, HLRTest_ShapeData, HLRTopoBRep_OutLiner, IFSelect_Activator, IFSelect_AppliedModifiers, IFSelect_Dispatch, IFSelect_EditForm, IFSelect_Editor, IFSelect_GeneralModifier, IFSelect_IntParam, IFSelect_ListEditor, IFSelect_ModelCopier, IFSelect_PacketList, IFSelect_Selection, IFSelect_SessionDumper, IFSelect_ShareOut, IFSelect_SignatureList, IFSelect_Transformer, IFSelect_WorkSession, IGESBasic_HArray1OfHArray1OfIGESEntity, IGESBasic_HArray1OfHArray1OfInteger, IGESBasic_HArray1OfHArray1OfReal, IGESBasic_HArray1OfHArray1OfXY, IGESBasic_HArray1OfHArray1OfXYZ, IGESData_IGESEntity, IGESData_NodeOfSpecificLib, IGESData_NodeOfWriterLib, IGESData_ToolLocation, IGESDefs_HArray1OfHArray1OfTextDisplayTemplate, IGESSelect_ViewSorter, IGESToBRep_AlgoContainer, IGESToBRep_IGESBoundary, IGESToBRep_ToolContainer, Interface_Check, Interface_CopyControl, Interface_EntityCluster, Interface_FileReaderData, Interface_GeneralModule, Interface_GTool, Interface_HGraph, Interface_InterfaceModel, Interface_IntVal, Interface_NodeOfGeneralLib, Interface_NodeOfReaderLib, Interface_ParamList, Interface_ParamSet, Interface_Protocol, Interface_ReaderModule, Interface_ReportEntity, Interface_UndefinedContent, IntPatch_Line, IntPatch_TheIWLineOfTheIWalking, IntStart_SITopolTool, IntSurf_LineOn2S, IntTools_Context, Law_BSpline, Law_Function, LDOM_MemManager, LocOpe_GeneratedShape, LocOpe_WiresOnShape, MAT2d_Circuit, MAT2d_Connexion, MAT_Arc, MAT_BasicElt, MAT_Bisector, MAT_Edge, MAT_Graph, MAT_ListOfBisector, MAT_ListOfEdge, MAT_Node, MAT_TListNodeOfListOfBisector, MAT_TListNodeOfListOfEdge, MAT_Zone, MeshVS_DataSource, MeshVS_Drawer, MeshVS_PrsBuilder, Message_Algorithm, Message_Messenger, Message_Printer, Message_ProgressIndicator, MoniTool_CaseData, MoniTool_Element, MoniTool_IntVal, MoniTool_RealVal, MoniTool_SignText, MoniTool_Timer, MoniTool_TypedValue, NCollection_BaseAllocator, NLPlate_HGPPConstraint, OpenGl_Window, PLib_Base, Poly_Polygon2D, Poly_Polygon3D, Poly_PolygonOnTriangulation, Poly_Triangulation, Prs3d_BasicAspect, Prs3d_Drawer, Prs3d_PlaneSet, Prs3d_Projector, PrsMgr_PresentableObject, PrsMgr_Presentation, PrsMgr_PresentationManager, QANewModTopOpe_ReShaper, Resource_Manager, SelectBasics_EntityOwner, SelectBasics_SensitiveEntity, SelectMgr_Filter, SelectMgr_Selection, SelectMgr_SelectionManager, SelectMgr_ViewerSelector, ShapeAlgo_AlgoContainer, ShapeAlgo_ToolContainer, ShapeAnalysis_FreeBoundData, ShapeAnalysis_Surface, ShapeAnalysis_TransferParameters, ShapeAnalysis_Wire, ShapeConstruct_ProjectCurveOnSurface, ShapeCustom_RestrictionParameters, ShapeExtend_BasicMsgRegistrator, ShapeExtend_WireData, ShapeFix_Edge, ShapeFix_EdgeProjAux, ShapeFix_Root, ShapeProcess_Context, ShapeProcess_Operator, ShapeUpgrade_RemoveLocations, ShapeUpgrade_SplitCurve, ShapeUpgrade_SplitSurface, ShapeUpgrade_Tool, ShapeUpgrade_UnifySameDomain, StepAP242_IdAttribute, StepAP242_ItemIdentifiedRepresentationUsage, StepBasic_Action, StepBasic_ActionAssignment, StepBasic_ActionMethod, StepBasic_ActionRequestAssignment, StepBasic_ActionRequestSolution, StepBasic_Address, StepBasic_ApplicationContext, StepBasic_ApplicationContextElement, StepBasic_ApplicationProtocolDefinition, StepBasic_Approval, StepBasic_ApprovalAssignment, StepBasic_ApprovalDateTime, StepBasic_ApprovalPersonOrganization, StepBasic_ApprovalRelationship, StepBasic_ApprovalRole, StepBasic_ApprovalStatus, StepBasic_Certification, StepBasic_CertificationAssignment, StepBasic_CertificationType, StepBasic_CharacterizedObject, StepBasic_Contract, StepBasic_ContractAssignment, StepBasic_ContractType, StepBasic_CoordinatedUniversalTimeOffset, StepBasic_Date, StepBasic_DateAndTime, StepBasic_DateAndTimeAssignment, StepBasic_DateAssignment, StepBasic_DateRole, StepBasic_DateTimeRole, StepBasic_DerivedUnit, StepBasic_DerivedUnitElement, StepBasic_DimensionalExponents, StepBasic_Document, StepBasic_DocumentProductAssociation, StepBasic_DocumentReference, StepBasic_DocumentRelationship, StepBasic_DocumentRepresentationType, StepBasic_DocumentType, StepBasic_DocumentUsageConstraint, StepBasic_Effectivity, StepBasic_EffectivityAssignment, StepBasic_EulerAngles, StepBasic_ExternallyDefinedItem, StepBasic_ExternalSource, StepBasic_GeneralProperty, StepBasic_Group, StepBasic_GroupAssignment, StepBasic_GroupRelationship, StepBasic_IdentificationAssignment, StepBasic_IdentificationRole, StepBasic_LocalTime, StepBasic_MeasureWithUnit, StepBasic_NameAssignment, StepBasic_NamedUnit, StepBasic_ObjectRole, StepBasic_Organization, StepBasic_OrganizationAssignment, StepBasic_OrganizationRole, StepBasic_Person, StepBasic_PersonAndOrganization, StepBasic_PersonAndOrganizationAssignment, StepBasic_PersonAndOrganizationRole, StepBasic_Product, StepBasic_ProductCategory, StepBasic_ProductCategoryRelationship, StepBasic_ProductDefinition, StepBasic_ProductDefinitionFormation, StepBasic_ProductDefinitionFormationRelationship, StepBasic_ProductDefinitionReference, StepBasic_ProductDefinitionRelationship, StepBasic_RoleAssociation, StepBasic_SecurityClassification, StepBasic_SecurityClassificationAssignment, StepBasic_SecurityClassificationLevel, StepBasic_VersionedActionRequest, STEPCAFControl_ExternFile, StepData_Described, StepData_EDescr, StepData_FreeFormEntity, StepData_NodeOfWriterLib, StepData_PDescr, StepData_SelectMember, StepData_UndefinedEntity, StepDimTol_DatumReference, StepDimTol_DatumReferenceModifierWithValue, StepDimTol_GeometricTolerance, StepDimTol_GeometricToleranceRelationship, StepDimTol_RunoutZoneOrientation, StepDimTol_ToleranceZoneDefinition, StepDimTol_ToleranceZoneForm, StepElement_AnalysisItemWithinRepresentation, StepElement_CurveElementEndReleasePacket, StepElement_CurveElementSectionDefinition, StepElement_ElementDescriptor, StepElement_ElementMaterial, StepElement_SurfaceElementProperty, StepElement_SurfaceSection, StepElement_SurfaceSectionField, StepFEA_Curve3dElementProperty, StepFEA_CurveElementEndOffset, StepFEA_CurveElementEndRelease, StepFEA_CurveElementInterval, StepFEA_CurveElementLocation, StepFEA_ElementGeometricRelationship, StepFEA_FeaCurveSectionGeometricRelationship, StepFEA_FeaSurfaceSectionGeometricRelationship, StepFEA_FreedomAndCoefficient, StepFEA_FreedomsList, StepGeom_CompositeCurveSegment, StepGeom_SurfacePatch, StepRepr_AssemblyComponentUsageSubstitute, StepRepr_ConfigurationDesign, StepRepr_ConfigurationItem, StepRepr_DataEnvironment, StepRepr_FunctionallyDefinedTransformation, StepRepr_ItemDefinedTransformation, StepRepr_MaterialDesignation, StepRepr_ProductConcept, StepRepr_PropertyDefinition, StepRepr_PropertyDefinitionRelationship, StepRepr_PropertyDefinitionRepresentation, StepRepr_Representation, StepRepr_RepresentationContext, StepRepr_RepresentationItem, StepRepr_RepresentationMap, StepRepr_RepresentationRelationship, StepRepr_ShapeAspect, StepRepr_ShapeAspectRelationship, STEPSelections_AssemblyComponent, STEPSelections_AssemblyLink, StepShape_BoxDomain, StepShape_ContextDependentShapeRepresentation, StepShape_DimensionalCharacteristicRepresentation, StepShape_DimensionalSize, StepShape_LimitsAndFits, StepShape_MeasureQualification, StepShape_PlusMinusTolerance, StepShape_PrecisionQualifier, StepShape_ToleranceValue, StepShape_TypeQualifier, StepShape_ValueFormatTypeQualifier, StepVisual_AreaInSet, StepVisual_Colour, StepVisual_CurveStyle, StepVisual_CurveStyleFont, StepVisual_CurveStyleFontPattern, StepVisual_FillAreaStyle, StepVisual_FillAreaStyleColour, StepVisual_Invisibility, StepVisual_PointStyle, StepVisual_PreDefinedItem, StepVisual_PresentationLayerAssignment, StepVisual_PresentationLayerUsage, StepVisual_PresentationSet, StepVisual_PresentationSize, StepVisual_PresentationStyleAssignment, StepVisual_PresentedItem, StepVisual_PresentedItemRepresentation, StepVisual_SurfaceSideStyle, StepVisual_SurfaceStyleBoundary, StepVisual_SurfaceStyleControlGrid, StepVisual_SurfaceStyleFillArea, StepVisual_SurfaceStyleParameterLine, StepVisual_SurfaceStyleSegmentationCurve, StepVisual_SurfaceStyleSilhouette, StepVisual_SurfaceStyleUsage, StepVisual_TextStyle, StepVisual_TextStyleForDefinedFont, StepVisual_ViewVolume, StlMesh_Mesh, StlMesh_MeshDomain, StlMesh_MeshTriangle, Storage_CallBack, Storage_Data, Storage_HeaderData, Storage_InternalData, Storage_Root, Storage_RootData, Storage_Schema, Storage_TypeData, Storage_TypedCallBack, TCollection_HAsciiString, TCollection_HExtendedString, TCollection_MapNode, TCollection_SeqNode, TColStd_HPackedMapOfInteger, TDataStd_HDataMapOfStringByte, TDataStd_HDataMapOfStringHArray1OfInteger, TDataStd_HDataMapOfStringHArray1OfReal, TDataStd_HDataMapOfStringInteger, TDataStd_HDataMapOfStringReal, TDataStd_HDataMapOfStringString, TDF_Attribute, TDF_AttributeDelta, TDF_Data, TDF_DataSet, TDF_Delta, TDF_RelocationTable, TDocStd_ApplicationDelta, TDocStd_MultiTransactionManager, TFunction_Driver, TFunction_DriverTable, TNaming_TranslateTool, TObj_Model, TObj_Object, TObj_ObjectIterator, TopLoc_Datum3D, TopLoc_SListNodeOfItemLocation, TopoDS_HShape, TopoDS_TShape, TopOpeBRep_FFDumper, TopOpeBRep_Hctxee2d, TopOpeBRep_Hctxff2d, TopOpeBRepBuild_HBuilder, TopOpeBRepBuild_Loop, TopOpeBRepDS_Association, TopOpeBRepDS_Check, TopOpeBRepDS_GapTool, TopOpeBRepDS_HDataStructure, TopOpeBRepDS_Interference, TopOpeBRepDS_Marker, TopOpeBRepTool_HBoxTool, TPrsStd_Driver, TPrsStd_DriverTable, Transfer_ActorOfProcessForFinder, Transfer_ActorOfProcessForTransient, Transfer_Binder, Transfer_Finder, Transfer_MapContainer, Transfer_ProcessForFinder, Transfer_ProcessForTransient, Transfer_ResultFromModel, Transfer_ResultFromTransient, TransferBRep_TransferResultInfo, Units_Dimensions, Units_Lexicon, Units_Quantity, Units_Token, Units_Unit, Units_UnitsDictionary, Units_UnitsSystem, V3d_Light, V3d_Plane, V3d_View, ViewerTest_EventManager, Vrml_AsciiText, Vrml_Coordinate3, Vrml_IndexedFaceSet, Vrml_IndexedLineSet, Vrml_LOD, Vrml_Material, Vrml_Normal, Vrml_SFImage, Vrml_TextureCoordinate2, VrmlConverter_Drawer, VrmlConverter_LineAspect, VrmlConverter_PointAspect, VrmlConverter_Projector, VrmlConverter_ShadingAspect, XmlMDF_ADriver, XmlMDF_ADriverTable, XSAlgo_AlgoContainer, XSAlgo_ToolContainer, XSControl_Controller, XSControl_TransferReader, XSControl_TransferWriter, and XSControl_Vars.

Public Member Functions

virtual void Delete () const override
 Memory deallocator for transient classes. More...
 
- Public Member Functions inherited from Standard_Transient
 Standard_Transient ()
 Empty constructor. More...
 
 Standard_Transient (const Standard_Transient &)
 Copy constructor – does nothing. More...
 
Standard_Transientoperator= (const Standard_Transient &)
 Assignment operator, needed to avoid copying reference counter. More...
 
virtual ~Standard_Transient ()
 Destructor must be virtual. More...
 
virtual const opencascade::handle< Standard_Type > & DynamicType () const
 Returns a type descriptor about this object. More...
 
Standard_Boolean IsInstance (const opencascade::handle< Standard_Type > &theType) const
 Returns a true value if this is an instance of Type. More...
 
Standard_Boolean IsInstance (const Standard_CString theTypeName) const
 Returns a true value if this is an instance of TypeName. More...
 
Standard_Boolean IsKind (const opencascade::handle< Standard_Type > &theType) const
 Returns true if this is an instance of Type or an instance of any class that inherits from Type. Note that multiple inheritance is not supported by OCCT RTTI mechanism. More...
 
Standard_Boolean IsKind (const Standard_CString theTypeName) const
 Returns true if this is an instance of TypeName or an instance of any class that inherits from TypeName. Note that multiple inheritance is not supported by OCCT RTTI mechanism. More...
 
Standard_TransientThis () const
 Returns non-const pointer to this object (like const_cast). For protection against creating handle to objects allocated in stack or call from constructor, it will raise exception Standard_ProgramError if reference counter is zero. More...
 
Standard_Integer GetRefCount () const
 Get the reference counter of this object. More...
 
void IncrementRefCounter () const
 Increments the reference counter of this object. More...
 
Standard_Integer DecrementRefCounter () const
 Decrements the reference counter of this object; returns the decremented value. More...
 

Additional Inherited Members

- Public Types inherited from Standard_Transient
typedef void base_type
 Returns a type descriptor about this object. More...
 
- Static Public Member Functions inherited from Standard_Transient
static const char * get_type_name ()
 Returns a type descriptor about this object. More...
 
static const opencascade::handle< Standard_Type > & get_type_descriptor ()
 Returns type descriptor of Standard_Transient class. More...
 

Detailed Description

Intermediate class between Standard_Transient and descendants. The abstract class TShared is the root class of managed objects. TShared objects are managed by a memory manager based on reference counting. They have handle semantics. In other words, the reference counter is transparently incremented and decremented according to the scope of handles. When all handles, which reference a single object are out of scope, the reference counter becomes null and the object is automatically deleted. The deallocated memory is not given back to the system though. It is reclaimed for new objects of the same size. Warning This memory management scheme does not work for cyclic data structures. In such cases (with back pointers for example), you should interrupt the cycle in a class by using a full C++ pointer instead of a handle.

Member Function Documentation

virtual void MMgt_TShared::Delete ( ) const
overridevirtual

Memory deallocator for transient classes.

Reimplemented from Standard_Transient.


The documentation for this class was generated from the following file: