Salome HOME
Bug IPAL19893 4.x: debug information is in terminal.
[modules/kernel.git] / idl / SALOME_ModuleCatalog.idl
1 //  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
3 // 
4 //  This library is free software; you can redistribute it and/or 
5 //  modify it under the terms of the GNU Lesser General Public 
6 //  License as published by the Free Software Foundation; either 
7 //  version 2.1 of the License. 
8 // 
9 //  This library is distributed in the hope that it will be useful, 
10 //  but WITHOUT ANY WARRANTY; without even the implied warranty of 
11 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
12 //  Lesser General Public License for more details. 
13 // 
14 //  You should have received a copy of the GNU Lesser General Public 
15 //  License along with this library; if not, write to the Free Software 
16 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
17 // 
18 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 //
20 //
21 //
22 //  File   : SALOME_ModuleCatalog.idl
23 //  Author : Estelle Deville
24 //  $Header$
25
26 /*! \file SALOME_ModuleCatalog.idl This file conatins a set of interfaces used for  
27   creation of the catalog of components in %SALOME application
28 */
29
30 /*!  
31 The main package of interfaces used for creation of the module catalog in %SALOME application.
32 Module catalog allows to manage components of %SALOME application, to call specified in the
33 xml files interfaces with the help of AComponent interface.
34 */
35 module SALOME_ModuleCatalog
36 {
37   // Type Definitions
38 /*! 
39 This enumeration contains a current set of definitions of the components integrated
40 into %SALOME application.
41 */
42   enum ComponentType {  GEOM,  /*!<Module %GEOM */
43                         MESH,  /*!<Module %MESH */
44                          Med,  /*!<Module %Med*/
45                       SOLVER,  /*!<Module of %SOLVER type */
46                         DATA,  /*!<Module %DATA */
47                         VISU,  /*!<Module %VISU */
48                       SUPERV,  /*!<Module %SUPERVISION */
49                        OTHER   /*!<Any other type of module */
50                      } ;
51 /*! 
52 This struct contains fields defining the parameter of the service.
53 */
54
55   struct ServicesParameter
56   {
57     string Parametertype; /*!<Type of the parameter.*/
58     string Parametername; /*!<Name of the parameter.*/
59   } ;
60
61   enum DataStreamDependency {
62     DATASTREAM_UNDEFINED,
63     DATASTREAM_TEMPORAL,
64     DATASTREAM_ITERATIVE
65   } ;
66
67   struct ServicesDataStreamParameter
68   {
69     string Parametertype;                     /*!<Type of the parameter.*/
70     string Parametername;                     /*!<Name of the parameter.*/
71     DataStreamDependency Parameterdependency; /*!<Temporal or iterative dependency.*/
72   } ;
73
74 /*! 
75 The list of the parameters of service.
76 */
77
78   typedef sequence<ServicesParameter> ListOfServicesParameter;
79   typedef sequence<ServicesDataStreamParameter> ListOfServicesDataStreamParameter;
80
81   typedef sequence<string> ListOfString;
82   enum TypeKind 
83   {
84     NONE     ,
85     Dble   ,
86     Int      ,
87     Str   ,
88     Bool     ,
89     Objref   ,
90     Seq ,
91     Array    ,
92     Struc 
93   };
94   struct MemberDefinition
95   {
96     string name; /*! Name of the member */
97     string type; /*! Type of the member */
98   };
99   typedef sequence<MemberDefinition> ListOfMemberDefinition;
100 /*! 
101  * Struct to get the definition of types used in Salome catalogs
102  */
103   struct TypeDefinition
104   {
105     string name; /*! Name of the type */
106     TypeKind kind; /*! Kind of the type.*/
107     string id; /*! id (if needed) */
108     string content; /*! Content type (if needed) */
109     ListOfString bases; /*! Content type (if needed) */
110     ListOfMemberDefinition members; /*! Members types (if needed) */
111   };
112
113   typedef sequence<TypeDefinition> ListOfTypeDefinition;
114
115 /*! 
116 This struct contains fields completely defining each service.
117 */
118
119   struct Service
120   {
121     string                            ServiceName; /*!<Name of the service.*/
122     ListOfServicesParameter           ServiceinParameter; /*!< List of input parameters of the services.*/
123     ListOfServicesParameter           ServiceoutParameter; /*!< List of output parameters of the services.*/
124     ListOfServicesDataStreamParameter ServiceinDataStreamParameter; /*!< List of input parameters of the services.*/
125     ListOfServicesDataStreamParameter ServiceoutDataStreamParameter; /*!< List of output parameters of the services.*/
126     boolean                           Servicebydefault; /*!<True if the service is taken with its default fields.*/
127     boolean                           TypeOfNode; /*!<True is the service is a factory node. Otherwise, it's a compute node.*/
128   } ;
129 /*! 
130 List of services of the interface.
131 */
132   typedef sequence<Service> ListOfInterfaceService;
133 /*! 
134 List of services.
135 */
136   typedef sequence<string> ListOfServices ;
137 /*! 
138 This struct contains fields defining each interface.
139 */
140   struct DefinitionInterface
141   {
142     string                 interfacename ; /*!<Name of the interface.*/
143     ListOfInterfaceService interfaceservicelist ; /*!<List of services of the interface.*/
144   } ;
145 /*! 
146 List of interface definitions.
147 */
148   typedef sequence<DefinitionInterface> ListOfDefInterface ;
149 /*! 
150 List of names of interfaces.
151 */
152   typedef sequence<string> ListOfInterfaces ;
153
154 /*!
155 PathPrefix : association of a machine name and
156 a path to a component
157 */
158   struct PathPrefix {
159     string             machine;
160     string             path;
161   };
162
163 /*! 
164 List of path prefixes
165 */
166   typedef sequence<PathPrefix> PathPrefixes;
167
168 /*!
169 Implementation type
170 */
171   enum ImplType {
172     SO,                       /* component implemented as a dynamic library loadable with dlopen */
173     PY,                       /* component implemented as a python module loadable with import */
174     EXE,                      /* component implemented as an executable */
175     CEXE                      /* component to be loaded by a container which executable is given in the catalog */
176   } ;
177
178 /*!
179 Description of a component
180 */
181   struct ComponentDef
182   {
183     ComponentType      type;
184     string             name;
185     string             username;
186     boolean            multistudy;
187     ImplType           implementationType;
188     string             implname;
189     string             icon;
190     string             constraint;
191     ListOfDefInterface interfaces;
192     PathPrefixes       paths;
193   };
194
195 /*! 
196 List of names of components.
197 */
198   typedef sequence<string> ListOfComponents ;
199 /*! 
200 List of names of computers.
201 */
202   typedef sequence<string> ListOfComputers ;
203 /*! 
204 This struct contains GUI elements used for representation of the module in %IAPP component.
205 */
206   struct IAPP_Affich
207   {
208     string modulename;     /*!<Name of the module.*/
209     string moduleusername; /*!<UserName of the module.*/
210     string moduleicone;    /*!<Icone representing the module.*/
211     string moduleversion;  /*!<Version of the module.*/
212     string modulecomment;  /*!<Comment to the module.*/
213   };
214 /*!
215 List of pair GUI elements (component name, component icone)
216  used for representation of the module in %IAPP component.
217 */
218   typedef sequence<IAPP_Affich> ListOfIAPP_Affich ;
219
220 /*! 
221  This exception is raised when a %component, a %service or a % pathPrefix is not found.
222 */
223   exception NotFound
224   {
225     string what ; /*!<Indicates if it's a %component, a %service or a % pathPrefix.*/
226   } ;
227
228   /*!
229    This interface provides the common funcionality information of corresponding component.
230    Information is loaded from specific xml files.
231   */
232   interface Acomponent
233   {
234     // GetInterfaceList : operation to get a list of the interfaces name of
235     //                    a component
236   /*!
237    Gets the list of names of interfaces of the component
238     \return a list of interfaces of the component 
239   */
240     ListOfInterfaces GetInterfaceList() ;
241
242     // GetInterface : operation to get one interface of a component
243   
244   /*! 
245     Gets a definite interface of the component
246     \note <BR>If the specified interface doesn't exist, Notfound exception is thrown
247     \param interfacename  Name of the interface 
248     \return Required interface
249   */
250     DefinitionInterface GetInterface(in string interfacename) raises(NotFound);
251
252     // GetServiceList : operation to get a list of the services name of
253     //                  an interface of a component
254  /*! 
255    Gets the list of names of services of a definite interface belonging to the component.
256    \note <BR>If the specified interface doesn't exist, Notfound exception is thrown.
257    \param interfacename Name of the interface 
258    \return List of services of the required interface
259  */
260     ListOfServices GetServiceList(in string interfacename) raises(NotFound);
261
262     
263     // GetService : operation to get one service of an interface of a component
264   
265  /*! 
266    Gets a definite service of an interface of the component.
267    \note <BR>If the required service or the specified interface don't exist, Notfound exception is thrown.
268    \param interfacename Name of the interface
269    \param servicename Name of the service
270    \return Required service
271  */
272
273     Service GetService(in string interfacename, 
274                        in string servicename) raises(NotFound);
275
276     // GetDefaultService : operation to get the default service
277     //                     of an interface of a component
278 /*! 
279    Gets the default service of an interface of the component.
280    \note <BR>If the required service or the specified interface don't exist, Notfound exception is thrown.
281    \param interfacename Name of the interface
282    \return Required service
283  */
284
285     Service GetDefaultService(in string interfacename) raises(NotFound);
286
287     // GetPathPrefix : operation to get the PathPrefix of a computer
288  /*!  
289    Gets the prefix path of the computer containing the %component.
290    \note <BR>If the required computer doesn't exist, Notfound exception is thrown
291    \param machinename Name of the machine 
292    \return Prefix path
293  */
294
295     string GetPathPrefix(in string machinename) raises(NotFound);
296
297 /*! 
298     Get the constraint affected to the component 
299     (to be resolved by LifeCycle for the computer choice)
300 */
301     readonly attribute string constraint ;
302
303 /*! 
304 Get the name of the component
305 */
306     readonly attribute string componentname;
307
308 /*!
309 Get the user name of the component
310 */
311     readonly attribute string componentusername;
312
313 /*! 
314 Ask whether the component is multistudy or not
315 */
316     readonly attribute boolean multistudy;
317
318 /*! 
319 Ask the type of the component
320 */
321     readonly attribute ComponentType component_type ;
322
323 /*! 
324 Gets the icone of the component (for IAPP)
325 */
326     readonly attribute string component_icone;
327
328 /*! 
329 Gets the implementation type of the component : C++ (dyn lib), Python (module) or executable 
330 */
331     readonly attribute ImplType implementation_type;
332 /*! 
333 Gets the implementation name of the component : name of the dyn lib or the python module or the executable
334 if the default naming scheme is not convenient.
335 */
336     readonly attribute string implementation_name;
337   } ;
338
339 /*! \brief %Module catalog interface
340
341 This interface is used for creation of the module catalog in %SALOME application.
342 */
343   interface ModuleCatalog
344   {
345     void ping();
346
347 /*!
348     Returns the PID of the server
349 */
350     long getPID();
351
352 /*!
353     Shutdown the ModuleCatalog process.
354 */    
355     oneway void ShutdownWithExit();
356
357 /*! 
358  * Get the types of the catalog
359  */   
360     ListOfTypeDefinition GetTypes();
361
362 /*! 
363  Gets a list of names of computers of the catalog 
364 */   
365     ListOfComputers GetComputerList();
366
367 /*! 
368 Gets the %PathPrefix of a computer
369 */
370     string GetPathPrefix(in string machinename) raises(NotFound);
371 /*! 
372  Gets a list of names of components of the catalog 
373 */   
374     ListOfComponents GetComponentList();
375 /*! 
376 Gets a list of pair GUI elements (component name, component icone) 
377 used for representation of the module in %IAPP component.
378 */
379
380     ListOfIAPP_Affich GetComponentIconeList();
381 /*! 
382 Gets a list of names of components of a particular type, which belong to this catalog.
383 */  
384     // GetComponentList : operation to get a list of the components name of
385     //                    a particular type of the catalog   
386     ListOfComponents GetTypedComponentList(in ComponentType _component_type);
387
388 /*! 
389 Gets one component of the catalog.
390 */
391     Acomponent GetComponent(in string componentname) raises(NotFound);
392
393 /*! 
394 Gets the description of a component of the catalog.
395 */
396     ComponentDef GetComponentInfo(in string componentName) raises(NotFound);
397
398 /*!
399 Reads a xml file and imports new components from this file.
400 New components replace existing components with the same name.
401 */
402     void ImportXmlCatalogFile(in string filename) raises(NotFound);
403
404     void shutdown();
405   } ;
406 };