#include "SALOMEDSClient.hxx"
#include "SALOMEDSClient_IParameters.hxx"
#include "SALOMEDS_IParameters.hxx"
+#include "SALOME_Fake_NamingService.hxx"
#include "SALOMEDS_Defines.hxx"
return new SALOMEDS_StudyBuilder(theBuilder);
}
- SALOMEDS_EXPORT
- void CreateStudy(CORBA::ORB_ptr orb, PortableServer::POA_ptr root_poa)
+ void CreateStudyNSAbstract(CORBA::ORB_ptr orb, PortableServer::POA_ptr root_poa, SALOME_NamingService_Abstract& namingService)
{
- SALOME_NamingService namingService(orb);
CORBA::Object_var obj = namingService.Resolve( "/Study" );
SALOMEDS::Study_var aStudy = SALOMEDS::Study::_narrow( obj );
if( CORBA::is_nil(aStudy) ) {
}
}
+ SALOMEDS_EXPORT
+ void CreateStudy(CORBA::ORB_ptr orb, PortableServer::POA_ptr root_poa)
+ {
+ SALOME_NamingService namingService(orb);
+ CreateStudyNSAbstract(orb,root_poa,namingService);
+ }
+
+ SALOMEDS_EXPORT
+ void CreateStudyWithoutNS(CORBA::ORB_ptr orb, PortableServer::POA_ptr root_poa)
+ {
+ SALOME_Fake_NamingService namingService(orb);
+ CreateStudyNSAbstract(orb,root_poa,namingService);
+ }
+
SALOMEDS_EXPORT
SALOMEDSClient_IParameters* GetIParameters(const _PTR(AttributeParameter)& ap)
{
#endif
#endif
-#define SOBJECT_FACTORY "SObjectFactory"
-#define SCOMPONENT_FACTORY "SComponentFactory"
-#define STUDY_FACTORY "StudyFactory"
-#define STUDY_CREATE "CreateStudy"
-#define BUILDER_FACTORY "BuilderFactory"
-#define GET_PARAMETERS "GetIParameters"
-#define CONVERT_SOBJECT "ConvertSObject"
-#define CONVERT_BUILDER "ConvertBuilder"
+#define SOBJECT_FACTORY "SObjectFactory"
+#define SCOMPONENT_FACTORY "SComponentFactory"
+#define STUDY_FACTORY "StudyFactory"
+#define STUDY_CREATE "CreateStudy"
+#define STUDY_CREATE_WITHOUT_NS "CreateStudyWithoutNS"
+#define BUILDER_FACTORY "BuilderFactory"
+#define GET_PARAMETERS "GetIParameters"
+#define CONVERT_SOBJECT "ConvertSObject"
+#define CONVERT_BUILDER "ConvertBuilder"
typedef SALOMEDSClient_SObject* (*SOBJECT_FACTORY_FUNCTION) (SALOMEDS::SObject_ptr);
typedef SALOMEDSClient_SComponent* (*SCOMPONENT_FACTORY_FUNCTION) (SALOMEDS::SComponent_ptr);
if(aCreateFactory) aCreateFactory(orb, poa);
}
+void ClientFactory::createStudyWithoutNS(CORBA::ORB_ptr orb, PortableServer::POA_ptr poa)
+{
+#ifdef WIN32
+ if(!_libHandle) _libHandle = ::LoadLibrary(SALOMEDS_LIB_NAME);
+ if(!aCreateFactory) aCreateFactory = (STUDY_CREATE_FUNCTION)::GetProcAddress(_libHandle, STUDY_CREATE_WITHOUT_NS);
+#else
+ if(!_libHandle) _libHandle = dlopen(SALOMEDS_LIB_NAME, RTLD_LAZY | RTLD_GLOBAL);
+ if(!aCreateFactory) aCreateFactory = (STUDY_CREATE_FUNCTION) dlsym(_libHandle, STUDY_CREATE_WITHOUT_NS);
+#endif
+
+ if(aCreateFactory) aCreateFactory(orb, poa);
+}
+
_PTR(StudyBuilder) ClientFactory::StudyBuilder(SALOMEDS::StudyBuilder_ptr theStudyBuilder)
{
SALOMEDSClient_StudyBuilder* studyBuilder = NULL;
* Creates and returns a client Study wrapper
*/
static void createStudy(CORBA::ORB_ptr orb, PortableServer::POA_ptr poa);
+
+ /*!
+ * Creates and returns a client Study wrapper without external NS process
+ */
+ static void createStudyWithoutNS(CORBA::ORB_ptr orb, PortableServer::POA_ptr poa);
/*!
* Returns a client StudyBuilder wrapper that corresponds %theStudy