static Handle_Model_Application TheApplication = new Model_Application;
-//=======================================================================
-//function : getApplication
-//purpose :
//=======================================================================
Handle(Model_Application) Model_Application::getApplication()
{
}
//=======================================================================
-//function : getDocument
-//purpose :
-//=======================================================================
-std::shared_ptr<Model_Document> Model_Application::getDocument(string theDocID)
+const std::shared_ptr<Model_Document>& Model_Application::getDocument(string theDocID)
{
if (myDocs.find(theDocID) != myDocs.end())
return myDocs[theDocID];
std::shared_ptr<Model_Document> aNew(new Model_Document(theDocID));
myDocs[theDocID] = aNew;
- return aNew;
+ return myDocs[theDocID];
}
void Model_Application::deleteDocument(string theDocID)
}
//=======================================================================
-//function : OCAFApp_Application
-//purpose :
+bool Model_Application::hasDocument(std::string theDocID)
+{
+ return myDocs.find(theDocID) != myDocs.end();
+}
+
//=======================================================================
Model_Application::Model_Application()
{
TheKeepHandle = this;
}
-//=======================================================================
-//function : Formats
-//purpose :
//=======================================================================
void Model_Application::Formats(TColStd_SequenceOfExtendedString& theFormats)
{
theFormats.Append(TCollection_ExtendedString("BinOcaf")); // standard binary schema
}
-//=======================================================================
-//function : ResourcesName
-//purpose :
//=======================================================================
Standard_CString Model_Application::ResourcesName()
{