SALOME_NamingService Class Reference

#include <SALOME_NamingService.hxx>


Public Member Functions

 SALOME_NamingService ()
 default constructor

 SALOME_NamingService (CORBA::ORB_ptr orb)
 standard constructor

virtual ~SALOME_NamingService ()
 standard destructor

void init_orb (CORBA::ORB_ptr orb)
 initialize ORB reference after default constructor

void Register (CORBA::Object_ptr ObjRef, const char *Path) throw (ServiceUnreachable)
 method to create an association in the NamingService between an object reference and a path

CORBA::Object_ptr Resolve (const char *Path) throw ( ServiceUnreachable)
 method to get the ObjRef of a symbolic name

int Find (const char *name) throw (ServiceUnreachable)
 method to research a name from the naming service's current directory

bool Create_Directory (const char *Path) throw (ServiceUnreachable)
 method to create a directory from the current directory

bool Change_Directory (const char *Path) throw (ServiceUnreachable)
 method to change the current directory to the directory Path indicated in "in" Parameter

char * Current_Directory () throw (ServiceUnreachable)
 method to get the current directory

void list () throw (ServiceUnreachable)
 method to print all the contexts contained from the current directory

std::vector< std::string > list_directory () throw (ServiceUnreachable)
 method to get all the contexts contained in the current direcotry

std::vector< std::string > list_directory_recurs () throw (ServiceUnreachable)
 methods that lists all objects RECUSIVELY in the current directory

void Destroy_Name (const char *Path) throw (ServiceUnreachable)
 method to destroy an association Path-Object Reference

virtual void Destroy_Directory (const char *Path) throw (ServiceUnreachable)
 method to destroy a directory if it is empty

char * getIORaddr ()
 get IORstring naming service address


Protected Member Functions

void _initialize_root_context ()
 method called by constructor to initialize _root_context

char * _resolve_Path (char *Path)
 method to decompose a Path : /Kernel/Services/Sessions

void _result_resolve_Path (const char *Path, int &j, char **resultat_resolve_Path)
 method to decompose a Path : /Kernel/Services/Sessions

void _Find (const char *name, CORBA::Long &occurence_number)
 internal method called by Find to research a name from the naming service's current directory

void _create_context_name_dir (char **resultat_resolve_Path, int length_copy, CosNaming::Name &_context_name)
 internal method to create a context name from a Path

void _current_directory (char **result_path, int &length_result, CosNaming::NamingContext_var context_to_found, CORBA::Boolean &_continue)
 internal method to create a parse the naming service tree

void _list_directory_recurs (std::vector< std::string > &myList, const char *relativeSubDir, const char *absCurDirectory)
 internal method to list all (recursively) the objects contains in absCurDirectory/relativeSubDir.


Protected Attributes

CORBA::ORB_ptr _orb
CosNaming::NamingContext_var _root_context
CosNaming::NamingContext_var _current_context


Constructor & Destructor Documentation

SALOME_NamingService::SALOME_NamingService  ) 
 

Function : SALOME_NamingService Purpose : Constructor and Initialisation of _root_context

SALOME_NamingService::SALOME_NamingService CORBA::ORB_ptr  orb  ) 
 

Function : SALOME_NamingService

Parameters:
orb CORBA::ORB_ptr arguments

SALOME_NamingService::~SALOME_NamingService  )  [virtual]
 

Function : ~SALOME_NamingService Purpose : Destructor


Member Function Documentation

void SALOME_NamingService::init_orb CORBA::ORB_ptr  orb  ) 
 

Function : init_orb initialize ORB reference after default constructor

void SALOME_NamingService::Register CORBA::Object_ptr  ObjRef,
const char *  Path
throw (ServiceUnreachable)
 

Function : Register Method to create an association in the NamingService between ObjRef and Path. If the NamingService is out, the exception ServiceUnreachable is thrown

Parameters:
ObjRef CORBA::Object_ptr arguments
Path const char* arguments

CORBA::Object_ptr SALOME_NamingService::Resolve const char *  Path  )  throw ( ServiceUnreachable)
 

Function : Resolve Purpose : method to get the ObjRef of a symbolic name If the NamingService is out, the exception ServiceUnreachable is thrown

Parameters:
Path const char* arguments
Returns:
the object reference

int SALOME_NamingService::Find const char *  name  )  throw (ServiceUnreachable)
 

Function : Find Purpose : method to research a name from the current directory of the naming service. The naming service changes directory to go to the directory where the last occurence was found. If the NamingService is out, the exception ServiceUnreachable is thrown

Parameters:
name const char* arguments
Returns:
the number of occurences found
See also:
_Find

bool SALOME_NamingService::Create_Directory const char *  Path  )  throw (ServiceUnreachable)
 

Function : Create_Directory Purpose : method to create a directory from the current directory. If the NamingService is out, the exception ServiceUnreachable is thrown

Parameters:
Path const char* arguments
Returns:
a boolean to indicate if the creation succeeded

bool SALOME_NamingService::Change_Directory const char *  Path  )  throw (ServiceUnreachable)
 

