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