]> SALOME platform Git repositories - modules/med.git/blob - src/MED/Med_Gen_i.hxx
Salome HOME
976becfaffa8c37336d0178df297f52e5f8b6bc2
[modules/med.git] / src / MED / Med_Gen_i.hxx
1 //=============================================================================
2 // File      : Med_Gen_i.hxx
3 // Created   : mer fév 20 15:47:52 CET 2002
4 // Author    : Paul RASCLE, EDF
5 // Project   : SALOME
6 // Copyright : EDF 2001
7 // $Header$
8 //=============================================================================
9
10 #ifndef _MED_GEN_I_HXX_
11 #define _MED_GEN_I_HXX_
12
13 #include <SALOMEconfig.h>
14 #include <map>
15 #include CORBA_SERVER_HEADER(Med_Gen)
16 #include CORBA_SERVER_HEADER(MED)
17
18 #include "SALOME_Component_i.hxx"
19 #include "SALOME_NamingService.hxx"
20
21 #include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
22
23 class Med_Gen_i:
24   public POA_Engines::Med_Gen,
25   public Engines_Component_i 
26 {
27 private:
28   SALOMEDS::Study_var studyName2Study(const char* studyName)
29     throw(SALOME::SALOME_Exception);
30   void addInStudy(SALOMEDS::Study_var myStudy)
31     throw(SALOME::SALOME_Exception);
32
33 public:
34   Med_Gen_i();
35   Med_Gen_i(CORBA::ORB_ptr orb,
36             PortableServer::POA_ptr poa,
37             PortableServer::ObjectId * contId, 
38             const char *instanceName, 
39             const char *interfaceName);
40   virtual ~Med_Gen_i();
41
42   //
43   SALOME_MED::MESH_ptr readMeshInFile(const char* fileName,
44                                       const char* studyName,
45                                       const char* meshName)
46   throw(SALOME::SALOME_Exception);
47
48   SALOME_MED::FIELD_ptr readFieldInFile(const char* fileName,
49                                       const char* studyName,
50                                       const char* fieldName,
51                                       CORBA::Long ordre,
52                                       CORBA::Long iter)
53   throw(SALOME::SALOME_Exception);
54
55   SALOME_MED::MED_ptr   readStructFile(const char* fileName,
56                                       const char* studyName)
57   throw(SALOME::SALOME_Exception);
58
59   void    readStructFileWithFieldType(const char* fileName,
60                                       const char* studyName)
61   throw(SALOME::SALOME_Exception);
62
63   // inherited methods from SALOMEDS::Driver
64
65 //    void Save(const char *IORSComponent, const char *aUrlOfFile);
66 //    void Load(const char *IORSComponent, const char *aUrlOfFile); 
67   SALOMEDS::TMPFile* Save(SALOMEDS::SComponent_ptr theComponent);
68   CORBA::Boolean Load(SALOMEDS::SComponent_ptr theComponent, const SALOMEDS::TMPFile& theStream);
69   void Close(const char *IORSComponent); 
70   char* ComponentDataType();
71     
72   char* IORToLocalPersistentID(const char* IORString, CORBA::Boolean& IsAFile);
73   char* LocalPersistentIDToIOR(const char* aLocalPersistentID);
74
75   bool CanPublishInStudy(CORBA::Object_ptr theIOR);
76
77   SALOMEDS::SObject_ptr PublishInStudy(SALOMEDS::Study_ptr theStudy,
78                                        SALOMEDS::SObject_ptr theSObject,
79                                        CORBA::Object_ptr theObject,
80                                        const char* theName) throw (SALOME::SALOME_Exception) ;
81   private :
82   static map <string, string>_MedCorbaObj;
83   static string _myFileName;
84   static string _saveFileName;
85
86   private:
87   bool   _duringLoad;
88   int    _myStudyID;
89   string _myStudyName;
90   
91   int myCounter;
92   SALOME_NamingService *_NS;
93
94
95 };
96
97 #endif