1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-04 13:13:25 +03:00

0024911: Avoid using virtual functions in NCollection classes

NCollection_BaseCollection class, relevant header files, and macro DEFINE_BASECOLLECTION removed.
Hence methods Assign() from other compatible (via inheritance of BaseCollection) collections are not available any more, as well as base Iterator class.

All methods of Iterator classes are made non-virtual, allowing their inline expansion for better performance.

OCCT-specific operators new and delete added to collection classes and removed from iterator classes.
This commit is contained in:
abv
2014-05-08 09:13:00 +04:00
committed by apn
parent 598fcce93c
commit ddf2fe8eeb
66 changed files with 456 additions and 1016 deletions

View File

@@ -18,10 +18,7 @@
#ifndef TObj_Container_HeaderFile
#define TObj_Container_HeaderFile
#include <NCollection_DefineBaseCollection.hxx>
#include <NCollection_DefineDataMap.hxx>
#include <NCollection_DefineSequence.hxx>
#include <NCollection_DefineHSequence.hxx>
#include <NCollection_DataMap.hxx>
#include <TCollection_AsciiString.hxx>
#include <TCollection_HExtendedString.hxx>
#include <TDF_Label.hxx>
@@ -29,21 +26,10 @@
#include <TObj_Common.hxx>
#include <TObj_SequenceOfObject.hxx>
DEFINE_BASECOLLECTION (TObj_CollectionOfLabel, TDF_Label)
typedef NCollection_DataMap<Handle(TCollection_HExtendedString), TDF_Label> TObj_DataMapOfNameLabel;
DEFINE_BASECOLLECTION(TObj_CollectionOfPointer, Standard_Address)
typedef NCollection_DataMap<Handle(TObj_Object), Handle(TObj_HSequenceOfObject)> TObj_DataMapOfObjectHSequenceOcafObjects;
DEFINE_BASECOLLECTION (TObj_CollectionOfHSeqOfObject,
Handle(TObj_HSequenceOfObject))
typedef NCollection_DataMap<TCollection_AsciiString, Standard_Address> TObj_DataMapOfStringPointer;
DEFINE_DATAMAP (TObj_DataMapOfNameLabel, TObj_CollectionOfLabel,
Handle(TCollection_HExtendedString), TDF_Label)
DEFINE_DATAMAP (TObj_DataMapOfObjectHSequenceOcafObjects,
TObj_CollectionOfHSeqOfObject,
Handle(TObj_Object),Handle(TObj_HSequenceOfObject))
DEFINE_DATAMAP(TObj_DataMapOfStringPointer,TObj_CollectionOfPointer,
TCollection_AsciiString,Standard_Address)
#endif

View File

@@ -22,8 +22,6 @@
#include <TDF_Label.hxx>
#include <TObj_Partition.hxx>
#include <NCollection_DefineBaseCollection.hxx>
#include <NCollection_DefineDataMap.hxx>
#include <Message_Messenger.hxx>
class Handle(TObj_Application);
@@ -364,7 +362,3 @@ class TObj_Model : public MMgt_TShared
//! The Model Handle is defined in a separate header file
#endif
#ifdef _MSC_VER
#pragma once
#endif

View File

@@ -18,17 +18,9 @@
#ifndef TObj_SequenceOfIterator_HeaderFile
#define TObj_SequenceOfIterator_HeaderFile
#include <NCollection_DefineBaseCollection.hxx>
#include <NCollection_DefineSequence.hxx>
#include <NCollection_Sequence.hxx>
#include <TObj_ObjectIterator.hxx>
DEFINE_BASECOLLECTION (TObj_CollectionOfIterator, Handle(TObj_ObjectIterator))
DEFINE_SEQUENCE (TObj_SequenceOfIterator, TObj_CollectionOfIterator,
Handle(TObj_ObjectIterator))
typedef NCollection_Sequence<Handle(TObj_ObjectIterator)> TObj_SequenceOfIterator;
#endif
#ifdef _MSC_VER
#pragma once
#endif

View File

@@ -18,19 +18,14 @@
#ifndef TObj_SequenceOfObject_HeaderFile
#define TObj_SequenceOfObject_HeaderFile
#include <NCollection_DefineBaseCollection.hxx>
#include <NCollection_DefineSequence.hxx>
#include <NCollection_Sequence.hxx>
#include <NCollection_DefineHSequence.hxx>
#include <TObj_Common.hxx>
#include <Handle_TObj_Object.hxx>
DEFINE_BASECOLLECTION (TObj_CollectionOfObject,Handle(TObj_Object))
typedef NCollection_Sequence<Handle(TObj_Object)> TObj_SequenceOfObject;
DEFINE_SEQUENCE (TObj_SequenceOfObject,
TObj_CollectionOfObject,Handle(TObj_Object))
DEFINE_HSEQUENCE (TObj_HSequenceOfObject,
TObj_SequenceOfObject)
DEFINE_HSEQUENCE (TObj_HSequenceOfObject, TObj_SequenceOfObject)
#endif

View File

@@ -164,5 +164,5 @@ const TObj_DataMapOfNameLabel& TObj_TNameContainer::Get() const
void TObj_TNameContainer::Set(const TObj_DataMapOfNameLabel& theMap)
{
Backup();
myMap = theMap;
myMap.Assign (theMap);
}