Salome HOME
bos #26460 Add SSL mode
[samples/atomsolv.git] / src / ATOMSOLV / ATOMSOLV.hxx
1 // Copyright (C) 2007-2021  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 _ATOMSOLV_HXX_
21 #define _ATOMSOLV_HXX_
22
23 #include <SALOMEconfig.h>
24 #include CORBA_SERVER_HEADER(ATOMSOLV)
25 #include CORBA_SERVER_HEADER(ATOMGEN)
26 #include "SALOME_Component_i.hxx"
27
28 #include <map>
29
30 #if defined WIN32
31 #  if defined ATOMSOLV_EXPORTS || defined ATOMSOLVEngine_EXPORTS
32 #    define ATOMSOLV_EXPORT __declspec( dllexport )
33 #  else
34 #    define ATOMSOLV_EXPORT __declspec( dllimport )
35 #  endif
36 #else
37 #  define ATOMSOLV_EXPORT
38 #endif
39
40
41 class ATOMSOLV_EXPORT ATOMSOLV_Abstract:
42   public POA_ATOMSOLV_ORB::ATOMSOLV_Gen,
43   public Engines_Component_i 
44 {
45
46 public:
47   ATOMSOLV_Abstract(CORBA::ORB_ptr orb,
48            PortableServer::POA_ptr poa,
49            PortableServer::ObjectId * contId, 
50            const char *instanceName, 
51            const char *interfaceName,
52      bool withRegistry = true);
53   virtual ~ATOMSOLV_Abstract();
54
55   CORBA::Boolean setData( const ATOMSOLV_ORB::TMoleculeList& theData );
56   CORBA::Boolean getData( ATOMSOLV_ORB::TMoleculeList_out outData );
57   CORBA::Boolean processData();
58   virtual char*  getVersion();
59
60 private:
61   ATOMSOLV_ORB::TMoleculeList* myData;
62 };
63
64 class ATOMSOLV_EXPORT ATOMSOLV_Session : public ATOMSOLV_Abstract
65 {
66 public:
67   ATOMSOLV_Session( CORBA::ORB_ptr orb,
68          PortableServer::POA_ptr poa,
69          PortableServer::ObjectId* contId, 
70          const char* instanceName, 
71          const char* interfaceName):ATOMSOLV_Abstract(orb,poa,contId,instanceName,interfaceName,true) { }
72 };
73
74 class ATOMSOLV_EXPORT ATOMSOLV_No_Session : public ATOMSOLV_Abstract
75 {
76 public:
77   ATOMSOLV_No_Session( CORBA::ORB_ptr orb,
78          PortableServer::POA_ptr poa,
79          PortableServer::ObjectId* contId, 
80          const char* instanceName, 
81          const char* interfaceName):ATOMSOLV_Abstract(orb,poa,contId,instanceName,interfaceName,false) { }
82 };
83
84 extern "C"
85  ATOMSOLV_EXPORT
86 PortableServer::ObjectId * ATOMSOLVEngine_factory(CORBA::ORB_ptr orb,
87                                                   PortableServer::POA_ptr poa,
88                                                   PortableServer::ObjectId * contId,
89                                                   const char *instanceName,
90                                                   const char *interfaceName);
91
92 #endif