1 // File: SALOME_NamingService.hxx
2 // Created: Tue June 12 2001
3 // Author: Estelle Deville
5 // Copyright : CEA/DEN/DMSS/LGLS
8 #ifndef SALOME_NAMINGSERVICE_H
9 #define SALOME_NAMINGSERVICE_H
11 #include "utilities.h"
12 #include <omniORB3/CORBA.h>
16 //class ServiceUnreachable;
17 #include "ServiceUnreachable.hxx"
19 class SALOME_NamingService
22 //! default constructor
23 SALOME_NamingService();
25 //! standard constructor
26 SALOME_NamingService(CORBA::ORB_ptr orb);
28 //! standard destructor
29 virtual ~SALOME_NamingService();
31 //! initialize ORB reference after default constructor
32 void init_orb(CORBA::ORB_ptr orb);
34 //! method to create an association in the NamingService between an object reference and a path
35 void Register(CORBA::Object_ptr ObjRef, const char* Path)
36 throw(ServiceUnreachable);
38 //! method to get the ObjRef of a symbolic name
39 CORBA::Object_ptr Resolve(const char* Path)
40 throw( ServiceUnreachable);
42 //! method to research a name from the naming service's current directory
43 int Find(const char* name)
44 throw(ServiceUnreachable);
46 //! method to create a directory from the current directory
47 bool Create_Directory(const char* Path)
48 throw(ServiceUnreachable);
50 //! method to change the current directory to the directory Path indicated in "in" Parameter
51 bool Change_Directory(const char* Path)
52 throw(ServiceUnreachable);
54 //!method to get the current directory
55 char* Current_Directory()
56 throw(ServiceUnreachable);
58 //!method to print all the contexts contained from the current directory
60 throw(ServiceUnreachable);
62 //!method to get all the contexts contained in the current direcotry
63 // Get only objects, isn't iterative
64 vector<string> list_directory()
65 throw(ServiceUnreachable);
67 //! method to destroy an association Path-Object Reference
68 void Destroy_Name(const char* Path)
69 throw(ServiceUnreachable);
71 //! method to destroy a directory if it is empty
72 virtual void Destroy_Directory(const char* Path)
73 throw(ServiceUnreachable);
77 CosNaming::NamingContext_var _root_context, _current_context;
79 //! method called by constructor to initialize _root_context
80 void _initialize_root_context();
82 //! method to decompose a Path : /Kernel/Services/Sessions
83 char* _resolve_Path(char* Path);
85 //! method to decompose a Path : /Kernel/Services/Sessions
86 void _result_resolve_Path(const char* Path, int& j,
87 char ** resultat_resolve_Path);
89 //! internal method called by Find to research a name from the naming service's current directory
90 void _Find(const char* name, CORBA::Long& occurence_number);
92 //! internal method to create a context name from a Path
93 void _create_context_name_dir(char** resultat_resolve_Path,
95 CosNaming::Name& _context_name);
97 //! internal method to create a parse the naming service tree
98 void _current_directory(char** result_path,
100 CosNaming::NamingContext_var context_to_found,
101 CORBA::Boolean& _continue);
104 #endif // SALOME_NAMINGSERVICE_H