From 7692c3cebe06334ae01c09a07d32c9eff3743911 Mon Sep 17 00:00:00 2001 From: secher Date: Fri, 27 May 2005 11:13:08 +0000 Subject: [PATCH] improvement for NP component --- resources/CatalogResources.xml | 8 ++++---- src/Container/Component_i.cxx | 6 +++++- src/Container/SALOME_Component_i.hxx | 2 ++ src/Container/SALOME_Container_i.hxx | 3 +++ src/ResourcesManager/SALOME_ResourcesManager.cxx | 12 +++++++----- 5 files changed, 21 insertions(+), 10 deletions(-) diff --git a/resources/CatalogResources.xml b/resources/CatalogResources.xml index 985ea9858..445cb9d55 100644 --- a/resources/CatalogResources.xml +++ b/resources/CatalogResources.xml @@ -2,17 +2,17 @@ - + - + - + - + diff --git a/src/Container/Component_i.cxx b/src/Container/Component_i.cxx index 7bde5d8fc..68c235cea 100644 --- a/src/Container/Component_i.cxx +++ b/src/Container/Component_i.cxx @@ -125,11 +125,15 @@ void Engines_Component_i::destroy() Engines::Container_ptr Engines_Component_i::GetContainerRef() { - MESSAGE("Engines_Component_i::GetContainerRef"); CORBA::Object_ptr o = _poa->id_to_reference(*_contId) ; return Engines::Container::_narrow(o); } +Engines_Container_i *Engines_Component_i::GetContainerPtr() +{ + return dynamic_cast(_poa->id_to_servant(*_contId)) ; +} + PortableServer::ObjectId * Engines_Component_i::getId() { // MESSAGE("PortableServer::ObjectId * Engines_Component_i::getId()"); diff --git a/src/Container/SALOME_Component_i.hxx b/src/Container/SALOME_Component_i.hxx index 65e0ae77d..d639bf6aa 100644 --- a/src/Container/SALOME_Component_i.hxx +++ b/src/Container/SALOME_Component_i.hxx @@ -41,6 +41,7 @@ #include "NOTIFICATION.hxx" class RegistryConnexion; +class Engines_Container_i; class Engines_Component_i: public virtual POA_Engines::Component, public virtual PortableServer::RefCountServantBase @@ -71,6 +72,7 @@ public: void ping(); Engines::Container_ptr GetContainerRef(); + Engines_Container_i *GetContainerPtr(); PortableServer::ObjectId * getId(); void setProperties(const Engines::FieldsDict& dico); diff --git a/src/Container/SALOME_Container_i.hxx b/src/Container/SALOME_Container_i.hxx index c9272b5bb..0bae4db32 100644 --- a/src/Container/SALOME_Container_i.hxx +++ b/src/Container/SALOME_Container_i.hxx @@ -79,6 +79,9 @@ public: CORBA::Long getPID(); static bool isPythonContainer(const char* ContainerName); + int getArgc() { return _argc; } + char **getArgv() { return _argv; } + protected: SALOME_NamingService *_NS ; diff --git a/src/ResourcesManager/SALOME_ResourcesManager.cxx b/src/ResourcesManager/SALOME_ResourcesManager.cxx index 89c34e8d0..545c3dd1e 100644 --- a/src/ResourcesManager/SALOME_ResourcesManager.cxx +++ b/src/ResourcesManager/SALOME_ResourcesManager.cxx @@ -362,21 +362,23 @@ void SALOME_ResourcesManager::SelectOnlyResourcesWithOS(vector& hosts,co { string base(OS); for(map::const_iterator iter=_resourcesList.begin();iter!=_resourcesList.end();iter++) + { if((*iter).second.OS==base) - hosts.push_back((*iter).first); + hosts.push_back((*iter).first); + } } //Warning need an updated parsed list : _resourcesList void SALOME_ResourcesManager::KeepOnlyResourcesWithModule(vector& hosts,const char *moduleName) const throw(SALOME_Exception) { - for(vector::iterator iter=hosts.begin();iter!=hosts.end();iter++) + for(vector::iterator iter=hosts.begin();iter!=hosts.end();) { MapOfParserResourcesType::const_iterator it=_resourcesList.find(*iter); const map& mapOfModulesOfCurrentHost=(((*it).second).ModulesPath); if(mapOfModulesOfCurrentHost.find(moduleName)==mapOfModulesOfCurrentHost.end()) - { - hosts.erase(iter); - } + hosts.erase(iter); + else + iter++; } } -- 2.39.2