Back to index

salome-kernel  6.5.0
SALOMEDS_Study_i.hxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License.
00010 //
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 
00023 //  File   : SALOMEDS_Study_i.hxx
00024 //  Author : Sergey RUIN
00025 //  Module : SALOME
00026 //
00027 #ifndef __SALOMEDS_STUDY_I_H__
00028 #define __SALOMEDS_STUDY_I_H__
00029 
00030 // std C++ headers
00031 #include <iostream>
00032 
00033 // IDL headers
00034 #include <SALOMEconfig.h>
00035 #include CORBA_SERVER_HEADER(SALOME_GenericObj)
00036 #include CORBA_SERVER_HEADER(SALOMEDS)
00037 
00038 #include <stdio.h>
00039 
00040 //SALOMEDS headers
00041 #include "SALOMEDS_SComponentIterator_i.hxx"
00042 #include "SALOMEDS_StudyBuilder_i.hxx"
00043 #include "SALOMEDS_SObject_i.hxx"
00044 #include "SALOMEDS_UseCaseBuilder_i.hxx"
00045 
00046 #include "SALOMEDSImpl_Study.hxx"
00047 #include "SALOMEDSImpl_AttributeIOR.hxx"
00048 
00049 class Notifier;
00050 
00051 class Standard_EXPORT SALOMEDS_Study_i: public POA_SALOMEDS::Study
00052 {
00053 private:
00054   CORBA::ORB_var                 _orb;
00055   SALOMEDSImpl_Study*            _impl;  
00056   SALOMEDS_StudyBuilder_i*       _builder;    
00057   static std::map<SALOMEDSImpl_Study*, SALOMEDS_Study_i*> _mapOfStudies;
00058   Notifier*                      _notifier;
00059 
00060 public:
00061 
00063   SALOMEDS_Study_i(SALOMEDSImpl_Study*, CORBA::ORB_ptr);
00064   
00066   virtual ~SALOMEDS_Study_i(); 
00067   
00069 
00073   virtual char* GetPersistentReference();
00074 
00075 
00077 
00080   virtual char* GetTransientReference();
00081 
00083 
00086   virtual CORBA::Boolean IsEmpty();
00087 
00089 
00093   virtual SALOMEDS::SComponent_ptr FindComponent (const char* aComponentName);
00094 
00096 
00100   virtual SALOMEDS::SComponent_ptr FindComponentID(const char* aComponentID);
00101 
00103 
00107   virtual SALOMEDS::SObject_ptr FindObject(const char* anObjectName);
00108 
00109 
00111 
00117   virtual SALOMEDS::Study::ListOfSObject* FindObjectByName( const char* anObjectName, const char* aComponentName ) ;
00118   
00120 
00124   virtual SALOMEDS::SObject_ptr FindObjectID(const char* anObjectID);
00125 
00127 
00131   virtual SALOMEDS::SObject_ptr CreateObjectID(const char* anObjectID);
00132 
00134 
00138   virtual SALOMEDS::SObject_ptr FindObjectIOR(const char* anObjectIOR);
00139 
00141 
00145   virtual SALOMEDS::SObject_ptr FindObjectByPath(const char* thePath);
00146 
00148 
00152   virtual char* GetObjectPath(CORBA::Object_ptr theObject);
00153 
00155 
00157   virtual void SetContext(const char* thePath);
00158 
00160 
00162   virtual char* GetContext();  
00163 
00165 
00167   virtual SALOMEDS::ListOfStrings* GetObjectNames(const char* theContext);
00168 
00170 
00172   virtual SALOMEDS::ListOfStrings* GetDirectoryNames(const char* theContext);
00173 
00175 
00177   virtual SALOMEDS::ListOfStrings* GetFileNames(const char* theContext);
00178 
00180 
00182   virtual SALOMEDS::ListOfStrings* GetComponentNames(const char* theContext);
00183 
00185 
00189   virtual SALOMEDS::ChildIterator_ptr NewChildIterator(SALOMEDS::SObject_ptr aSO);
00190 
00192 
00195   virtual SALOMEDS::SComponentIterator_ptr NewComponentIterator();
00196 
00198 
00201   virtual SALOMEDS::StudyBuilder_ptr NewBuilder();
00202  
00204 
00207   virtual char* Name();
00208 
00210 
00213   virtual void  Name(const char* name);
00214 
00216 
00219   virtual CORBA::Boolean IsSaved();
00220 
00222 
00225   virtual void  IsSaved(CORBA::Boolean save);
00226 
00228 
00231   virtual CORBA::Boolean IsModified();
00232 
00234   virtual void Modified();
00235 
00237 
00240   virtual char* URL();
00241 
00243 
00246   virtual void  URL(const char* url);
00247 
00248   virtual CORBA::Short StudyId();
00249   virtual void  StudyId(CORBA::Short id);
00250 
00251   static SALOMEDS::Study_ptr GetStudy(const DF_Label& theLabel, CORBA::ORB_ptr orb);
00252   static SALOMEDS_Study_i* GetStudyServant(SALOMEDSImpl_Study*, CORBA::ORB_ptr orb);
00253 
00254   static void IORUpdated(SALOMEDSImpl_AttributeIOR* theAttribute);
00255 
00256   virtual void UpdateIORLabelMap(const char* anIOR, const char* aLabel);
00257   
00258   virtual SALOMEDS::Study::ListOfSObject* FindDependances(SALOMEDS::SObject_ptr anObject);
00259 
00260   virtual SALOMEDS::AttributeStudyProperties_ptr GetProperties();
00261 
00262   virtual char* GetLastModificationDate();
00263 
00264   virtual SALOMEDS::ListOfDates* GetModificationsDate();
00265 
00266   virtual char* ConvertObjectToIOR(CORBA::Object_ptr theObject) {return _orb->object_to_string(theObject); }
00267   virtual CORBA::Object_ptr ConvertIORToObject(const char* theIOR) { return _orb->string_to_object(theIOR); };
00268 
00269   virtual SALOMEDS::UseCaseBuilder_ptr GetUseCaseBuilder();
00270 
00271   virtual void Close();
00272 
00273   void EnableUseCaseAutoFilling(CORBA::Boolean isEnabled); 
00274 
00275   // postponed destroying of CORBA object functionality
00276   virtual void AddPostponed(const char* theIOR);
00277 
00278   virtual void AddCreatedPostponed(const char* theIOR);
00279 
00280 #ifndef WIN32
00281   virtual void RemovePostponed(const CORBA::Long theUndoLimit); // removes postponed IORs of old transaction
00282                                                         // if theUndoLimit==0, removes all
00283   virtual void UndoPostponed(const CORBA::Long theWay); // theWay = 1: resurrect objects,
00284                                                 // theWay = -1: get back to the list of postponed
00285 #else
00286   virtual void RemovePostponed(CORBA::Long theUndoLimit); // removes postponed IORs of old transaction
00287                                                         // if theUndoLimit==0, removes all
00288   virtual void UndoPostponed(CORBA::Long theWay); // theWay = 1: resurrect objects,
00289                                                 // theWay = -1: get back to the list of postponed
00290 #endif
00291 
00292   virtual SALOMEDS::AttributeParameter_ptr GetCommonParameters(const char* theID, CORBA::Long theSavePoint);
00293   virtual SALOMEDS::AttributeParameter_ptr GetModuleParameters(const char* theID, 
00294                                                                const char* theModuleName, 
00295                                                                CORBA::Long theSavePoint);
00296 
00297   virtual void SetStudyLock(const char* theLockerID);
00298 
00299   virtual bool IsStudyLocked();
00300 
00301   virtual void UnLockStudy(const char* theLockerID);
00302 
00303   virtual SALOMEDS::ListOfStrings* GetLockerID();
00304 
00305   virtual void SetReal(const char* theVarName, CORBA::Double theValue);
00306   
00307   virtual void SetInteger(const char* theVarName, CORBA::Long theValue);
00308 
00309   virtual void SetBoolean(const char* theVarName, CORBA::Boolean theValue);
00310 
00311   virtual void SetString(const char* theVarName, const char* theValue);
00312 
00313   virtual void SetStringAsDouble(const char* theVarName, CORBA::Double theValue);
00314 
00315   virtual CORBA::Double GetReal(const char* theVarName);
00316   
00317   virtual CORBA::Long GetInteger(const char* theVarName);
00318 
00319   virtual CORBA::Boolean GetBoolean(const char* theVarName);
00320 
00321   virtual char* GetString(const char* theVarName);
00322 
00323   virtual CORBA::Boolean IsReal(const char* theVarName);
00324   
00325   virtual CORBA::Boolean IsInteger(const char* theVarName);
00326 
00327   virtual CORBA::Boolean IsBoolean(const char* theVarName);
00328 
00329   virtual CORBA::Boolean IsString(const char* theVarName);
00330 
00331   virtual CORBA::Boolean IsVariable(const char* theVarName);
00332 
00333   virtual SALOMEDS::ListOfStrings* GetVariableNames();
00334 
00335   virtual CORBA::Boolean RemoveVariable(const char* theVarName);
00336 
00337   virtual CORBA::Boolean RenameVariable(const char* theVarName, const char* theNewVarName);
00338 
00339   virtual CORBA::Boolean IsVariableUsed(const char* theVarName);
00340   
00341   virtual SALOMEDS::ListOfListOfStrings* ParseVariables(const char* theVars);
00342 
00343   virtual char* GetDefaultScript(const char* theModuleName, const char* theShift);
00344 
00345   virtual CORBA::Boolean DumpStudy(const char* thePath,
00346                                    const char* theBaseName,
00347                                    CORBA::Boolean isPublished,
00348                                    CORBA::Boolean isMultiFile);
00349 
00350   virtual SALOMEDSImpl_Study* GetImpl() { return _impl; }
00351 
00352   virtual CORBA::LongLong GetLocalImpl(const char* theHostname, CORBA::Long thePID, CORBA::Boolean& isLocal);
00353 
00354   virtual void attach(SALOMEDS::Observer_ptr theObs, CORBA::Boolean modify);
00355 
00356 };
00357 #endif