Salome HOME
Revert "Synchronize adm files"
[modules/med.git] / idl / MEDDataManager.idl
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 // Authors : Guillaume Boulant (EDF) - 01/06/2011
24
25 #ifndef _MED_DATAMANAGER_IDL_
26 #define _MED_DATAMANAGER_IDL_
27
28 #include "SALOME_GenericObj.idl"
29 #include "SALOME_Exception.idl"
30
31 module MEDOP
32 {
33   struct DatasourceHandler {
34     long id;
35     string name;
36     string uri;
37     // The source could be a filepath or the ior of a field servant
38   };
39
40   struct MeshHandler {
41     long id;
42     string name;
43     long sourceid;
44   };
45   typedef sequence<MeshHandler> MeshHandlerList;
46
47   /**
48    * The Fieldseries is a virtal object that does not exist in the MED
49    * data model (at least in the MEDCoupling data model). It is just a
50    * point that aggregate a list of fields that relie on the same mesh
51    * with the same type (the fields in a timeseries differ by their
52    * time step).
53    * 
54    * Then you could have a field with no fieldseries associated but
55    * directly associated to a mesh. That is typically the case of
56    * fields created by MED operations: if you operate tow fields
57    * coming from 2 different timeseries (and relying on the same
58    * mesh), you obtain a field that can not be associate to the
59    * original timeseries. Then this new created field must be directly
60    * associated to its underlying mesh (as defined in the MEDCoupling
61    * data model).
62    *
63    * In conclusion, the fieldseries is a facilities for data
64    * management but must not be a structuration of the data model. The
65    * association is not:
66    *
67    *   field->fieldseries->mesh
68    *
69    * but:
70    *
71    *   field->fieldseries (optional)
72    *        ->mesh        (mandatory)
73    *
74    * and:
75    *
76    *   fieldseries->mesh  (mandatory)
77    */
78   struct FieldseriesHandler {
79     long id;
80     string name;
81     long   type;
82     long   meshid;
83     long   nbIter;
84   };
85   typedef sequence<FieldseriesHandler> FieldseriesHandlerList;
86
87   // The FieldHandler structure is a lightweigth data structure that
88   // represents a single field (as understood in MEDCoupling model).
89   struct FieldHandler {
90     long   id;
91     long   fieldseriesId;
92     string fieldname; // @warn : if fieldseriesId then get from fieldseries->name
93     string meshname;  // @deprecated: replace by meshid and get from mesh->name
94     long   meshid;
95     long   type;      // @warn : if fieldseriesId then get from fieldseries->type
96     long   iteration;
97     long   order;
98     string source;    // @deprecated : get from mesh->datasource->uri
99   };
100
101   typedef sequence<FieldHandler> FieldHandlerList;
102   typedef sequence<long> FieldIdList;
103
104   interface MEDDataManager: SALOME::GenericObj
105   {
106     
107     //==========================================================
108     // Datasource management
109     //==========================================================
110     DatasourceHandler addDatasource(in string filepath);
111
112     //==========================================================
113     // Mesh data management
114     //==========================================================
115     
116     MeshHandler     getMesh(in long meshId) raises (SALOME::SALOME_Exception);
117     MeshHandlerList getMeshList(in long datasourceId);
118
119     //==========================================================
120     // Field data management
121     //==========================================================
122     FieldseriesHandlerList getFieldseriesListOnMesh(in long meshId);
123     FieldHandlerList getFieldListInFieldseries(in long fieldseriesId);
124
125     FieldHandler     getFieldHandler(in long fieldHandlerId);
126     FieldHandlerList getFieldHandlerList();
127     // __GBO__ Maybe it could be usefull to define a getFieldHandlerList with a datasourceId in argument
128     string           getFieldRepresentation(in long fieldHandlerId);
129
130     // Persistency management
131     void             saveFields(in string filepath, in FieldIdList list)
132       raises (SALOME::SALOME_Exception);
133     void             markAsPersistent(in long fieldHandlerId, in boolean persistent);
134     void             savePersistentFields(in string filepath)
135       raises (SALOME::SALOME_Exception);
136
137
138     void updateFieldMetadata(in long   fieldHandlerId,
139                              in string fieldname,
140                              in long   iteration,
141                              in long   order,
142                              in string source);
143
144     //void saveFields(in FieldHandlerList fieldHandlerList, in string filepath);
145
146     void changeUnderlyingMesh(in long fieldHandlerId, in long meshHandlerId)
147       raises (SALOME::SALOME_Exception);
148     
149     //==========================================================
150     // General purpose data management
151     //==========================================================
152     void   setEventListenerIOR(in string ior);
153     string getEventListenerIOR() raises (SALOME::SALOME_Exception);
154
155     // Print out server data
156     void serverlog();
157   };
158 };
159
160 #endif // _MED_DATAMANAGER_IDL_