Salome HOME
merge from branch BR_V5_DEV
[modules/kernel.git] / src / NamingService / SALOME_NamingService.i
1 //  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 //  SALOME NamingService : wrapping NamingService services
23 //  File   : SALOME_NamingService.i
24 //  Author : Paul RASCLE, EDF
25 //  Module : SALOME
26 //  $Header$
27 //
28 %{
29 #include "SALOME_NamingService.hxx"
30 //#include <omniORB4/CORBA.h>
31 #include <omniORB3/CORBA.h>
32 #include "ServiceUnreachable.hxx"
33 %}
34
35 %except(python)
36 {
37   try 
38     {
39       $function
40     }
41   catch (ServiceUnreachable)
42     {
43       PyErr_SetString(PyExc_IndexError,"Naming Service Unreacheable");
44       return NULL;
45     }
46 }
47
48 class SALOME_NamingService
49 {
50 public:
51
52   //! standard constructor
53   SALOME_NamingService();
54
55   //! standard destructor
56   virtual ~SALOME_NamingService();
57
58   //! initialize ORB reference after default constructor
59   void init_orb(CORBA::ORB_ptr orb);
60
61   //! method to create an association in the NamingService between an object reference and a path
62   void Register(CORBA::Object_ptr ObjRef, const char* Path)
63     throw(ServiceUnreachable);
64
65   //! method to get the ObjRef of a symbolic name
66   CORBA::Object_ptr Resolve(const char* Path)
67     throw( ServiceUnreachable);
68
69   //! method to research a name from the naming service's current directory
70   int Find(const char* name)
71     throw(ServiceUnreachable);
72
73   //! method to create a directory from the current directory
74   bool Create_Directory(const char* Path)
75     throw(ServiceUnreachable);
76
77   //! method to change the current directory to the directory Path indicated in "in" Parameter
78   bool Change_Directory(const char* Path)
79     throw(ServiceUnreachable);
80
81   //!method to get the current directory
82   char* Current_Directory()
83     throw(ServiceUnreachable);
84
85   //!method to print all the contexts contained from the current directory
86   void list()
87     throw(ServiceUnreachable);
88
89   //! method to destroy an association Path-Object Reference
90   void Destroy_Name(const char* Path)
91     throw(ServiceUnreachable);
92  
93   //! method to destroy a directory if it is empty
94   virtual void Destroy_Directory(const char* Path)
95     throw(ServiceUnreachable);
96 };
97