0024788: Foundation Classes - remove Dico_Dictionary

Class Dico_Dictionary was replaced by NCollection_DataMap/NCollection_IndexedDataMap classes.
Changed argument name in template class NCollection_Datamap to eliminate redefinitions of static members in dependent code.
This commit is contained in:
ski
2016-10-12 18:02:55 +03:00
committed by apn
parent be70005cb5
commit 997e128f88
85 changed files with 1674 additions and 4530 deletions

View File

@@ -16,8 +16,6 @@
//svv#2 21.02.00 : porting on SIL
//smh#14 17.03.2000 : FRA62479 Clearing of gtool.
#include <Dico_DictionaryOfTransient.hxx>
#include <Dico_IteratorOfDictionaryOfTransient.hxx>
#include <Interface_Check.hxx>
#include <Interface_CheckIterator.hxx>
#include <Interface_EntityIterator.hxx>
@@ -39,7 +37,7 @@
#include <TColStd_Array1OfTransient.hxx>
#include <TColStd_DataMapIteratorOfDataMapOfIntegerTransient.hxx>
IMPLEMENT_STANDARD_RTTIEXT(Interface_InterfaceModel,MMgt_TShared)
IMPLEMENT_STANDARD_RTTIEXT(Interface_InterfaceModel, MMgt_TShared)
// Un Modele d`Interface est un ensemble ferme d`Entites d`interface : chacune
// est dans un seul modele a la fois; elle y a un numero (Number) qui permet de
@@ -47,13 +45,7 @@ IMPLEMENT_STANDARD_RTTIEXT(Interface_InterfaceModel,MMgt_TShared)
// performantes, de fournir un identifieur numerique
// Il est a meme d`etre utilise dans des traitements de Graphe
// STATICS : les TEMPLATES
static const Handle(Dico_DictionaryOfTransient)& templates()
{
static Handle(Dico_DictionaryOfTransient) atemp;
if (atemp.IsNull()) atemp = new Dico_DictionaryOfTransient;
return atemp;
}
static NCollection_DataMap<TCollection_AsciiString, Handle(Standard_Transient)> atemp;
static const Handle(Standard_Type)& typerep()
{
@@ -1004,7 +996,7 @@ Standard_Integer Interface_InterfaceModel::NextNumberForLabel
Standard_Boolean Interface_InterfaceModel::HasTemplate
(const Standard_CString name)
{
return templates()->HasItem(name);
return atemp.IsBound(name);
}
@@ -1018,7 +1010,7 @@ Handle(Interface_InterfaceModel) Interface_InterfaceModel::Template
{
Handle(Interface_InterfaceModel) model,newmod;
if (!HasTemplate(name)) return model;
model = Handle(Interface_InterfaceModel)::DownCast(templates()->Item(name));
model = Handle(Interface_InterfaceModel)::DownCast(atemp.ChangeFind(name));
newmod = model->NewEmptyModel();
newmod->GetFromAnother (model);
return newmod;
@@ -1033,10 +1025,7 @@ Handle(Interface_InterfaceModel) Interface_InterfaceModel::Template
Standard_Boolean Interface_InterfaceModel::SetTemplate
(const Standard_CString name, const Handle(Interface_InterfaceModel)& model)
{
Standard_Boolean deja;
Handle(Standard_Transient)& newmod = templates()->NewItem(name,deja);
newmod = model;
return deja;
return atemp.Bind(name, model);
}
@@ -1049,10 +1038,10 @@ Handle(TColStd_HSequenceOfHAsciiString) Interface_InterfaceModel::ListTemplates
{
Handle(TColStd_HSequenceOfHAsciiString) list = new
TColStd_HSequenceOfHAsciiString();
if (templates().IsNull()) return list;
for (Dico_IteratorOfDictionaryOfTransient iter(templates());
iter.More(); iter.Next()) {
list->Append (new TCollection_HAsciiString (iter.Name()) );
if (atemp.IsEmpty()) return list;
NCollection_DataMap<TCollection_AsciiString, Handle(Standard_Transient)>::Iterator iter(atemp);
for (; iter.More(); iter.Next()) {
list->Append (new TCollection_HAsciiString (iter.Key()) );
}
return list;
}