Function : Change_Directory Purpose : method to change the current directory to the directory Path indicated in "in" Parameter. If Path ="/", the current directory changes to the root directory. If the NamingService is out, the exception ServiceUnreachable is thrown.

Parameters:
Path const char* arguments
Returns:
a boolean to indicate if the change succeeded

char * SALOME_NamingService::Current_Directory  )  throw (ServiceUnreachable)
 

Function : Current_Directory Purpose : method to get the current directory. If the NamingService is out, the exception ServiceUnreachable is thrown

Returns:
the path of the current_context
See also:
_current_directory

void SALOME_NamingService::list  )  throw (ServiceUnreachable)
 

Function : list Purpose : method to list and print all the context contained from the current context If the NamingService is out, the exception ServiceUnreachable is thrown

vector< string > SALOME_NamingService::list_directory  )  throw (ServiceUnreachable)
 

Function : list_directory Purpose : method to get all the contexts contained in the current directory Get only objects, isn't iterative If the NamingService is out, the exception ServiceUnreachable is thrown

vector< string > SALOME_NamingService::list_directory_recurs  )  throw (ServiceUnreachable)
 

Function : list_directory_recurs Purpose : method to get all the contexts contained in the current directory Get only objects and is recursive If the NamingService is out, the exception ServiceUnreachable is thrown

void SALOME_NamingService::Destroy_Name const char *  Path  )  throw (ServiceUnreachable)
 

Function : Destroy_Name Purpose : method to destroy an association Path-Object Reference. WARNING : The complete Path should be given. If the NamingService is out, the exception ServiceUnreachable is thrown

Parameters:
Path const char* arguments

void SALOME_NamingService::Destroy_Directory const char *  Path  )  throw (ServiceUnreachable) [virtual]
 

Function : Destroy_Directory. Purpose : method to destroy a directory if it is empty. WARNING : The complete Path to the directory (from the root_context) to destroy should be given. If the NamingService is out, the exception ServiceUnreachable is thrown.

Parameters:
Path const char* arguments

char * SALOME_NamingService::getIORaddr  ) 
 

void SALOME_NamingService::_initialize_root_context  )  [protected]
 

Function : _initialize_root_context Purpose : method called by constructor to initialize _root_context

char * SALOME_NamingService::_resolve_Path char *  Path  )  [protected]
 

Function : _resolve_Path Purpose : method to decompose a Path : /Kernel/Services/Sessions.

Returns:
a char* containing the first char between '/' (in this case Kernel)

void SALOME_NamingService::_result_resolve_Path const char *  Path,
int &  j,
char **  resultat_resolve_Path
[protected]
 

Function : _result_resolve_Path. Purpose : method to decompose a Path : /Kernel/Services/Sessions. Gives an array of char* containing Kernel, Services, Sessions.

Parameters:
Path const char* arguments, the Path to decompose
j int& arguments, the size of the array of char*
resultat_resolve_Path char** arguments

void SALOME_NamingService::_Find const char *  name,
CORBA::Long &  occurence_number
[protected]
 

Function : _Find. Purpose : method to research a name from the current directory of the naming service. The naming service changes directory to go to the directory where the last occurence was found.

Parameters:
name const char* arguments
occurence_number CORBA::LONG (by value)

void SALOME_NamingService::_create_context_name_dir char **  resultat_resolve_Path,
int  length_copy,
CosNaming::Name &  _context_name
[protected]
 

Function : _create_context_name_dir. Purpose : method to create a Context_name from an array of char. The number of elements to be copied are indicated with lenth_copy.

Parameters:
resultat_resolve_Path char** arguments
length_copy int arguments
_context_name CosNaming::Name arguments (by value)

void SALOME_NamingService::_current_directory char **  result_path,
int &  length_result,
CosNaming::NamingContext_var  context_to_found,
CORBA::Boolean &  _continue
[protected]
 

Function : _current_directory. Purpose : method to parse the naming service tree to find a context and determine the path to go to this context from the _root_context.

Parameters:
result_path char** arguments
length_result int arguments by value
context_to_found CosNaming::NamingContext_var arguments
_continue boolean arguments

void SALOME_NamingService::_list_directory_recurs std::vector< std::string > &  myList,
const char *  relativeSubDir,
const char *  absCurDirectory
[protected]
 

Function :_list_directory_recurs. Purpose : method to list recursively all the objects contained in the tree of absCurDirectory/relativeSubDir.

Parameters:
myList The list that will be filled.
relativeSubDir The directory from absCurDirectory in which the objects are found.
absCurDirectory The directory in ABSOLUTE form. _current_context must refer to absCurDirectory.


Field Documentation

CORBA::ORB_ptr SALOME_NamingService._orb [protected]
 

CosNaming::NamingContext_var SALOME_NamingService._root_context [protected]
 

CosNaming::NamingContext_var SALOME_NamingService._current_context [protected]
 


Generated on Tue Feb 7 22:07:38 2006 for SALOME v.2.2.8 by doxygen 1.3.7