Version: 8.3.0
SALOMEDS_Study_i.hxx
Go to the documentation of this file.
1 // Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 
23 // File : SALOMEDS_Study_i.hxx
24 // Author : Sergey RUIN
25 // Module : SALOME
26 //
27 #ifndef __SALOMEDS_STUDY_I_H__
28 #define __SALOMEDS_STUDY_I_H__
29 
30 // std C++ headers
31 #include <iostream>
32 
33 // IDL headers
34 #include <SALOMEconfig.h>
35 #include CORBA_SERVER_HEADER(SALOME_GenericObj)
36 #include CORBA_SERVER_HEADER(SALOMEDS)
37 
38 #include <stdio.h>
39 
40 //SALOMEDS headers
43 #include "SALOMEDS_SObject_i.hxx"
45 
46 #include "SALOMEDSImpl_Study.hxx"
48 
49 class Standard_EXPORT SALOMEDS_Study_i: public POA_SALOMEDS::Study
50 {
51 private:
52  CORBA::ORB_var _orb;
55  static std::map<SALOMEDSImpl_Study*, SALOMEDS_Study_i*> _mapOfStudies;
58  bool _closed;
59 
60 public:
61 
63  SALOMEDS_Study_i(SALOMEDSImpl_Study*, CORBA::ORB_ptr);
64 
66  virtual ~SALOMEDS_Study_i();
67 
69 
73  virtual char* GetPersistentReference();
74 
75 
77 
80  virtual char* GetTransientReference();
81 
83 
86  virtual CORBA::Boolean IsEmpty();
87 
89 
93  virtual SALOMEDS::SComponent_ptr FindComponent (const char* aComponentName);
94 
96 
100  virtual SALOMEDS::SComponent_ptr FindComponentID(const char* aComponentID);
101 
103 
107  virtual SALOMEDS::SObject_ptr FindObject(const char* anObjectName);
108 
109 
111 
117  virtual SALOMEDS::Study::ListOfSObject* FindObjectByName( const char* anObjectName, const char* aComponentName ) ;
118 
120 
124  virtual SALOMEDS::SObject_ptr FindObjectID(const char* anObjectID);
125 
127 
131  virtual SALOMEDS::SObject_ptr CreateObjectID(const char* anObjectID);
132 
134 
138  virtual SALOMEDS::SObject_ptr FindObjectIOR(const char* anObjectIOR);
139 
141 
145  virtual SALOMEDS::SObject_ptr FindObjectByPath(const char* thePath);
146 
148 
152  virtual char* GetObjectPath(CORBA::Object_ptr theObject);
153 
155 
157  virtual void SetContext(const char* thePath);
158 
160 
162  virtual char* GetContext();
163 
165 
167  virtual SALOMEDS::ListOfStrings* GetObjectNames(const char* theContext);
168 
170 
172  virtual SALOMEDS::ListOfStrings* GetDirectoryNames(const char* theContext);
173 
175 
177  virtual SALOMEDS::ListOfStrings* GetFileNames(const char* theContext);
178 
180 
182  virtual SALOMEDS::ListOfStrings* GetComponentNames(const char* theContext);
183 
185 
189  virtual SALOMEDS::ChildIterator_ptr NewChildIterator(SALOMEDS::SObject_ptr aSO);
190 
192 
195  virtual SALOMEDS::SComponentIterator_ptr NewComponentIterator();
196 
198 
201  virtual SALOMEDS::StudyBuilder_ptr NewBuilder();
202 
204 
207  virtual char* Name();
208 
210 
213  virtual void Name(const char* name);
214 
216 
219  virtual CORBA::Boolean IsSaved();
220 
222 
225  virtual void IsSaved(CORBA::Boolean save);
226 
228 
231  virtual CORBA::Boolean IsModified();
232 
234  virtual void Modified();
235 
237 
240  virtual char* URL();
241 
243 
246  virtual void URL(const char* url);
247 
248  virtual CORBA::Short StudyId();
249  virtual void StudyId(CORBA::Short id);
250 
251  static SALOMEDS::Study_ptr GetStudy(const DF_Label& theLabel, CORBA::ORB_ptr orb);
252  static SALOMEDS_Study_i* GetStudyServant(SALOMEDSImpl_Study*, CORBA::ORB_ptr orb);
253 
254  static void IORUpdated(SALOMEDSImpl_AttributeIOR* theAttribute);
255 
256  virtual void UpdateIORLabelMap(const char* anIOR, const char* aLabel);
257 
258  virtual SALOMEDS::Study::ListOfSObject* FindDependances(SALOMEDS::SObject_ptr anObject);
259 
260  virtual SALOMEDS::AttributeStudyProperties_ptr GetProperties();
261 
262  virtual char* GetLastModificationDate();
263 
264  virtual SALOMEDS::ListOfDates* GetModificationsDate();
265 
266  virtual char* ConvertObjectToIOR(CORBA::Object_ptr theObject) {return _orb->object_to_string(theObject); }
267  virtual CORBA::Object_ptr ConvertIORToObject(const char* theIOR) { return _orb->string_to_object(theIOR); };
268 
269  virtual SALOMEDS::UseCaseBuilder_ptr GetUseCaseBuilder();
270 
271  virtual void Close();
272 
273  void EnableUseCaseAutoFilling(CORBA::Boolean isEnabled);
274 
275  // postponed destroying of CORBA object functionality
276  virtual void AddPostponed(const char* theIOR);
277 
278  virtual void AddCreatedPostponed(const char* theIOR);
279 
280  virtual void RemovePostponed(CORBA::Long theUndoLimit); // removes postponed IORs of old transaction
281  // if theUndoLimit==0, removes all
282  virtual void UndoPostponed(CORBA::Long theWay); // theWay = 1: resurrect objects,
283  // theWay = -1: get back to the list of postponed
284 
285  virtual SALOMEDS::AttributeParameter_ptr GetCommonParameters(const char* theID, CORBA::Long theSavePoint);
286  virtual SALOMEDS::AttributeParameter_ptr GetModuleParameters(const char* theID,
287  const char* theModuleName,
288  CORBA::Long theSavePoint);
289 
290  virtual void SetStudyLock(const char* theLockerID);
291 
292  virtual bool IsStudyLocked();
293 
294  virtual void UnLockStudy(const char* theLockerID);
295 
296  virtual SALOMEDS::ListOfStrings* GetLockerID();
297 
298  virtual void SetReal(const char* theVarName, CORBA::Double theValue);
299 
300  virtual void SetInteger(const char* theVarName, CORBA::Long theValue);
301 
302  virtual void SetBoolean(const char* theVarName, CORBA::Boolean theValue);
303 
304  virtual void SetString(const char* theVarName, const char* theValue);
305 
306  virtual void SetStringAsDouble(const char* theVarName, CORBA::Double theValue);
307 
308  virtual CORBA::Double GetReal(const char* theVarName);
309 
310  virtual CORBA::Long GetInteger(const char* theVarName);
311 
312  virtual CORBA::Boolean GetBoolean(const char* theVarName);
313 
314  virtual char* GetString(const char* theVarName);
315 
316  virtual CORBA::Boolean IsReal(const char* theVarName);
317 
318  virtual CORBA::Boolean IsInteger(const char* theVarName);
319 
320  virtual CORBA::Boolean IsBoolean(const char* theVarName);
321 
322  virtual CORBA::Boolean IsString(const char* theVarName);
323 
324  virtual CORBA::Boolean IsVariable(const char* theVarName);
325 
326  virtual SALOMEDS::ListOfStrings* GetVariableNames();
327 
328  virtual CORBA::Boolean RemoveVariable(const char* theVarName);
329 
330  virtual CORBA::Boolean RenameVariable(const char* theVarName, const char* theNewVarName);
331 
332  virtual CORBA::Boolean IsVariableUsed(const char* theVarName);
333 
334  virtual SALOMEDS::ListOfListOfStrings* ParseVariables(const char* theVars);
335 
336  virtual char* GetDefaultScript(const char* theModuleName, const char* theShift);
337 
338  virtual CORBA::Boolean DumpStudy(const char* thePath,
339  const char* theBaseName,
340  CORBA::Boolean isPublished,
341  CORBA::Boolean isMultiFile);
342 
343  virtual SALOMEDSImpl_Study* GetImpl() { return _impl; }
344 
345  virtual CORBA::LongLong GetLocalImpl(const char* theHostname, CORBA::Long thePID, CORBA::Boolean& isLocal);
346 
347  virtual void attach(SALOMEDS::Observer_ptr theObs, CORBA::Boolean modify);
348  virtual void detach(SALOMEDS::Observer_ptr theObs);
349 };
350 #endif