Salome HOME
Make HELLO component appear into "salome sesionless"
[samples/hello.git] / src / HELLO / HELLO.hxx
index 96636cda8853fafafcb1d65203417de387285a5e..f55129051b66e8620186d4e9f9631bc11eaf3e57 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2019  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2021  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 #include CORBA_SERVER_HEADER(HELLO_Gen)
 #include <SALOME_Component_i.hxx>
 
-class HELLOENGINE_EXPORT HELLO :
+class HELLOENGINE_EXPORT HELLO_Abstract :
   public POA_HELLO_ORB::HELLO_Gen,
   public Engines_Component_i 
 {
 public:
-  HELLO( CORBA::ORB_ptr orb,
+  HELLO_Abstract( CORBA::ORB_ptr orb,
         PortableServer::POA_ptr poa,
         PortableServer::ObjectId* contId, 
         const char* instanceName, 
-        const char* interfaceName );
-  virtual ~HELLO();
+        const char* interfaceName ,
+        bool withRegistry = true);
+  virtual ~HELLO_Abstract();
 
   HELLO_ORB::status hello  ( const char* name );
   HELLO_ORB::status goodbye( const char* name );
@@ -56,6 +57,30 @@ public:
                                SALOMEDS::SObject_ptr where,
                                CORBA::Long row, CORBA::Boolean isCopy );
   virtual char*     getVersion();
+  // Get Study
+  virtual SALOMEDS::Study_var getStudyServant() = 0;
+};
+
+class HELLOENGINE_EXPORT HELLO_Session : public HELLO_Abstract
+{
+public:
+  HELLO_Session( CORBA::ORB_ptr orb,
+        PortableServer::POA_ptr poa,
+        PortableServer::ObjectId* contId, 
+        const char* instanceName, 
+        const char* interfaceName):HELLO_Abstract(orb,poa,contId,instanceName,interfaceName,true) { }
+   SALOMEDS::Study_var getStudyServant() override;
+};
+
+class HELLOENGINE_EXPORT HELLO_No_Session : public HELLO_Abstract
+{
+public:
+  HELLO_No_Session( CORBA::ORB_ptr orb,
+        PortableServer::POA_ptr poa,
+        PortableServer::ObjectId* contId, 
+        const char* instanceName, 
+        const char* interfaceName):HELLO_Abstract(orb,poa,contId,instanceName,interfaceName,false) { }
+  SALOMEDS::Study_var getStudyServant() override;
 };
 
 extern "C"