Back to index

salome-kernel  6.5.0
Defines | Typedefs | Functions | Variables
SALOMEDSClient_ClientFactory.cxx File Reference
#include "SALOMEDSClient_ClientFactory.hxx"
#include <dlfcn.h>

Go to the source code of this file.

Defines

#define SALOMEDS_LIB_NAME   "libSalomeDS.so"
#define SOBJECT_FACTORY   "SObjectFactory"
#define SCOMPONENT_FACTORY   "SComponentFactory"
#define STUDY_FACTORY   "StudyFactory"
#define BUILDER_FACTORY   "BuilderFactory"
#define STUDYMANAGER_FACTORY   "StudyManagerFactory"
#define STUDYMANAGER_CREATE   "CreateStudyManager"
#define GET_PARAMETERS   "GetIParameters"
#define CONVERT_SOBJECT   "ConvertSObject"
#define CONVERT_STUDY   "ConvertStudy"
#define CONVERT_BUILDER   "ConvertBuilder"

Typedefs

typedef SALOMEDSClient_SObject *(* SOBJECT_FACTORY_FUNCTION )(SALOMEDS::SObject_ptr)
typedef
SALOMEDSClient_SComponent *(* 
SCOMPONENT_FACTORY_FUNCTION )(SALOMEDS::SComponent_ptr)
typedef SALOMEDSClient_Study *(* STUDY_FACTORY_FUNCTION )(SALOMEDS::Study_ptr)
typedef
SALOMEDSClient_StudyManager *(* 
STUDYMANAGER_FACTORY_FUNCTION )()
typedef
SALOMEDSClient_StudyBuilder *(* 
BUILDER_FACTORY_FUNCTION )(SALOMEDS::StudyBuilder_ptr)
typedef
SALOMEDSClient_StudyManager *(* 
STUDYMANAGER_CREATE_FUNCTION )(CORBA::ORB_ptr, PortableServer::POA_ptr)
typedef
SALOMEDSClient_IParameters *(* 
GET_PARAMETERS_FACTORY )(const _PTR(AttributeParameter)&)
typedef SALOMEDS::SObject_ptr(* CONVERT_SOBJECT_FUNCTION )(const _PTR(SObject)&)
typedef SALOMEDS::Study_ptr(* CONVERT_STUDY_FUNCTION )(const _PTR(Study)&)
typedef
SALOMEDS::StudyBuilder_ptr(* 
CONVERT_BUILDER_FUNCTION )(const _PTR(StudyBuilder)&)

Functions

 _PTR (SObject) ClientFactory
 _PTR (SComponent) ClientFactory
 _PTR (Study) ClientFactory
 _PTR (StudyBuilder) ClientFactory
 _PTR (StudyManager) ClientFactory
 _PTR (IParameters) ClientFactory

Variables

static void * _libHandle = NULL
static SOBJECT_FACTORY_FUNCTION aSObjectFactory = NULL
static SCOMPONENT_FACTORY_FUNCTION aSComponentFactory = NULL
static STUDY_FACTORY_FUNCTION aStudyFactory = NULL
static BUILDER_FACTORY_FUNCTION aBuilderFactory = NULL
static
STUDYMANAGER_FACTORY_FUNCTION 
aManagerFactory = NULL
static STUDYMANAGER_CREATE_FUNCTION aCreateFactory = NULL
static GET_PARAMETERS_FACTORY aGetIParameters = NULL
static CONVERT_SOBJECT_FUNCTION aConvertSObject = NULL
static CONVERT_STUDY_FUNCTION aConvertStudy = NULL
static CONVERT_BUILDER_FUNCTION aConvertBuilder = NULL

Define Documentation

#define BUILDER_FACTORY   "BuilderFactory"

Definition at line 38 of file SALOMEDSClient_ClientFactory.cxx.

#define CONVERT_BUILDER   "ConvertBuilder"

Definition at line 44 of file SALOMEDSClient_ClientFactory.cxx.

#define CONVERT_SOBJECT   "ConvertSObject"

Definition at line 42 of file SALOMEDSClient_ClientFactory.cxx.

#define CONVERT_STUDY   "ConvertStudy"

Definition at line 43 of file SALOMEDSClient_ClientFactory.cxx.

#define GET_PARAMETERS   "GetIParameters"

Definition at line 41 of file SALOMEDSClient_ClientFactory.cxx.

#define SALOMEDS_LIB_NAME   "libSalomeDS.so"

Definition at line 32 of file SALOMEDSClient_ClientFactory.cxx.

#define SCOMPONENT_FACTORY   "SComponentFactory"

Definition at line 36 of file SALOMEDSClient_ClientFactory.cxx.

#define SOBJECT_FACTORY   "SObjectFactory"

