Salome HOME
DCQ : Merge with Ecole_ete_a6.
[modules/kernel.git] / src / ModuleCatalog / SALOME_ModuleCatalog_Acomponent_impl.hxx
1 //  SALOME ModuleCatalog : implementation of ModuleCatalog server which parsers xml description of modules
2 //
3 //  Copyright (C) 2003  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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
21 //
22 //
23 //
24 //  File   : SALOME_ModuleCatalog_Acomponent_impl.hxx
25 //  Author : Estelle Deville
26 //  Module : SALOME
27 //  $Header$
28
29 #ifndef ACOMPONENT_IMPL_H
30 #define ACOMPONENT_IMPL_H
31
32 #include "utilities.h"
33 #include "SALOME_ModuleCatalog_Parser.hxx"
34 #include <SALOMEconfig.h>
35
36 #include CORBA_SERVER_HEADER(SALOME_ModuleCatalog)
37
38 class SALOME_ModuleCatalog_AcomponentImpl: public POA_SALOME_ModuleCatalog::Acomponent,
39                       public PortableServer::RefCountServantBase 
40 {
41 public:
42   //! standard constructor
43   SALOME_ModuleCatalog_AcomponentImpl(SALOME_ModuleCatalog::Component &C);
44
45   //! standard destructor
46   virtual ~SALOME_ModuleCatalog_AcomponentImpl();
47
48   //! method to get a list of the interfaces name of a component
49   /*!
50     \return a list of the interfaces of a component 
51   */
52   virtual SALOME_ModuleCatalog::ListOfInterfaces* GetInterfaceList() ;
53
54   //! method to get one interface of a component
55   /*! If the specified interface doesn't exist, the Notfound exception is thrown
56     \param interface name const car* arguments
57     \return the wanted interface
58   */
59   virtual SALOME_ModuleCatalog::DefinitionInterface* 
60              GetInterface(const char* interfacename)
61              throw(SALOME_ModuleCatalog::NotFound);
62
63   //! method to get a list of the services name of an interface of a component
64  /*!If the specified interface doesn't exist, the Notfound exception is thrown
65    \param interfacename const char* arguments 
66    \return a list of the services of the wanted interface
67  */
68   virtual SALOME_ModuleCatalog::ListOfServices* 
69              GetServiceList(const char* interfacename)
70              throw(SALOME_ModuleCatalog::NotFound);
71
72     
73   //! method to get one service of an interface of a component
74  /*! If the wanted service or the specified interface don't exist, 
75   *  the Notfound exception is thrown
76    \param interfacename const char* arguments 
77    \param servicename const char* arguments
78    \return the wanted service
79  */
80   virtual SALOME_ModuleCatalog::Service* 
81              GetService(const char* interfacename, 
82                         const char* servicename) 
83              throw(SALOME_ModuleCatalog::NotFound);
84
85   //! method to get the default service of an interface of a component
86   /*! If the specified interface doesn't exist, the Notfound exception is thrown
87     \param interfacename const char* arguments 
88     \return the default service of the interface
89   */
90   virtual SALOME_ModuleCatalog::Service* 
91              GetDefaultService(const char* interfacename) 
92              throw(SALOME_ModuleCatalog::NotFound);
93
94   //! method to get the PathPrefix of a computer
95  /*! If the wanted computer doesn't exist, the Notfound exception is thrown
96    \param machinename const char* arguments 
97    \return the prefix path
98  */
99   virtual char* GetPathPrefix(const char* machinename) 
100                 throw(SALOME_ModuleCatalog::NotFound);
101
102   //! method to obtain the constraint affected to a component
103   /*! to be resolved by LifeCycle for the computer choice
104     \return the constraint
105   */
106   virtual char* constraint() ;
107
108   //! method to obtain the componentname
109   /*!
110     \return the component name
111   */
112   virtual char* componentname();
113
114   //! method to obtain the componentusername
115   /*!
116     \return the component user name
117   */
118   virtual char* componentusername();
119
120   //! method to define if a component can be multistudy or not
121   /*!
122     \return true if the component supports multistudy
123   */
124   virtual CORBA::Boolean multistudy();
125
126   //! method to define the type of the component
127   /*!
128     \return the component type
129   */
130   virtual SALOME_ModuleCatalog::ComponentType component_type() ;
131
132   //! method to obtain the component icone (for IAPP)
133   /*!
134     \return the component icon
135   */
136   virtual char* component_icone();
137
138   //! method to define if a component is implemented in C++ or Python
139   /*!
140     \return true if it's a C++ component 
141   */
142   virtual CORBA::Boolean implementation_type();
143
144 private :
145
146   SALOME_ModuleCatalog::Component _Component;
147
148  //! method to duplicate an interface
149   /*!
150     \param service SALOME_ModuleCatalog::DefinitionInterface arguments
151     \return the interface
152   */
153   void duplicate(SALOME_ModuleCatalog::DefinitionInterface &I_out,
154                  const SALOME_ModuleCatalog::DefinitionInterface &I_in);
155
156  //! method to duplicate a service
157   /*!
158     \param service SALOME_ModuleCatalog::Service arguments
159     \return the service
160   */
161   void duplicate(SALOME_ModuleCatalog::Service & S_out,
162                  const SALOME_ModuleCatalog::Service &S_in);
163
164  //! method to duplicate a parameter
165   /*!
166     \param parameter SALOME_ModuleCatalog::ServicesParameter arguments
167     \return the parameter
168   */
169   void duplicate(SALOME_ModuleCatalog::ServicesParameter & P_out,
170                  const SALOME_ModuleCatalog::ServicesParameter & P_in);
171
172  //! method to duplicate a parameter
173   /*!
174     \param parameter SALOME_ModuleCatalog::ServicesDataStreamParameter arguments
175     \return the parameter
176   */
177   void duplicate(SALOME_ModuleCatalog::ServicesDataStreamParameter & P_out,
178                  const SALOME_ModuleCatalog::ServicesDataStreamParameter &P_in);
179
180 };
181
182
183 #endif // ACOMPONENT_IMPL_H