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