Salome HOME
Nouvelles icones
[modules/homard.git] / src / HOMARD / HOMARD_DriverTools.hxx
1 // Copyright (C) 2011-2013  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 //  File   : HOMARD_DriverTools.hxx
20 //  Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
21 //
22 // ----------------------------------------------------------------------------
23
24 #ifndef HOMARD_DRIVERTOOLS_H
25 #define HOMARD_DRIVERTOOLS_H
26
27 #include <string>
28
29 class HOMARD_Boundary;
30 class HOMARD_Cas;
31 class HOMARD_Iteration;
32 class HOMARD_Hypothesis;
33 class HOMARD_Zone;
34 class HOMARD_YACS;
35
36 namespace HOMARD
37 {
38   //! persistence entity type
39   typedef enum { Case, Zone, Hypothesis, Iteration, Boundary, YACS } SignatureType;
40
41   //! get persistence signature
42   std::string GetSignature( SignatureType type );
43
44   //! get data separator
45   std::string separator();
46
47   //! dump boundary to the string
48   std::string Dump( const ::HOMARD_Boundary& boundary );
49   //! dump case to the string
50   std::string Dump( const ::HOMARD_Cas& cas );
51   //! dump iteration to the string
52   std::string Dump( const ::HOMARD_Iteration& iteration );
53   //! dump hypothesis to the string
54   std::string Dump( const ::HOMARD_Hypothesis& hypothesis );
55   //! dump zone to the string
56   std::string Dump( const ::HOMARD_Zone& zone );
57   //! dump yacs to the string
58   std::string Dump( const ::HOMARD_YACS& yacs );
59
60   //! restore boundary from the string
61   bool Restore( ::HOMARD_Boundary& boundary, const std::string& stream );
62   //! restore case from the string
63   bool Restore( ::HOMARD_Cas& cas, const std::string& stream );
64   //! restore hypothesis from the string
65   bool Restore( ::HOMARD_Hypothesis& hypothesis, const std::string& stream );
66   //! restore iteration from the string
67   bool Restore( ::HOMARD_Iteration& iteration, const std::string& stream );
68   //! restore zone from the string
69   bool Restore( ::HOMARD_Zone& zone, const std::string& stream );
70   //! restore yacs from the string
71   bool Restore( ::HOMARD_YACS& yacs, const std::string& stream );
72 };
73
74 #endif // HOMARD_DRIVERTOOLS_H