Salome HOME
Porting to Mandrake 10.1 and new products:
[modules/kernel.git] / idl / SALOME_Component.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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
19 //
20 //
21 //
22 //  File   : SALOME_Component.idl
23 //  Author : Paul RASCLE, EDF
24 //  $Header: /dn05/salome/CVS/SALOME_ROOT/idl/SALOME_Component.idl
25
26 #ifndef _SALOME_COMPONENT_IDL_
27 #define _SALOME_COMPONENT_IDL_
28 /*!  
29
30 This is a package of interfaces used for connecting new components to %SALOME application. It also contains a set of interfaces used
31 for management of %MED component in %SALOME application.
32 */
33 module Engines
34 {
35 /*!
36     General Key Value Structure to set or get properties, for component
37 */
38   struct KeyValuePair
39   {
40     string key;
41     any value;
42   };
43
44   typedef sequence<KeyValuePair> FieldsDict;
45
46   interface Component ;
47
48 /*! \brief Interface of the %Container
49
50    This interface defines the process of loading and registration
51     of new components in %SALOME application
52 */
53   interface Container
54   {
55
56 /*!
57     Loads into the container a new component, registers it and starts it's CORBA servant.
58     \param nameToRegister     Name of the component which will be registered in Registry (or Name Service)
59     \param componentName     Name of the constructed library of the %component
60     \return a loaded component
61 */
62     Component load_impl(in string nameToRegister, in string componentName);
63
64 /*!
65     Loads into the container a new component, registers it and starts it's CORBA servant.
66     \param nameToRegister    Name used to register in Naming Service, the component instance 
67     \param componentName     Name of the %component
68     \return a new instance of the component or the registered component if already registered or Nil if not possible
69 */
70     Component instance(in string nameToRegister, in string componentName);
71
72 /*!
73     Stops the component servant, and deletes all related objects
74     \param component_i     Component to be removed
75 */
76     void remove_impl(in Component component_i);
77
78 /*!
79     Discharges all components from the container.
80 */
81     void finalize_removal() ;
82 /*!
83      Determines whether the server has been loaded or not.
84 */
85
86     void ping();
87 /*!
88    Name of the %container
89 */
90     readonly attribute string name ;
91 /*!
92    Name of the machine containing this container (location of the container).
93 */
94     readonly attribute string machineName ;
95 /*!
96    Returns True if the %container has been killed
97 */
98     boolean Kill_impl() ;
99 /*!
100    Shutdown the Container process.
101 */
102     oneway void Shutdown();
103 /*!
104    Returns the hostname of the container
105 */
106     string getHostName();
107 /*!
108    Returns the PID of the container
109 */
110     long getPID();
111   };
112 /*! \brief Interface of the %component
113
114     This interface is used for interaction between the %container and the %component and between
115     the components inside the container.
116 */
117   interface Component
118   {
119 /*!
120    The name of the instance of the %Component
121 */
122     readonly attribute string instanceName ;
123 /*!
124    The name of the interface of the %Component
125 */
126     readonly attribute string interfaceName ;
127 /*!
128     Determines whether the server has already been loaded or not.
129 */
130     void ping();
131 /*!
132     Deactivates the %Component.
133 */
134     void destroy() ;
135 /*!
136     Returns the container that the %Component refers to.
137 */
138     Container GetContainerRef() ;
139 /*!
140     Gives a sequence of (key=string,value=any) to the component. 
141     Base class component stores the sequence in a map.
142     The map is cleared before.
143     This map is for use by derived classes. 
144 */
145     void setProperties(in FieldsDict dico);
146 /*!
147     returns a previously stored map (key=string,value=any) as a sequence.
148     See setProperties(in FieldsDict dico).
149 */
150     FieldsDict getProperties();
151 /*!
152    This method is used by the %SUPERVISOR component. It sets the names of the graph and of the node.
153    \param aGraphName Name of graph
154    \param aNodeName Name of node
155 */
156     void Names( in string aGraphName , in string aNodeName ) ;
157 /*!
158    Returns True if the %Component has been killed.
159 */
160     boolean Kill_impl() ;
161 /*!
162    Returns True if the activity of the %Component has been stopped. (It's action can't be resumed)
163 */
164     boolean Stop_impl() ;
165 /*!
166    Returns True if the activity of the %Component has been suspended. (It's action can be resumed)
167 */
168     boolean Suspend_impl() ;
169 /*!
170    Returns True if the activity of the %Component has been resumed.
171 */
172     boolean Resume_impl() ;
173 /*!
174    Returns the Cpu used (long does not run with python !...)
175 */
176     long CpuUsed_impl() ;
177   } ;
178 } ;
179
180 #endif