-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// SALOME ModuleCatalog : implementation of ModuleCatalog server which parsers xml description of modules
// File : SALOME_ModuleCatalog_Acomponent_impl.cxx
// Author : Estelle Deville
// SALOME ModuleCatalog : implementation of ModuleCatalog server which parsers xml description of modules
// File : SALOME_ModuleCatalog_Acomponent_impl.cxx
// Author : Estelle Deville
//----------------------------------------------------------------------
// Function : SALOME_ModuleCatalog_AcomponentImpl
// Purpose : Constructor
//----------------------------------------------------------------------
// Function : SALOME_ModuleCatalog_AcomponentImpl
// Purpose : Constructor
-// Affect the component name, type,icone, a bool to define
-// if it's multistudy or not.
+// Affect the component name, type,icon
//----------------------------------------------------------------------
SALOME_ModuleCatalog_AcomponentImpl::SALOME_ModuleCatalog_AcomponentImpl
(SALOME_ModuleCatalog::ComponentDef &C) : _Component(C)
//----------------------------------------------------------------------
SALOME_ModuleCatalog_AcomponentImpl::SALOME_ModuleCatalog_AcomponentImpl
(SALOME_ModuleCatalog::ComponentDef &C) : _Component(C)
{
_list[ind] = CORBA::string_dup(_Component.interfaces[ind].interfacename);
if(MYDEBUG) MESSAGE("The component " << _Component.name
{
_list[ind] = CORBA::string_dup(_Component.interfaces[ind].interfacename);
if(MYDEBUG) MESSAGE("The component " << _Component.name
//----------------------------------------------------------------------
SALOME_ModuleCatalog::DefinitionInterface*
SALOME_ModuleCatalog_AcomponentImpl::GetInterface(const char* interfacename)
//----------------------------------------------------------------------
SALOME_ModuleCatalog::DefinitionInterface*
SALOME_ModuleCatalog_AcomponentImpl::GetInterface(const char* interfacename)
{
if(MYDEBUG) BEGIN_OF("GetInterface");
if(MYDEBUG) SCRUTE(interfacename);
SALOME_ModuleCatalog::DefinitionInterface *_interface =
{
if(MYDEBUG) BEGIN_OF("GetInterface");
if(MYDEBUG) SCRUTE(interfacename);
SALOME_ModuleCatalog::DefinitionInterface *_interface =
for (unsigned int ind = 0; ind < _Component.interfaces.length(); ind++)
{
SALOME_ModuleCatalog::DefinitionInterface &I
for (unsigned int ind = 0; ind < _Component.interfaces.length(); ind++)
{
SALOME_ModuleCatalog::DefinitionInterface &I
}
if(MYDEBUG) SCRUTE(_find);
if (!_find)
{
// The interface was not found, the exception should be thrown
}
if(MYDEBUG) SCRUTE(_find);
if (!_find)
{
// The interface was not found, the exception should be thrown
message += interfacename;
message += " of the component ";
message += _Component.name;
message += interfacename;
message += " of the component ";
message += _Component.name;
//----------------------------------------------------------------------
SALOME_ModuleCatalog::ListOfServices*
SALOME_ModuleCatalog_AcomponentImpl::GetServiceList(const char* interfacename)
//----------------------------------------------------------------------
SALOME_ModuleCatalog::ListOfServices*
SALOME_ModuleCatalog_AcomponentImpl::GetServiceList(const char* interfacename)
SALOME_ModuleCatalog::DefinitionInterface & I = _Component.interfaces[ind];
if (strcmp(interfacename, I.interfacename) == 0)
SALOME_ModuleCatalog::DefinitionInterface & I = _Component.interfaces[ind];
if (strcmp(interfacename, I.interfacename) == 0)
- {
- _find = true ;
- // wanted interface
- // Get the list of services name for this interface
- unsigned int _length_services = I.interfaceservicelist.length();
- _list->length(_length_services);
- for (unsigned int ind1 = 0; ind1 < _length_services ; ind1++)
- {
- _list[ind1] = CORBA::string_dup(I.interfaceservicelist[ind1].ServiceName);
- if(MYDEBUG) MESSAGE("The interface " << interfacename << " of the component "
- << _Component.name << " contains " << _list[ind1] << " as a service")
- }
- }
+ {
+ _find = true ;
+ // wanted interface
+ // Get the list of services name for this interface
+ unsigned int _length_services = I.interfaceservicelist.length();
+ _list->length(_length_services);
+ for (unsigned int ind1 = 0; ind1 < _length_services ; ind1++)
+ {
+ _list[ind1] = CORBA::string_dup(I.interfaceservicelist[ind1].ServiceName);
+ if(MYDEBUG) MESSAGE("The interface " << interfacename << " of the component "
+ << _Component.name << " contains " << _list[ind1] << " as a service")
+ }
+ }
message += interfacename;
message += " of the component ";
message += _Component.name;
message += interfacename;
message += " of the component ";
message += _Component.name;
//----------------------------------------------------------------------
SALOME_ModuleCatalog::Service*
SALOME_ModuleCatalog_AcomponentImpl::GetService(const char* interfacename,
//----------------------------------------------------------------------
SALOME_ModuleCatalog::Service*
SALOME_ModuleCatalog_AcomponentImpl::GetService(const char* interfacename,
SALOME_ModuleCatalog::DefinitionInterface &I = _Component.interfaces[ind];
if (strcmp(interfacename, I.interfacename) == 0)
SALOME_ModuleCatalog::DefinitionInterface &I = _Component.interfaces[ind];
if (strcmp(interfacename, I.interfacename) == 0)
- {
- // wanted interface
- // looking for the specified service
- for (unsigned int ind1 = 0; ind1 < I.interfaceservicelist.length() ; ind1++)
- {
- SALOME_ModuleCatalog::Service &S = I.interfaceservicelist[ind1];
- if(MYDEBUG) SCRUTE(ind1);
- if(MYDEBUG) SCRUTE(S.ServiceName);
-
- if (strcmp(servicename, S.ServiceName) == 0)
- {
- // Wanted Service
- // Affect the service to be returned
- _find = true ;
- duplicate(*service, S);
- }
- }
-
- }
+ {
+ // wanted interface
+ // looking for the specified service
+ for (unsigned int ind1 = 0; ind1 < I.interfaceservicelist.length() ; ind1++)
+ {
+ SALOME_ModuleCatalog::Service &S = I.interfaceservicelist[ind1];
+ if(MYDEBUG) SCRUTE(ind1);
+ if(MYDEBUG) SCRUTE(S.ServiceName);
+
+ if (strcmp(servicename, S.ServiceName) == 0)
+ {
+ // Wanted Service
+ // Affect the service to be returned
+ _find = true ;
+ duplicate(*service, S);
+ }
+ }
+
+ }
}
if(MYDEBUG) SCRUTE(_find);
if (!_find)
{
// The interface was not found, the exception should be thrown
}
if(MYDEBUG) SCRUTE(_find);
if (!_find)
{
// The interface was not found, the exception should be thrown
//----------------------------------------------------------------------
SALOME_ModuleCatalog::Service*
SALOME_ModuleCatalog_AcomponentImpl::GetDefaultService(const char* interfacename)
//----------------------------------------------------------------------
SALOME_ModuleCatalog::Service*
SALOME_ModuleCatalog_AcomponentImpl::GetDefaultService(const char* interfacename)
for (unsigned int ind = 0; ind < _Component.interfaces.length(); ind++)
{
if (strcmp(interfacename, _Component.interfaces[ind].interfacename) == 0)
for (unsigned int ind = 0; ind < _Component.interfaces.length(); ind++)
{
if (strcmp(interfacename, _Component.interfaces[ind].interfacename) == 0)
- {
- // wanted interface
- // looking for the defautl service of the wanted interface
- for (unsigned int ind1 = 0; ind1 < _Component.interfaces[ind].interfaceservicelist.length() ; ind1++)
- {
- if (_Component.interfaces[ind].interfaceservicelist[ind1].Servicebydefault)
- {
- // Default Service
- // affect the service to be returned
- _find = true ;
- duplicate(*_service, _Component.interfaces[ind].interfaceservicelist[ind1]);
- }
- }
-
- }
+ {
+ // wanted interface
+ // looking for the default service of the wanted interface
+ for (unsigned int ind1 = 0; ind1 < _Component.interfaces[ind].interfaceservicelist.length() ; ind1++)
+ {
+ if (_Component.interfaces[ind].interfaceservicelist[ind1].Servicebydefault)
+ {
+ // Default Service
+ // affect the service to be returned
+ _find = true ;
+ duplicate(*_service, _Component.interfaces[ind].interfaceservicelist[ind1]);
+ }
+ }
+
+ }
message += interfacename;
message += " of the component ";
message += _Component.name;
message += interfacename;
message += " of the component ";
message += _Component.name;
//----------------------------------------------------------------------
char*
SALOME_ModuleCatalog_AcomponentImpl::GetPathPrefix(const char* machinename)
//----------------------------------------------------------------------
char*
SALOME_ModuleCatalog_AcomponentImpl::GetPathPrefix(const char* machinename)
for (unsigned int ind = 0 ; ind < _Component.paths.length() ; ind++)
{
if (strcmp(machinename, _Component.paths[ind].machine) == 0)
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);
- }
+ {
+ _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);
+ }
}
if(MYDEBUG) SCRUTE(_find);
if (!_find)
{
// The computer was not found, the exception should be thrown
}
if(MYDEBUG) SCRUTE(_find);
if (!_find)
{
// The computer was not found, the exception should be thrown
-//----------------------------------------------------------------------
-// Function : multistudy
-// Purpose : define if a component can be multistudy or not
-//----------------------------------------------------------------------
-CORBA::Boolean SALOME_ModuleCatalog_AcomponentImpl::multistudy()
-{
- return _Component.multistudy ;
-}
-
-
//----------------------------------------------------------------------
// Function : implementation type
// Purpose : return the implementation type : C++ (dyn lib), Python (module) or executable
//----------------------------------------------------------------------
// Function : implementation type
// Purpose : return the implementation type : C++ (dyn lib), Python (module) or executable
for (unsigned int ind2 = 0; ind2 < _length ; ind2 ++)
duplicate(S_out.ServiceinParameter[ind2],
for (unsigned int ind2 = 0; ind2 < _length ; ind2 ++)
duplicate(S_out.ServiceinParameter[ind2],
for (unsigned int ind2 = 0; ind2 < _length ; ind2 ++)
duplicate(S_out.ServiceoutParameter[ind2],
for (unsigned int ind2 = 0; ind2 < _length ; ind2 ++)
duplicate(S_out.ServiceoutParameter[ind2],
for (unsigned int ind2 = 0; ind2 < _length ; ind2 ++)
duplicate(S_out.ServiceinDataStreamParameter[ind2],
for (unsigned int ind2 = 0; ind2 < _length ; ind2 ++)
duplicate(S_out.ServiceinDataStreamParameter[ind2],
for (unsigned int ind2 = 0; ind2 < _length ; ind2 ++)
duplicate(S_out.ServiceoutDataStreamParameter[ind2],
for (unsigned int ind2 = 0; ind2 < _length ; ind2 ++)
duplicate(S_out.ServiceoutDataStreamParameter[ind2],
for (unsigned int ind1 = 0; ind1 < _length ; ind1 ++)
duplicate(I_out.interfaceservicelist[ind1],
for (unsigned int ind1 = 0; ind1 < _length ; ind1 ++)
duplicate(I_out.interfaceservicelist[ind1],