Salome HOME
Copyrights update 2015.
[tools/simanio.git] / src / SimanIO_Link.hxx
1 // Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
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, or (at your option) any later version.
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
20 #ifndef SIMANIO_LINK_H
21 #define SIMANIO_LINK_H
22
23 #include "SimanIO.hxx"
24
25 #include "SimanIO_Configuration.hxx"
26
27 /**
28  * \brief Class for creation of connection with SIMAN database.
29  */
30
31 class SIMANIO_EXPORT SimanIO_Link {
32   std::string myStudy;    ///< identifier of the study in the SIMAN
33   std::string myScenario; ///< identifier of the scenario in the SIMAN
34   std::string myUser;     ///< identifier of the user in the SIMAN
35 public:
36   /**
37    * Initializes the connection to the data base with certain connection properties.
38    * \param theStudyID defines the selected study id in SIMAN
39    * \param theScenarioID defines the secnario id in SIMAN
40    * \param theUserID identifies the current SIMAN user id
41    */
42   SimanIO_Link(const char* theStudyID, const char* theScenarioID, const char* theUserID);
43
44   /**
45    * Checks the connection status.
46    * \returns true if data base is currently connected.
47    */
48   bool IsConnected();
49
50   /**
51    * Retrieves scenario "conf" file from the SIMAN.
52    * \returns CFG file interface, connected to the received file to get data from it.
53    */
54   SimanIO_Configuration RetrieveConf();
55
56   /**
57    * Stores configuration information to the SIMAN.
58    * \param theConf interface for configuration data storage; data in this interface will be stored in SIMAN
59    */
60   void StoreConf(/*const*/ SimanIO_Configuration& theConf);
61 };
62
63 #endif