Salome HOME
To see which hdf5 we're using in configure log
[modules/kernel.git] / idl / SALOME_ModuleCatalog.idl
1 //  Copyright (C) 2007-2008  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.
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 //  File   : SALOME_ModuleCatalog.idl
23 //  Author : Estelle Deville
24 //  $Header$
25 //
26 /*! \file SALOME_ModuleCatalog.idl \brief interfaces used for  
27   getting information from module catalog in %SALOME application
28 */
29
30 /*!  \brief
31 The main package of interfaces used for the module catalog in %SALOME application.
32
33 Module catalog allows to manage components of %SALOME application, to call specified in the
34 xml files interfaces with the help of AComponent interface.
35 */
36 module SALOME_ModuleCatalog
37 {
38 /*! \brief This enumeration contains a current set of definitions of the components integrated
39 into %SALOME application.
40 */
41   enum ComponentType {  GEOM,  /*!<Module %GEOM */
42                         MESH,  /*!<Module %MESH */
43                          Med,  /*!<Module %Med*/
44                       SOLVER,  /*!<Module of %SOLVER type */
45                         DATA,  /*!<Module %DATA */
46                         VISU,  /*!<Module %VISU */
47                       SUPERV,  /*!<Module %SUPERVISION */
48                        OTHER   /*!<Any other type of module */
49                      } ;
50 //! This struct contains fields defining the parameter of the service.
51   struct ServicesParameter
52   {
53     string Parametertype; /*!<Parameter type name.*/
54     string Parametername; /*!<Parameter name.*/
55   } ;
56
57 //! enumeration to define datastream ports dependency
58   enum DataStreamDependency {
59     DATASTREAM_UNDEFINED, /*!< dependency not defined */
60     DATASTREAM_TEMPORAL, /*!< time dependency */
61     DATASTREAM_ITERATIVE /*!< iterative dependency */
62   } ;
63
64 //! struct to define datastream ports 
65   struct ServicesDataStreamParameter
66   {
67     string Parametertype;                     /*!<Parameter type name.*/
68     string Parametername;                     /*!<Parameter name.*/
69     DataStreamDependency Parameterdependency; /*!<Temporal or iterative dependency.*/
70   } ;
71
72 //!  The list of the parameters of service.
73   typedef sequence<ServicesParameter> ListOfServicesParameter;
74 //!  The list of datastream parameters of service.
75   typedef sequence<ServicesDataStreamParameter> ListOfServicesDataStreamParameter;
76
77 //!  a string list
78   typedef sequence<string> ListOfString;
79
80 //! enumeration to define data types used by services
81   enum TypeKind 
82   {
83     NONE     ,
84     Dble   , /*!< a double */
85     Int      , /*!< an integer  */
86     Str   , /*!< a string */
87     Bool     , /*!< a boolean */
88     Objref   , /*!< an object reference */
89     Seq , /*!< a sequence of a content type */
90     Array    , /*!< an array */
91     Struc  /*!< a structure with named members */
92   };
93
94 //! struct to define members of a Struc TypeKind
95   struct MemberDefinition
96   {
97     string name; /*!< Member name */
98     string type; /*!< Member type name */
99   };
100 //! List of member definitions in a structure
101   typedef sequence<MemberDefinition> ListOfMemberDefinition;
102
103 //! Struct to get the definition of types used in Salome catalogs
104   struct TypeDefinition
105   {
106     string name; /*!< Type name*/
107     TypeKind kind; /*!< Type kind.*/
108     string id; /*!< id (if needed) */
109     string content; /*!< Content type (if needed) */
110     ListOfString bases; /*!< base types (if needed) */
111     ListOfMemberDefinition members; /*!< Member types (if needed) */
112   };
113
114 //! list of type definitions
115   typedef sequence<TypeDefinition> ListOfTypeDefinition;
116
117 //! This struct contains fields defining each service.
118   struct Service
119   {
120     string                            ServiceName; /*!<Name of the service.*/
121     ListOfServicesParameter           ServiceinParameter; /*!< List of input parameters of the services.*/
122     ListOfServicesParameter           ServiceoutParameter; /*!< List of output parameters of the services.*/
123     ListOfServicesDataStreamParameter ServiceinDataStreamParameter; /*!< List of input parameters of the services.*/
124     ListOfServicesDataStreamParameter ServiceoutDataStreamParameter; /*!< List of output parameters of the services.*/
125     boolean                           Servicebydefault; /*!<True if the service is taken with its default fields.*/
126     boolean                           TypeOfNode; /*!<True is the service is a factory node. Otherwise, it's a compute node.*/
127   } ;
128 //!  List of services of the interface.
129   typedef sequence<Service> ListOfInterfaceService;
130 //!  List of services.
131   typedef sequence<string> ListOfServices ;
132 //! This struct contains fields defining each interface.
133   struct DefinitionInterface
134   {
135     string                 interfacename ; /*!<Name of the interface.*/
136     ListOfInterfaceService interfaceservicelist ; /*!<List of services of the interface.*/
137   } ;
138 //!  List of interface definitions.
139   typedef sequence<DefinitionInterface> ListOfDefInterface ;
140 //!  List of interface names.
141   typedef sequence<string> ListOfInterfaces ;
142
143 /*! \brief PathPrefix : association of a machine name and
144 a path to a component
145 */
146   struct PathPrefix {
147     string             machine;
148     string             path;
149   };
150
151 //!  List of path prefixes
152   typedef sequence<PathPrefix> PathPrefixes;
153
154 //! Component implementation type
155   enum ImplType {
156     SO,                       /*!< component implemented as a dynamic library loadable with dlopen */
157     PY,                       /*!< component implemented as a python module loadable with import */
158     EXE,                      /*!< component implemented as an executable */
159     CEXE                      /*!< component to be loaded by a container which executable is given in the catalog */
160   } ;
161
162 //! Description of a component
163   struct ComponentDef
164   {
165     ComponentType      type;
166     string             name;
167     string             username;
168     boolean            multistudy;
169     ImplType           implementationType;
170     string             implname;
171     string             icon;
172     string             constraint;
173     ListOfDefInterface interfaces;
174     PathPrefixes       paths;
175   };
176
177 //!  List of component names.
178   typedef sequence<string> ListOfComponents ;
179 //!  List of computer names.
180   typedef sequence<string> ListOfComputers ;
181 //! This struct contains GUI elements used for representation of the module in %IAPP component.
182   struct IAPP_Affich
183   {
184     string modulename;     /*!<Name of the module.*/
185     string moduleusername; /*!<UserName of the module.*/
186     string moduleicone;    /*!<Icone representing the module.*/
187     string moduleversion;  /*!<Version of the module.*/
188     string modulecomment;  /*!<Comment to the module.*/
189   };
190 /*! \brief  List of pair GUI elements (component name, component icone)
191
192  used for representation of the module in %IAPP component.
193 */
194   typedef sequence<IAPP_Affich> ListOfIAPP_Affich ;
195
196 //! This exception is raised when a %component, a %service or a %pathPrefix is not found.
197   exception NotFound
198   {
199     string what ; /*!<Indicates if it's a %component, a %service or a % pathPrefix.*/
200   } ;
201
202   /*! \brief  This interface provides the common functionality information of corresponding component.
203
204    Information is loaded from specific xml files.
205   */
206   interface Acomponent
207   {
208   /*! \brief  Get the list of interface names of the component
209
210     \return a list of interfaces of the component 
211   */
212     ListOfInterfaces GetInterfaceList() ;
213
214   /*! \brief Get an interface of the component
215
216     \note <BR>If the specified interface doesn't exist, Notfound exception is thrown
217     \param interfacename  Name of the interface 
218     \return Required interface
219   */
220     DefinitionInterface GetInterface(in string interfacename) raises(NotFound);
221
222  /*! \brief  Get the list of service names of an interface belonging to the component.
223
224    \note <BR>If the specified interface doesn't exist, Notfound exception is thrown.
225    \param interfacename Name of the interface 
226    \return List of services of the required interface
227  */
228     ListOfServices GetServiceList(in string interfacename) raises(NotFound);
229
230     
231  /*! \brief  Get a service of an interface of the component.
232
233    \note <BR>If the required service or the specified interface don't exist, Notfound exception is thrown.
234    \param interfacename Name of the interface
235    \param servicename Name of the service
236    \return Required service
237  */
238     Service GetService(in string interfacename, 
239                        in string servicename) raises(NotFound);
240
241 /*! \brief Get the default service of an interface of the component.
242
243    \note <BR>If the required service or the specified interface don't exist, Notfound exception is thrown.
244    \param interfacename Name of the interface
245    \return Required service
246  */
247     Service GetDefaultService(in string interfacename) raises(NotFound);
248
249  /*!  \brief Get the prefix path of the computer containing the %component.
250
251    \note <BR>If the required computer doesn't exist, Notfound exception is thrown
252    \param machinename Name of the machine 
253    \return Prefix path
254  */
255     string GetPathPrefix(in string machinename) raises(NotFound);
256
257 /*! \brief Get the constraint affected to the component 
258
259     constraint to be resolved by LifeCycle for the computer choice
260 */
261     readonly attribute string constraint ;
262
263 /*! \brief Get the component name
264 */
265     readonly attribute string componentname;
266
267 /*!  \brief Get the user name of the component
268 */
269     readonly attribute string componentusername;
270
271 /*!  \brief Get whether the component is multistudy or not
272 */
273     readonly attribute boolean multistudy;
274
275 /*!  \brief Get the type of the component
276 */
277     readonly attribute ComponentType component_type ;
278
279 /*! \brief Get the icone of the component (for IAPP)
280 */
281     readonly attribute string component_icone;
282
283 /*! \brief Get the implementation type of the component 
284
285  C++ (dyn lib), Python (module) or executable 
286 */
287     readonly attribute ImplType implementation_type;
288 /*! \brief Get the implementation name of the component 
289
290  It's the name of the dyn lib or the python module or the executable
291 if the default naming scheme is not convenient.
292 */
293     readonly attribute string implementation_name;
294   } ;
295
296 /*! \brief %Module catalog interface
297
298 Interface to get information about components from the module catalog in %SALOME application.
299 */
300   interface ModuleCatalog
301   {
302 /*!  \brief ping the ModuleCatalog server
303 */
304     void ping();
305
306 /*!  \brief Returns the PID of the ModuleCatalog server
307 */
308     long getPID();
309
310 /*! \brief  Shutdown the ModuleCatalog server
311 */    
312     oneway void ShutdownWithExit();
313
314 /*!  \brief Get the types of the catalog
315  */   
316     ListOfTypeDefinition GetTypes();
317
318 /*! \brief Get a list of computer names of the catalog 
319 */   
320     ListOfComputers GetComputerList();
321
322 //!  Get the %PathPrefix of a computer
323     string GetPathPrefix(in string machinename) raises(NotFound);
324
325 //! Get a list of component names of the catalog 
326     ListOfComponents GetComponentList();
327
328 /*! \brief  Get a list of pair GUI elements (component name, component icone) 
329 used for representation of the module in %IAPP component.
330 */
331     ListOfIAPP_Affich GetComponentIconeList();
332
333 /*! \brief  Get a list of component names of a particular type, which belong to this catalog.
334 */  
335     ListOfComponents GetTypedComponentList(in ComponentType _component_type);
336
337 /*! \brief Get one component of the catalog.
338 */
339     Acomponent GetComponent(in string componentname) raises(NotFound);
340
341 /*! \brief Get the description of a component of the catalog.
342 */
343     ComponentDef GetComponentInfo(in string componentName) raises(NotFound);
344
345 /*! \brief  Read a xml file and import new components from this file.
346
347 New components replace existing components with the same name.
348 */
349     void ImportXmlCatalogFile(in string filename) raises(NotFound);
350
351 /*! \brief  Shutdown the module catalog server
352 */
353     void shutdown();
354   } ;
355 };