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