Salome HOME
Increment version number (2.2.3)
[modules/kernel.git] / src / DataTypeCatalog / SALOME_DataTypeCatalog_impl.hxx
1 //  SALOME DataTypeCatalog : catalog of data types
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_DataTypeCatalog_impl.hxx
25 //  Author : Estelle Deville
26 //  Module : SALOME
27 //  $Header$
28
29 #ifndef DATATYPECATALOG_IMPL_H
30 #define DATATYPECATALOG_IMPL_H
31
32 #include "utilities.h"
33 #include "SALOME_DataTypeCatalog_Handler.hxx"
34 #include <SALOMEconfig.h>
35 #include CORBA_SERVER_HEADER(SALOME_DataTypeCatalog)
36
37 class SALOME_DataTypeCatalogImpl: public POA_SALOME_DataTypeCatalog::DataCatalog,
38                                   public PortableServer::RefCountServantBase 
39 {
40 public:
41   //! standard constructor
42   SALOME_DataTypeCatalogImpl(int argc, char** argv);
43
44   //! standard destructor
45   virtual ~SALOME_DataTypeCatalogImpl();
46
47   //! method to get a data type list
48   /*!
49     \return a data type list 
50   */
51   virtual SALOME_DataTypeCatalog::ListOfDataTypeName* GetDataTypeList();
52
53   //! method to know if type_out is derived from type_in
54   /*!
55     \param type_in const char* arguments
56     \param type_out const char* arguments
57     \return a boolean (true if type_out is derived from type_in)
58   */
59   virtual CORBA::Boolean isDerivedFrom(const char* type_in, const char* type_out) throw(SALOME_DataTypeCatalog::NotFound);
60
61   //! method to get the name of the interface to acces the data in read mode
62   /*!
63     \param type const char* arguments
64     \return the read interface name
65   */
66   virtual char* GetDataInterfaceRead(const char* type) throw(SALOME_DataTypeCatalog::NotFound);
67
68
69   //! method to get the name of the interface to acces the data in write mode
70   /*!
71     \param type const char* arguments
72     \return the write interface name
73   */
74   virtual char* GetDataInterfaceWrite(const char* type) throw(SALOME_DataTypeCatalog::NotFound);
75
76  //! method to get parents data type list
77   /*!
78     \param type const char* arguments
79     \return a data type list 
80   */
81   virtual SALOME_DataTypeCatalog::ListOfDataTypeName* 
82   GetDataTypeParents(const char* type) throw(SALOME_DataTypeCatalog::NotFound);
83
84
85 private:
86  //! method to know if parents type of data_out derived from type_in
87   /*!
88     \param type_in const char* arguments
89     \param data_out const ParserDataType arguments (by value)
90     \return a boolean (true if type_out is derived from type_in)
91   */
92   virtual CORBA::Boolean _explore_parents(const char* type_in,
93                                           ParserDataType& data_out);
94
95
96   //! method to parse the data type catalog
97   /*! 
98     \param file const char* arguments
99     \param datatypelist ListOfParserDataType arguments
100   */
101   virtual void _parse_xml_file(const char* file, 
102                                ListOfParserDataType& datatypelist);
103
104
105  //! method to verify data type content
106   /*!
107     \param datatypelist ListOfParserDataType arguments
108     \return true if verfication is OK
109   */
110   virtual bool _verify_data_type(ListOfParserDataType datatypelist);
111
112
113  //! method to parse arguments to get general and personal catalog files
114   /*!
115     \param argc int arguments
116     \param argv char** arguments
117     \param _path_data char** arguments
118     \return true if parsing is OK
119   */
120   virtual bool _parseArguments(int argc, char **argv, char **_path_data);
121
122
123   // will contain the path to the data type catalog
124   char* _path_datatype;
125
126
127   //will contain the informations on the data type catalog(after parsing)
128   ListOfParserDataType _datatype_list ;
129 };
130
131 #endif // DATATYPECATALOG_IMPL_H