Salome HOME
ed02017714326019ea83495cb4491cdb6d78a777
[modules/kernel.git] / src / SALOMEDS / SALOMEDS_SimanStudy_i.hxx
1 // Copyright (C) 2007-2014  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_SimanStudy_i.hxx
24 //  Author : Mikhail PONIKAROV
25 //  Module : SALOME
26 //
27 #ifndef __SALOMEDS_SIMANSTUDY_I_H__
28 #define __SALOMEDS_SIMANSTUDY_I_H__
29
30 // IDL headers
31 #include <SALOMEconfig.h>
32 #include CORBA_SERVER_HEADER(SALOMEDS)
33
34 //SALOMEDS headers
35 #include "SALOMEDS_Study_i.hxx"
36
37 class SimanIO_Configuration;
38 class SALOME_NamingService;
39
40 class Standard_EXPORT SALOMEDS_SimanStudy_i: public POA_SALOMEDS::SimanStudy
41 {
42 private:
43   CORBA::ORB_var                 _orb;
44   SALOME_NamingService*          _name_service;
45   //SALOMEDSImpl_SimanStudy*       _impl;  
46   SALOMEDSImpl_Study*          _study;
47
48   std::string              _studyId; // SIMAN ID
49   std::string              _scenarioId; // SIMAN ID
50   std::string              _userId; // SIMAN ID
51       
52   SimanIO_Configuration* _checkedOut; // pointer to information about checked out data                                                                        std::map<int, std::map<std::string, int> > _filesId; // map from document id to component identifiers to SIMAN file ID
53   std::map<int, std::map<std::string, int> > _filesId; // map from document id to component identifiers to SIMAN file ID
54          
55 public:
56
57   //! constructor create global Siman stduy (is called in StudyManager only)
58   SALOMEDS_SimanStudy_i(/*SALOMEDSImpl_SimanStudy*,*/ CORBA::ORB_ptr);
59   
60   //! standard destructor
61   virtual ~SALOMEDS_SimanStudy_i(); 
62   
63    /*! \brief Get data from SIMAN and put it to the given study
64
65      This method is called for just created study to make it referenced
66      by this Siman study. Also it fills this study by the checked out
67      data from SIMAN server.
68      Warning: StudyID, ScenarioID and User Id must be set before calling of this method!
69     
70      \param theTarget referenced study for checking out
71   */
72   virtual void CheckOut(SALOMEDS::Study_ptr theTarget);
73
74   /*! \brief Get data from all modules and calls the corresponding SimanIO methods to store it.
75     
76     It works only with already checked out study
77    */
78   virtual void CheckIn(const char* themoduleName);
79   
80   /*! \brief Returns the %Study with checked out data
81
82     If study is null, there is no such study in this application instance, or Salome was
83     launched without siman option.
84   */
85   virtual SALOMEDS::Study_ptr getReferencedStudy();
86   
87   /*! \brief The ID of the study in SIMAN server
88   
89     Returns the Id of SIMAN study, used for CheckOut before.
90   */
91   virtual char* StudyId();
92
93   /*! \brief The ID of the study in SIMAN server
94   
95     Defines the Id of SIMAN study, used for CheckOut after.
96   */
97   virtual void StudyId(const char* theId);
98
99   /*! \brief The ID of the scenario in SIMAN server
100   
101     Returns the Id of SIMAN scenario, used for CheckOut before.
102   */
103   virtual char* ScenarioId();
104
105   /*! \brief The ID of the scenario in SIMAN server
106   
107     Defines the Id of SIMAN scenario, used for CheckOut after.
108   */
109   virtual void ScenarioId(const char* theId);
110
111   /*! \brief The ID of the user in SIMAN server
112   
113     Returns the Id of SIMAN user, used for CheckOut before.
114   */
115   virtual char* UserId();
116
117   /*! \brief The ID of the user in SIMAN server
118   
119     Defines the Id of SIMAN user, used for CheckOut after.
120   */
121   virtual void UserId(const char* theId);
122   
123   //virtual CORBA::LongLong GetLocalImpl(const char* theHostname, CORBA::Long thePID, CORBA::Boolean& isLocal);
124
125   static SALOMEDS_SimanStudy_i* GetSimanServant(CORBA::ORB_ptr orb);
126 };
127 #endif