mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-19 13:40:49 +03:00
0022850: Not stable fix 22735
Class TopTools_MutexForShapeProvider has been created Class contain methods: TopTools_MutexForShapeProvider::CreateMutexesForSubShapes - Creates and associates mutexes with each sub-shape of type theType in theShape. TopTools_MutexForShapeProvider::CreateMutexForShape - Creates and associates mutex with theShape TopTools_MutexForShapeProvider::GetMutex - Returns pointer to mutex associated with theShape. In case when mutex not found returns NULL. Added method RemoveAllMutexes to TopTools_MutexForShapeProvider Assign operator in MutexProvider, constructor and operator and assign operator in Standard_Mutex now private Replaced TopExp_Explorer with TopoDS_Iterator to avoid cyclic dependence
This commit is contained in:
66
src/TopTools/TopTools_MutexForShapeProvider.hxx
Normal file
66
src/TopTools/TopTools_MutexForShapeProvider.hxx
Normal file
@@ -0,0 +1,66 @@
|
||||
// Created on: 2012-06-27
|
||||
// Created by: Dmitry BOBYLEV
|
||||
// Copyright (c) 2012 OPEN CASCADE SAS
|
||||
//
|
||||
// The content of this file is subject to the Open CASCADE Technology Public
|
||||
// License Version 6.5 (the "License"). You may not use the content of this file
|
||||
// except in compliance with the License. Please obtain a copy of the License
|
||||
// at http://www.opencascade.org and read it completely before using this file.
|
||||
//
|
||||
// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
|
||||
// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
|
||||
//
|
||||
// The Original Code and all software distributed under the License is
|
||||
// distributed on an "AS IS" basis, without warranty of any kind, and the
|
||||
// Initial Developer hereby disclaims all such warranties, including without
|
||||
// limitation, any warranties of merchantability, fitness for a particular
|
||||
// purpose or non-infringement. Please see the License for the specific terms
|
||||
// and conditions governing the rights and limitations under the License.
|
||||
|
||||
|
||||
#ifndef _TopTools_MutexForShapeProvider_HeaderFile
|
||||
#define _TopTools_MutexForShapeProvider_HeaderFile
|
||||
|
||||
#include <NCollection_DataMap.hxx>
|
||||
#include <Standard_Mutex.hxx>
|
||||
#include <TopAbs_ShapeEnum.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <TopTools_ShapeMapHasher.hxx>
|
||||
|
||||
|
||||
//! Class TopTools_MutexForShapeProvider
|
||||
//! This class is used to create and store mutexes associated with shapes.
|
||||
class TopTools_MutexForShapeProvider
|
||||
{
|
||||
public:
|
||||
//! Constructor
|
||||
Standard_EXPORT TopTools_MutexForShapeProvider();
|
||||
|
||||
//! Destructor
|
||||
Standard_EXPORT ~TopTools_MutexForShapeProvider();
|
||||
|
||||
//! Creates and associates mutexes with each sub-shape of type theType in theShape.
|
||||
Standard_EXPORT void CreateMutexesForSubShapes(const TopoDS_Shape& theShape, const TopAbs_ShapeEnum theType);
|
||||
|
||||
//! Creates and associates mutex with theShape
|
||||
Standard_EXPORT void CreateMutexForShape(const TopoDS_Shape& theShape);
|
||||
|
||||
//! Returns pointer to mutex associated with theShape.
|
||||
//! In case when mutex not found returns NULL.
|
||||
Standard_EXPORT Standard_Mutex* GetMutex(const TopoDS_Shape& theShape) const;
|
||||
|
||||
//! Removes all mutexes
|
||||
Standard_EXPORT void RemoveAllMutexes();
|
||||
|
||||
private:
|
||||
//! This method should not be called (prohibited).
|
||||
TopTools_MutexForShapeProvider (const TopTools_MutexForShapeProvider &);
|
||||
//! This method should not be called (prohibited).
|
||||
TopTools_MutexForShapeProvider & operator = (const TopTools_MutexForShapeProvider &);
|
||||
|
||||
|
||||
NCollection_DataMap<TopoDS_Shape, Standard_Mutex *, TopTools_ShapeMapHasher> myMap;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user