Definition at line 35 of file SALOMEDSClient_ClientFactory.cxx.

#define STUDY_FACTORY   "StudyFactory"

Definition at line 37 of file SALOMEDSClient_ClientFactory.cxx.

#define STUDYMANAGER_CREATE   "CreateStudyManager"

Definition at line 40 of file SALOMEDSClient_ClientFactory.cxx.

#define STUDYMANAGER_FACTORY   "StudyManagerFactory"

Definition at line 39 of file SALOMEDSClient_ClientFactory.cxx.


Typedef Documentation

typedef SALOMEDSClient_StudyBuilder*(* BUILDER_FACTORY_FUNCTION)(SALOMEDS::StudyBuilder_ptr)

Definition at line 50 of file SALOMEDSClient_ClientFactory.cxx.

typedef SALOMEDS::StudyBuilder_ptr(* CONVERT_BUILDER_FUNCTION)(const _PTR(StudyBuilder)&)

Definition at line 55 of file SALOMEDSClient_ClientFactory.cxx.

typedef SALOMEDS::SObject_ptr(* CONVERT_SOBJECT_FUNCTION)(const _PTR(SObject)&)

Definition at line 53 of file SALOMEDSClient_ClientFactory.cxx.

typedef SALOMEDS::Study_ptr(* CONVERT_STUDY_FUNCTION)(const _PTR(Study)&)

Definition at line 54 of file SALOMEDSClient_ClientFactory.cxx.

typedef SALOMEDSClient_IParameters*(* GET_PARAMETERS_FACTORY)(const _PTR(AttributeParameter)&)

Definition at line 52 of file SALOMEDSClient_ClientFactory.cxx.

typedef SALOMEDSClient_SComponent*(* SCOMPONENT_FACTORY_FUNCTION)(SALOMEDS::SComponent_ptr)

Definition at line 47 of file SALOMEDSClient_ClientFactory.cxx.

typedef SALOMEDSClient_SObject*(* SOBJECT_FACTORY_FUNCTION)(SALOMEDS::SObject_ptr)

Definition at line 46 of file SALOMEDSClient_ClientFactory.cxx.

typedef SALOMEDSClient_Study*(* STUDY_FACTORY_FUNCTION)(SALOMEDS::Study_ptr)

Definition at line 48 of file SALOMEDSClient_ClientFactory.cxx.

typedef SALOMEDSClient_StudyManager*(* STUDYMANAGER_CREATE_FUNCTION)(CORBA::ORB_ptr, PortableServer::POA_ptr)

Definition at line 51 of file SALOMEDSClient_ClientFactory.cxx.

Definition at line 49 of file SALOMEDSClient_ClientFactory.cxx.


Function Documentation

_PTR ( SObject  )

Definition at line 69 of file SALOMEDSClient_ClientFactory.cxx.

{
  SALOMEDSClient_SObject* so = NULL;

#ifdef WIN32
  if(!_libHandle) _libHandle = ::LoadLibrary(SALOMEDS_LIB_NAME);
  if(!aSObjectFactory) aSObjectFactory = (SOBJECT_FACTORY_FUNCTION)::GetProcAddress(_libHandle, SOBJECT_FACTORY);
#else
  if(!_libHandle) _libHandle = dlopen(SALOMEDS_LIB_NAME, RTLD_LAZY | RTLD_GLOBAL);
  if(!aSObjectFactory) aSObjectFactory = (SOBJECT_FACTORY_FUNCTION) dlsym(_libHandle, SOBJECT_FACTORY);
#endif

  if(aSObjectFactory) so = aSObjectFactory(theSObject); 
  return _PTR(SObject)(so);
}
_PTR ( SComponent  )

Definition at line 85 of file SALOMEDSClient_ClientFactory.cxx.

{
  SALOMEDSClient_SComponent* sco = NULL; 

#ifdef WIN32
  if(!_libHandle) _libHandle = ::LoadLibrary(SALOMEDS_LIB_NAME);
  if(!aSComponentFactory) aSComponentFactory = (SCOMPONENT_FACTORY_FUNCTION)::GetProcAddress(_libHandle, SCOMPONENT_FACTORY);
#else
  if(!_libHandle) _libHandle = dlopen(SALOMEDS_LIB_NAME, RTLD_LAZY | RTLD_GLOBAL);
  if(!aSComponentFactory) aSComponentFactory = (SCOMPONENT_FACTORY_FUNCTION) dlsym(_libHandle, SCOMPONENT_FACTORY);
#endif

  if(aSComponentFactory) sco = aSComponentFactory(theSComponent); 
  return _PTR(SComponent)(sco);
}
_PTR ( Study  )

