BEGIN_OF("GetPathPrefix");
SCRUTE(machinename);
-// // Variables initialisation
-// char* _path = NULL;
-// bool _find = false ;
-
-// // Parse all the path prefixes
-// // looking for the wanted computer
-// for (unsigned int ind = 0 ; ind < _Component.PathPrefixes.size() ; ind++)
-// {
-// for (unsigned int ind1 = 0 ; ind1 < _pathes[ind].listOfComputer.size() ; ind1++)
-// {
-// if (strcmp(machinename, _pathes[ind].listOfComputer[ind1].c_str()) == 0)
-// {
-// _find = true ;
-// // Wanted computer
-// // affect the path to be returned
-// const char* _temp = _pathes[ind].path.c_str() ;
-// _path = new char[strlen(_temp)+1];
-// strcpy(_path,_temp);
-// }
-// }
-// }
+ // Variables initialisation
+ char* _path = NULL;
+ bool _find = false ;
-// if (!_find)
-// {
-// // The computer was not found, the exception should be thrown
-// string message = "The computer ";
-// message += machinename;
-// message += " was not found in the catalog associated to the component ";
-// message += _Component.name;
-// MESSAGE(message)
-// throw SALOME_ModuleCatalog::NotFound(message.c_str());
-// }
+ // Parse all the path prefixes
+ // looking for the wanted computer
+ for (unsigned int ind = 0 ; ind < _Component.paths.length() ; ind++)
+ {
+ if (strcmp(machinename, _Component.paths[ind].machine) == 0)
+ {
+ _find = true ;
+ // Wanted computer
+ // affect the path to be returned
+ const char* _temp = _Component.paths[ind].path ;
+ _path = new char[strlen(_temp)+1];
+ strcpy(_path,_temp);
+ }
+ }
+
+ SCRUTE(_find);
+ if (!_find)
+ {
+ // The computer was not found, the exception should be thrown
+ string message = "The computer ";
+ message += machinename;
+ message += " was not found in the catalog associated to the component ";
+ message += _Component.name;
+ MESSAGE(message)
+ throw SALOME_ModuleCatalog::NotFound(message.c_str());
+ }
END_OF("GetPathPrefix");
- return NULL;
+ return _path;
}
//----------------------------------------------------------------------
duplicate(I_out.interfaceservicelist[ind1],
I_in.interfaceservicelist[ind1]);
}
+
+
// Active catalog
- SALOME_ModuleCatalogImpl* Catalogue_i = new SALOME_ModuleCatalogImpl(argc, argv);
- poa->activate_object (Catalogue_i);
+ SALOME_ModuleCatalogImpl Catalogue_i(argc, argv, orb);
+ poa->activate_object (&Catalogue_i);
mgr->activate();
- CORBA::Object_ptr myCata = Catalogue_i->_this();
+ CORBA::Object_ptr myCata = Catalogue_i._this();
// initialise Naming Service
SALOME_NamingService *_NS;
#endif
orb->run();
+ mgr->deactivate(true,true);
poa->destroy(1,1);
-
+
}
catch(CORBA::SystemException&) {
INFOS("Caught CORBA::SystemException.")
{
public:
//! standard constructor
- SALOME_ModuleCatalogImpl(int artgc, char** argv);
+ SALOME_ModuleCatalogImpl(int artgc, char** argv, CORBA::ORB_ptr & orb);
//! standard destructor
virtual ~SALOME_ModuleCatalogImpl();
void ping(){};
+ void shutdown() { _orb->shutdown(1); };
+
private:
//! method to parse one module catalog
/*!
std::map <ParserComponentType, SALOME_ModuleCatalog::ComponentType>
ComponentTypeConvert;
+
+ CORBA::ORB_ptr _orb;
};
#endif // MODULECATALOG_IMPL_H