Back to index

salome-kernel  6.5.0
Functions
KERNEL Namespace Reference

Functions

CORBA::ORB_ptr getORB ()
 This function returns a static reference to the orb.
SALOME_NamingServicegetNamingService ()
 This function returns a static reference to the SALOME naming service.
SALOME_LifeCycleCORBAgetLifeCycleCORBA ()
 This function returns a static reference to the SALOME life cycle CORBA.
SALOMEDS::StudyManager_ptr getStudyManager ()
 This returns a static reference to the SALOME study manager.
SALOME::Session_ptr getSalomeSession ()
 This returns a static reference to the SALOME session.
Engines::SalomeLauncher_ptr getSalomeLauncher ()
 This returns a static reference to the SALOME launcher.
Engines::ResourcesManager_ptr getResourcesManager ()
SALOMEDS::Study_ptr getStudyById (int aStudyId)
 This returns the study with the specified id if it's defined in the SALOME study manager.
int getStudyId (SALOMEDS::Study_ptr study)
CORBA::Object_ptr SObjectToObject (SALOMEDS::SObject_ptr theSObject)
 This function retrieve the CORBA object reference from the study object wrapping it.
CORBA::Object_ptr IORToObject (char *IOR)
 This function provides a CORBA pointer to a servant from its IOR given as a string of characters.
SALOME::SALOME_Exception createSalomeException (const char *text)
template<class TInterface >
TInterface::_var_type ObjectToInterface (CORBA::Object_ptr object)
 This template function provides you with the servant (CORBA object narrowed to its interface) corresponding to the specified CORBA object (naked CORBA pointer).
template<class TInterface >
TInterface::_var_type SObjectToInterface (SALOMEDS::SObject_ptr sobject)

Function Documentation

Definition at line 178 of file SALOME_KernelServices.cxx.

                                                                  {
    SALOME::ExceptionStruct es;
    es.type = SALOME::INTERNAL_ERROR;
    es.text = CORBA::string_dup(text);
    return SALOME::SALOME_Exception(es);
  }

This function returns a static reference to the SALOME life cycle CORBA.