Definition at line 101 of file SALOMEDSClient_ClientFactory.cxx.

{
  SALOMEDSClient_Study* study = NULL;

#ifdef WIN32
  if(!_libHandle) _libHandle = ::LoadLibrary(SALOMEDS_LIB_NAME);
  if(!aStudyFactory) aStudyFactory = (STUDY_FACTORY_FUNCTION)::GetProcAddress(_libHandle, STUDY_FACTORY);
#else
  if(!_libHandle) _libHandle = dlopen(SALOMEDS_LIB_NAME, RTLD_LAZY | RTLD_GLOBAL);
  if(!aStudyFactory) aStudyFactory = (STUDY_FACTORY_FUNCTION) dlsym(_libHandle, STUDY_FACTORY);
#endif

  if(aStudyFactory) study = aStudyFactory(theStudy); 
  return _PTR(Study)(study);
}
_PTR ( StudyBuilder  )

Definition at line 117 of file SALOMEDSClient_ClientFactory.cxx.

{
  SALOMEDSClient_StudyBuilder* studyBuilder = NULL;

#ifdef WIN32
  if(!_libHandle) _libHandle = ::LoadLibrary(SALOMEDS_LIB_NAME);
  if(!aBuilderFactory) aBuilderFactory = (BUILDER_FACTORY_FUNCTION)::GetProcAddress(_libHandle, BUILDER_FACTORY);
#else
  if(!_libHandle) _libHandle = dlopen(SALOMEDS_LIB_NAME, RTLD_LAZY | RTLD_GLOBAL);
  if(!aBuilderFactory) aBuilderFactory = (BUILDER_FACTORY_FUNCTION) dlsym(_libHandle, BUILDER_FACTORY);
#endif

  if(aBuilderFactory) studyBuilder = aBuilderFactory(theStudyBuilder); 
  return _PTR(StudyBuilder)(studyBuilder);
}
_PTR ( StudyManager  )

Definition at line 133 of file SALOMEDSClient_ClientFactory.cxx.

{
  SALOMEDSClient_StudyManager* manager = NULL;

#ifdef WIN32
  if(!_libHandle) _libHandle = ::LoadLibrary(SALOMEDS_LIB_NAME);
  if(!aManagerFactory) aManagerFactory = (STUDYMANAGER_FACTORY_FUNCTION)::GetProcAddress(_libHandle, STUDYMANAGER_FACTORY);
#else
  if(!_libHandle) _libHandle = dlopen(SALOMEDS_LIB_NAME, RTLD_LAZY | RTLD_GLOBAL);
  if(!aManagerFactory) aManagerFactory = (STUDYMANAGER_FACTORY_FUNCTION) dlsym(_libHandle, STUDYMANAGER_FACTORY);
#endif

  if(aManagerFactory) manager = aManagerFactory(); 
  return _PTR(StudyManager)(manager);
}
_PTR ( IParameters  )

Definition at line 165 of file SALOMEDSClient_ClientFactory.cxx.

{
  SALOMEDSClient_IParameters* interface = NULL;

#ifdef WIN32
  if(!_libHandle) _libHandle = ::LoadLibrary(SALOMEDS_LIB_NAME);
  if(!aGetIParameters) aGetIParameters = (GET_PARAMETERS_FACTORY)::GetProcAddress(_libHandle, GET_PARAMETERS);
#else
  if(!_libHandle) _libHandle = dlopen(SALOMEDS_LIB_NAME, RTLD_LAZY | RTLD_GLOBAL);
  if(!aGetIParameters) aGetIParameters = (GET_PARAMETERS_FACTORY) dlsym(_libHandle, GET_PARAMETERS);
#endif

  if(aGetIParameters) interface = aGetIParameters(ap); 
  return _PTR(IParameters)(interface);
}

Variable Documentation

void* _libHandle = NULL [static]

Definition at line 31 of file SALOMEDSClient_ClientFactory.cxx.

Definition at line 61 of file SALOMEDSClient_ClientFactory.cxx.

Definition at line 67 of file SALOMEDSClient_ClientFactory.cxx.

Definition at line 65 of file SALOMEDSClient_ClientFactory.cxx.

Definition at line 66 of file SALOMEDSClient_ClientFactory.cxx.

Definition at line 63 of file SALOMEDSClient_ClientFactory.cxx.

Definition at line 64 of file SALOMEDSClient_ClientFactory.cxx.

Definition at line 62 of file SALOMEDSClient_ClientFactory.cxx.

Definition at line 59 of file SALOMEDSClient_ClientFactory.cxx.

Definition at line 58 of file SALOMEDSClient_ClientFactory.cxx.

Definition at line 60 of file SALOMEDSClient_ClientFactory.cxx.