1 // SALOME ModuleCatalog : implementation of ModuleCatalog server which parsers xml description of modules
3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
20 // See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
24 // File : SALOME_ModuleCatalog_impl.hxx
25 // Author : Estelle Deville
29 #ifndef MODULECATALOG_IMPL_H
30 #define MODULECATALOG_IMPL_H
32 #include "utilities.h"
33 #include "SALOME_ModuleCatalog_Handler.hxx"
34 #include "PathPrefix.hxx"
35 #include <SALOMEconfig.h>
36 #include CORBA_SERVER_HEADER(SALOME_ModuleCatalog)
38 class SALOME_ModuleCatalogImpl: public POA_SALOME_ModuleCatalog::ModuleCatalog,
39 public PortableServer::RefCountServantBase
42 //! standard constructor
43 SALOME_ModuleCatalogImpl(int artgc, char** argv);
45 //! standard destructor
46 virtual ~SALOME_ModuleCatalogImpl();
48 //! method to get a component list
50 \return a component list
52 virtual SALOME_ModuleCatalog::ListOfComputers* GetComputerList();
54 //! method to get the PathPrefix of a computer
55 /*! If the wanted computer doesn't exist, the Notfound exception is thrown
56 \param machinename const char* arguments
57 \return the prefix path
59 virtual char* GetPathPrefix(const char* machinename);
61 //! method to get a component list
63 \return a component list
65 virtual SALOME_ModuleCatalog::ListOfComponents* GetComponentList();
67 //! method to get a component list of component name and component icone
69 \return a list of couple (component name, component icone)
71 virtual SALOME_ModuleCatalog::ListOfIAPP_Affich* GetComponentIconeList();
73 //! method to get a component list of a wanted type
75 \return a component list
77 virtual SALOME_ModuleCatalog::ListOfComponents*
78 GetTypedComponentList(SALOME_ModuleCatalog::ComponentType component_type);
80 //! method to get a component
82 \param componentname const char* arguments
83 \return the wanted component
85 virtual SALOME_ModuleCatalog::Acomponent_ptr
86 GetComponent(const char* componentname);
91 //! method to parse one module catalog
93 \param file const char* arguments
94 \param modulelist ListOfParserComponent arguments
95 \param pathlist ListOfParserPathPrefix arguments
97 virtual void _parse_xml_file(const char* file,
98 ListOfParserComponent& modulelist,
99 ListOfParserPathPrefix& pathlist);
101 //! method to create a list of interfaces from the parsing of the catalog
103 \param list_interface ListOfDefinitionInterface arguments
104 \return the interfaces list
106 virtual SALOME_ModuleCatalog::ListOfDefInterface
107 duplicate_interfaces(ListOfDefinitionInterface list_interface);
109 //! method to create the path prefix structures from the catalog parsing
111 \param pathes ListOfParserPathPrefix arguments
114 virtual ListOfPathPrefix duplicate_pathes(ListOfParserPathPrefix pathes);
116 //! method to verify path prefix content
118 \param pathlist ListOfParserPathPrefix arguments
119 \return true if verfication is OK
121 virtual bool _verify_path_prefix(ListOfParserPathPrefix pathlist);
124 //! method to parse arguments to get general and personal catalog files
126 \param argc int arguments
127 \param argv char** arguments
128 \param _general char** arguments
129 \return true if parsing is OK
131 virtual bool _parseArguments(int argc, char **argv,
132 char **_general, char** _personal);
135 // Theses variables will contain the path to the general and personal catalogs
137 char* _personal_path;
140 // These variables will contain the informations on the general common catalog
141 ListOfParserComponent _general_module_list ;
142 ListOfParserPathPrefix _general_path_list ;
144 // These variables will contain the informations on the personal catalog
145 ListOfParserComponent _personal_module_list ;
146 ListOfParserPathPrefix _personal_path_list ;
150 #endif // MODULECATALOG_IMPL_H