Salome HOME
Merge from V6_main_20120808 08Aug12
[modules/kernel.git] / src / ModuleCatalog / SALOME_ModuleCatalog_Acomponent_impl.hxx
1 // Copyright (C) 2007-2012  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.
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 //  SALOME ModuleCatalog : implementation of ModuleCatalog server which parsers xml description of modules
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 #ifdef WNT
40 #pragma warning(disable:4275) // Disable warning interface non dll
41 #pragma warning(disable:4290) // Warning Exception ...
42 #endif
43
44 class MODULECATALOG_EXPORT SALOME_ModuleCatalog_AcomponentImpl: public POA_SALOME_ModuleCatalog::Acomponent
45 {
46 public:
47   //! standard constructor
48   SALOME_ModuleCatalog_AcomponentImpl(SALOME_ModuleCatalog::ComponentDef &C);
49
50   //! standard destructor
51   virtual ~SALOME_ModuleCatalog_AcomponentImpl();
52
53   //! method to get a list of the interfaces name of a component
54   /*!
55     \return a list of the interfaces of a component 
56   */
57   virtual SALOME_ModuleCatalog::ListOfInterfaces* GetInterfaceList() ;
58
59   //! method to get one interface of a component
60   /*! If the specified interface doesn't exist, the Notfound exception is thrown
61     \param interface name const car* arguments
62     \return the wanted interface
63   */
64   virtual SALOME_ModuleCatalog::DefinitionInterface* 
65              GetInterface(const char* interfacename)
66              throw(SALOME_ModuleCatalog::NotFound);
67
68   //! method to get a list of the services name of an interface of a component
69  /*!If the specified interface doesn't exist, the Notfound exception is thrown
70    \param interfacename const char* arguments 
71    \return a list of the services of the wanted interface
72  */
73   virtual SALOME_ModuleCatalog::ListOfServices* 
74              GetServiceList(const char* interfacename)
75              throw(SALOME_ModuleCatalog::NotFound);
76
77     
78   //! method to get one service of an interface of a component
79  /*! If the wanted service or the specified interface don't exist, 
80   *  the Notfound exception is thrown
81    \param interfacename const char* arguments 
82    \param servicename const char* arguments
83    \return the wanted service
84  */
85   virtual SALOME_ModuleCatalog::Service* 
86              GetService(const char* interfacename, 
87                         const char* servicename) 
88              throw(SALOME_ModuleCatalog::NotFound);
89
90   //! method to get the default service of an interface of a component
91   /*! If the specified interface doesn't exist, the Notfound exception is thrown
92     \param interfacename const char* arguments 
93     \return the default service of the interface
94   */
95   virtual SALOME_ModuleCatalog::Service* 
96              GetDefaultService(const char* interfacename) 
97              throw(SALOME_ModuleCatalog::NotFound);
98
99   //! method to get the PathPrefix of a computer
100  /*! If the wanted computer doesn't exist, the Notfound exception is thrown
101    \param machinename const char* arguments 
102    \return the prefix path
103  */
104   virtual char* GetPathPrefix(const char* machinename) 
105                 throw(SALOME_ModuleCatalog::NotFound);
106
107   //! method to obtain the constraint affected to a component
108   /*! to be resolved by LifeCycle for the computer choice
109     \return the constraint
110   */
111   virtual char* constraint() ;
112
113   //! method to obtain the componentname
114   /*!
115     \return the component name
116   */
117   virtual char* componentname();
118
119   //! method to obtain the componentusername
120   /*!
121     \return the component user name
122   */
123   virtual char* componentusername();
124
125   //! method to define if a component can be multistudy or not
126   /*!
127     \return true if the component supports multistudy
128   */
129   virtual CORBA::Boolean multistudy();
130
131   //! method to define the type of the component
132   /*!
133     \return the component type
134   */
135   virtual SALOME_ModuleCatalog::ComponentType component_type() ;
136
137   //! method to obtain the component icone (for IAPP)
138   /*!
139     \return the component icon
140   */
141   virtual char* component_icone();
142
143   //! method to define if a component is implemented in a dyn lib a python module or an executable
144   /*!
145     \return an enum SO or PY or EXE or CEXE
146   */
147   virtual SALOME_ModuleCatalog::ImplType implementation_type();
148
149   //! method to obtain the implementation name of the component if the default one is not convenient
150   /*!
151     \return the implementation name to exec
152   */
153   virtual char* implementation_name();
154
155 private :
156
157   SALOME_ModuleCatalog::ComponentDef _Component;
158
159  //! method to duplicate an interface
160   /*!
161     \param service SALOME_ModuleCatalog::DefinitionInterface arguments
162     \return the interface
163   */
164   void duplicate(SALOME_ModuleCatalog::DefinitionInterface &I_out,
165                  const SALOME_ModuleCatalog::DefinitionInterface &I_in);
166
167  //! method to duplicate a service
168   /*!
169     \param service SALOME_ModuleCatalog::Service arguments
170     \return the service
171   */
172   void duplicate(SALOME_ModuleCatalog::Service & S_out,
173                  const SALOME_ModuleCatalog::Service &S_in);
174
175  //! method to duplicate a parameter
176   /*!
177     \param parameter SALOME_ModuleCatalog::ServicesParameter arguments
178     \return the parameter
179   */
180   void duplicate(SALOME_ModuleCatalog::ServicesParameter & P_out,
181                  const SALOME_ModuleCatalog::ServicesParameter & P_in);
182
183  //! method to duplicate a parameter
184   /*!
185     \param parameter SALOME_ModuleCatalog::ServicesDataStreamParameter arguments
186     \return the parameter
187   */
188   void duplicate(SALOME_ModuleCatalog::ServicesDataStreamParameter & P_out,
189                  const SALOME_ModuleCatalog::ServicesDataStreamParameter &P_in);
190
191 };
192
193
194 #endif // ACOMPONENT_IMPL_H