Definition at line 53 of file SALOME_KernelServices.cxx.

                                              {
    static SALOME_LifeCycleCORBA * lifeCycleCORBA;
    if ( lifeCycleCORBA == NULL ) {
      SALOME_NamingService *aNamingService = getNamingService();
      lifeCycleCORBA = new SALOME_LifeCycleCORBA(aNamingService);
    }
    return lifeCycleCORBA;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

This function returns a static reference to the SALOME naming service.

Definition at line 42 of file SALOME_KernelServices.cxx.

                                            {
    static SALOME_NamingService * namingService;
    if ( namingService == NULL ) {
      namingService = new SALOME_NamingService(getORB());
    }
    return namingService;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

This function returns a static reference to the orb.

The orb can be used for example to initialize CORBA variables or to serialize and unserialize the CORBA objet to/from an IOR string.

Definition at line 30 of file SALOME_KernelServices.cxx.

                        {
    static CORBA::ORB_ptr orb;
    if(CORBA::is_nil(orb)){
      int argc=0;
      orb = CORBA::ORB_init(argc,0);
    }
    return orb;
  }

Here is the caller graph for this function:

KERNELHELPERS_EXPORT Engines::ResourcesManager_ptr KERNEL::getResourcesManager ( )

Definition at line 110 of file SALOME_KernelServices.cxx.

                                                    {
    static Engines::ResourcesManager_ptr resourcesManager;
    if(CORBA::is_nil(resourcesManager)){
      SALOME_NamingService *aNamingService = getNamingService();
      CORBA::Object_ptr obj = aNamingService->Resolve("/ResourcesManager");
      resourcesManager = Engines::ResourcesManager::_narrow(obj);
    }
    return resourcesManager;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

KERNELHELPERS_EXPORT Engines::SalomeLauncher_ptr KERNEL::getSalomeLauncher ( )

This returns a static reference to the SALOME launcher.

The SALOME launcher can be used to schedule jobs, local or remote, using a batch system or not (see SALOME documentation).

Definition at line 98 of file SALOME_KernelServices.cxx.

                                                {
    //LOG("KERNEL_services::getSalomeLauncher()");
    static Engines::SalomeLauncher_ptr salomeLauncher;
    if(CORBA::is_nil(salomeLauncher)){
      //LOG("KERNEL_services::getSalomeLauncher(): creating the static instance");
      SALOME_NamingService *aNamingService = getNamingService();
      CORBA::Object_ptr obj = aNamingService->Resolve("/SalomeLauncher");
      salomeLauncher = Engines::SalomeLauncher::_narrow(obj);
    }
    return salomeLauncher;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

This returns a static reference to the SALOME session.

The SALOME session can be used to retrieve some objects of the current session, as the SALOME study.

Definition at line 83 of file SALOME_KernelServices.cxx.

                                       {
    static SALOME::Session_ptr salomeSession;
    if(CORBA::is_nil(salomeSession)){
      SALOME_NamingService *aNamingService = getNamingService();
      CORBA::Object_ptr obj = aNamingService->Resolve("/Kernel/Session");
      salomeSession = SALOME::Session::_narrow(obj);
    }
    return salomeSession;
  }

Here is the call graph for this function:

KERNELHELPERS_EXPORT SALOMEDS::Study_ptr KERNEL::getStudyById ( int  aStudyId)

This returns the study with the specified id if it's defined in the SALOME study manager.

Returns null otherwise. Please not that it is just a shortcut, and you may prefer use directly the study manager: KERNEL::getStudyManager()->GetStudyByID(aStudyId)

Definition at line 127 of file SALOME_KernelServices.cxx.

                                               {
    if ( aStudyId < 0 ) {
      INFOS("ERR: trying to get a study with ID<0");
      return SALOMEDS::Study::_nil();
    }
    return getStudyManager()->GetStudyByID(aStudyId);
  }

Here is the call graph for this function:

KERNELHELPERS_EXPORT int KERNEL::getStudyId ( SALOMEDS::Study_ptr  study)

Definition at line 135 of file SALOME_KernelServices.cxx.

                                          {
    if( CORBA::is_nil(study) ) return -1;
    return study->StudyId();
  }
KERNELHELPERS_EXPORT SALOMEDS::StudyManager_ptr KERNEL::getStudyManager ( )

This returns a static reference to the SALOME study manager.

The study manager can be used to retrieve a study or to get informations about a study.

Definition at line 68 of file SALOME_KernelServices.cxx.

                                             {
    static SALOMEDS::StudyManager_ptr aStudyManager;
    if(CORBA::is_nil(aStudyManager)){
      SALOME_NamingService *aNamingService = getNamingService();
      CORBA::Object_ptr anObject = aNamingService->Resolve("/myStudyManager");
      aStudyManager = SALOMEDS::StudyManager::_narrow(anObject);
    }
    return aStudyManager;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

KERNELHELPERS_EXPORT CORBA::Object_ptr KERNEL::IORToObject ( char *  IOR)

This function provides a CORBA pointer to a servant from its IOR given as a string of characters.

Definition at line 169 of file SALOME_KernelServices.cxx.

                                          {
    return getORB()->string_to_object(IOR);
  }

Here is the call graph for this function:

template<class TInterface >
TInterface::_var_type KERNEL::ObjectToInterface ( CORBA::Object_ptr  object)

This template function provides you with the servant (CORBA object narrowed to its interface) corresponding to the specified CORBA object (naked CORBA pointer).

Definition at line 65 of file SALOME_KernelServices.hxx.

                                            {
    if(!CORBA::is_nil(object))
      return TInterface::_narrow(object);
    return TInterface::_nil();
  }
template<class TInterface >
TInterface::_var_type KERNEL::SObjectToInterface ( SALOMEDS::SObject_ptr  sobject)

Definition at line 72 of file SALOME_KernelServices.hxx.

                                                  {
    CORBA::Object_ptr object = SObjectToObject(sobject);
    return ObjectToInterface<TInterface>(object);
  }

Here is the call graph for this function:

KERNELHELPERS_EXPORT CORBA::Object_ptr KERNEL::SObjectToObject ( SALOMEDS::SObject_ptr  theSObject)

This function retrieve the CORBA object reference from the study object wrapping it.

Definition at line 145 of file SALOME_KernelServices.cxx.

                                                                  {

    SALOMEDS::GenericAttribute_var anAttr;
    CORBA::Object_var anObject;
    if(CORBA::is_nil(theSObject))
      return anObject;
    try{
      if(theSObject->FindAttribute(anAttr, "AttributeIOR")){
       SALOMEDS::AttributeIOR_var anIOR  = SALOMEDS::AttributeIOR::_narrow(anAttr);
       CORBA::String_var aValue = anIOR->Value();
       CORBA::ORB_ptr anORB = getORB();
       if(strcmp(aValue,"") != 0)
         anObject = anORB->string_to_object(aValue);
      }
    }catch(...){
      INFOS("SObjectToObject - Unknown exception was occured!!!");
    }
    return anObject._retn();
  }

Here is the call graph for this function:

Here is the caller graph for this function: