1 // File : SALOMEDS_Study_i.hxx
2 // Author : Sergey RUIN
5 #ifndef __SALOMEDS_STUDY_I_H__
6 #define __SALOMEDS_STUDY_I_H__
12 #include <SALOMEconfig.h>
13 #include CORBA_SERVER_HEADER(SALOME_GenericObj)
14 #include CORBA_SERVER_HEADER(SALOMEDS)
19 #include "SALOMEDS_SComponentIterator_i.hxx"
20 #include "SALOMEDS_StudyBuilder_i.hxx"
21 #include "SALOMEDS_SObject_i.hxx"
22 #include "SALOMEDS_UseCaseBuilder_i.hxx"
24 #include "SALOMEDSImpl_Study.hxx"
25 #include "SALOMEDSImpl_AttributeIOR.hxx"
27 class Standard_EXPORT SALOMEDS_Study_i: public POA_SALOMEDS::Study,
28 public PortableServer::RefCountServantBase
32 Handle(SALOMEDSImpl_Study) _impl;
33 SALOMEDS_StudyBuilder_i* _builder;
37 //! standard constructor
38 SALOMEDS_Study_i(const Handle(SALOMEDSImpl_Study), CORBA::ORB_ptr);
40 //! standard destructor
41 virtual ~SALOMEDS_Study_i();
43 //! method to Get persistent reference of study (idem URL())
46 \return char* arguments, the persistent reference of the study
48 virtual char* GetPersistentReference();
51 //! method to Get transient reference of study
53 \return char* arguments, the transient reference of the study
55 virtual char* GetTransientReference();
57 //! method to detect if a study is empty
59 \return bool arguments, true if study is empty
61 virtual CORBA::Boolean IsEmpty();
63 //! method to Find a Component with ComponentDataType = aComponentName
65 \param aComponentName char* arguments
66 \return SComponent_ptr arguments, the component found
68 virtual SALOMEDS::SComponent_ptr FindComponent (const char* aComponentName);
70 //! method to Find a Component Find a Component from it's ID
72 \param aComponentID char* arguments
73 \return SComponent_ptr arguments, the component found
75 virtual SALOMEDS::SComponent_ptr FindComponentID(const char* aComponentID);
77 //! method to Find an Object with SALOMEDS::Name = anObjectName
79 \param anObjectName char* arguments
80 \return SObject_ptr arguments, the object found
82 virtual SALOMEDS::SObject_ptr FindObject(const char* anObjectName);
85 //! method to Find Object(s) with SALOMEDS::Name = anObjectName in a component with ComponentDataType = aComponentName
87 \param anObjectName char* arguments
88 \param aComponentName char* arguments
89 \return ListOfSObject_ptr arguments, a list of objects found
92 virtual SALOMEDS::Study::ListOfSObject* FindObjectByName( const char* anObjectName, const char* aComponentName ) ;
94 //! method to Find an Object with ID = anObjectID
96 \param anObjectID char* arguments
97 \return SObject_ptr arguments, the object found
99 virtual SALOMEDS::SObject_ptr FindObjectID(const char* anObjectID);
101 //! method to Create an Object with ID = anObjectID
103 \param anObjectID char* arguments
104 \return SObject_ptr arguments, the object found
106 virtual SALOMEDS::SObject_ptr CreateObjectID(const char* anObjectID);
108 //! method to Find an Object with ID = anObjectIOR
110 \param anObjectIOR char* arguments
111 \return SObject_ptr arguments, the object found
113 virtual SALOMEDS::SObject_ptr FindObjectIOR(const char* anObjectIOR);
115 //! method to Find an Object by its path
117 \param thePath char* arguments
118 \return SObject_ptr arguments, the object found
120 virtual SALOMEDS::SObject_ptr FindObjectByPath(const char* thePath);
122 //! method to get a path of SObject
124 \param aSO SObject_ptr arguments
125 \return char* arguments, the path of the SObject
127 virtual char* GetObjectPath(CORBA::Object_ptr theObject);
129 //! method to set a context: root ('/') is UserData component
132 virtual void SetContext(const char* thePath);
134 //! method to get a context
137 virtual char* GetContext();
139 //! method to get all object names in the given context (or in the current context, if 'theContext' is empty)
142 virtual SALOMEDS::ListOfStrings* GetObjectNames(const char* theContext);
144 //! method to get all directory names in the given context (or in the current context, if 'theContext' is empty)
147 virtual SALOMEDS::ListOfStrings* GetDirectoryNames(const char* theContext);
149 //! method to get all file names in the given context (or in the current context, if 'theContext' is empty)
152 virtual SALOMEDS::ListOfStrings* GetFileNames(const char* theContext);
154 //! method to get all components names
157 virtual SALOMEDS::ListOfStrings* GetComponentNames(const char* theContext);
159 //! method to Create a ChildIterator from an SObject
161 \param aSO SObject_ptr arguments
162 \return ChildIterator_ptr arguments, the created ChildIterator
164 virtual SALOMEDS::ChildIterator_ptr NewChildIterator(SALOMEDS::SObject_ptr aSO);
166 //! method to Create a SComponentIterator
168 \return SComponentIterator_ptr arguments, the created SComponentIterator
170 virtual SALOMEDS::SComponentIterator_ptr NewComponentIterator();
172 //! method to Create a StudyBuilder
174 \return StudyBuilder_ptr arguments, the created StudyBuilder
176 virtual SALOMEDS::StudyBuilder_ptr NewBuilder();
178 //! method to get study name
180 \return char* arguments, the study name
182 virtual char* Name();
184 //! method to set study name
186 \param name char* arguments, the study name
188 virtual void Name(const char* name);
190 //! method to get if study has been saved
192 \return bool arguments
194 virtual CORBA::Boolean IsSaved();
196 //! method to set if study has been saved
198 \param save bool arguments
200 virtual void IsSaved(CORBA::Boolean save);
202 //! method to Detect if a Study has been modified since it has been saved
204 \return bool arguments
206 virtual CORBA::Boolean IsModified();
208 //! method to get URL of the study (idem GetPersistentReference)
210 \return char* arguments, the study URL
214 //! method to set URL of the study
216 \param url char* arguments, the study URL
218 virtual void URL(const char* url);
220 virtual CORBA::Short StudyId();
221 virtual void StudyId(CORBA::Short id);
223 static SALOMEDS::Study_ptr GetStudy(const TDF_Label theLabel, CORBA::ORB_ptr orb);
225 static void IORUpdated(const Handle(SALOMEDSImpl_AttributeIOR) theAttribute);
227 virtual void UpdateIORLabelMap(const char* anIOR, const char* aLabel);
229 virtual SALOMEDS::Study::ListOfSObject* FindDependances(SALOMEDS::SObject_ptr anObject);
231 virtual SALOMEDS::AttributeStudyProperties_ptr SALOMEDS_Study_i::GetProperties();
233 virtual char* GetLastModificationDate();
235 virtual SALOMEDS::ListOfDates* GetModificationsDate();
237 virtual char* ConvertObjectToIOR(CORBA::Object_ptr theObject) {return _orb->object_to_string(theObject); }
238 virtual CORBA::Object_ptr ConvertIORToObject(const char* theIOR) { return _orb->string_to_object(theIOR); };
240 virtual SALOMEDS::UseCaseBuilder_ptr GetUseCaseBuilder();
242 virtual void Close();
244 void EnableUseCaseAutoFilling(CORBA::Boolean isEnabled) { _impl->EnableUseCaseAutoFilling(isEnabled); }
246 // postponed destroying of CORBA object functionality
247 virtual void AddPostponed(const char* theIOR);
249 virtual void AddCreatedPostponed(const char* theIOR);
252 virtual void RemovePostponed(const CORBA::Long theUndoLimit); // removes postponed IORs of old transaction
253 // if theUndoLimit==0, removes all
254 virtual void UndoPostponed(const CORBA::Long theWay); // theWay = 1: resurrect objects,
255 // theWay = -1: get back to the list of postponed
257 virtual void RemovePostponed(CORBA::Long theUndoLimit); // removes postponed IORs of old transaction
258 // if theUndoLimit==0, removes all
259 virtual void UndoPostponed(CORBA::Long theWay); // theWay = 1: resurrect objects,
260 // theWay = -1: get back to the list of postponed
263 virtual CORBA::Boolean DumpStudy(const char* thePath, const char* theBaseName, CORBA::Boolean isPublished);
265 virtual Handle(SALOMEDSImpl_Study) GetImpl() { return _impl; }
267 virtual long GetLocalImpl(const char* theHostname, CORBA::Long thePID, CORBA::Boolean& isLocal);