Back to index

salome-smesh  6.5.0
Public Member Functions
SPADDERPluginTester_i Class Reference

#include <SPADDERPluginTester_i.hxx>

List of all members.

Public Member Functions

 SPADDERPluginTester_i (CORBA::ORB_ptr orb, PortableServer::POA_ptr poa, PortableServer::ObjectId *contId, const char *instanceName, const char *interfaceName)
 Constructor for component "SPADDER" instance.
virtual ~SPADDERPluginTester_i ()
 Destructor for component "SPADDER" instance.
void demo (CORBA::Double a, CORBA::Double b, CORBA::Double &c)
 This test is just to check the component SPADDER.
bool testkernel ()
bool testsmesh (CORBA::Long studyId)
 This test checks the constructor of the basic classes of the SMESH plugin for PADDER.

Detailed Description

Definition at line 30 of file SPADDERPluginTester_i.hxx.


Constructor & Destructor Documentation

SPADDERPluginTester_i::SPADDERPluginTester_i ( CORBA::ORB_ptr  orb,
PortableServer::POA_ptr  poa,
PortableServer::ObjectId *  contId,
const char *  instanceName,
const char *  interfaceName 
)

Constructor for component "SPADDER" instance.

Definition at line 39 of file SPADDERPluginTester_i.cxx.

  : Engines_Component_i(orb, poa, contId, instanceName, interfaceName)
{
  LOG("Activating SPADDERPluginTester_i::SPADDERPluginTester object");
  _thisObj = this ;
  _id = _poa->activate_object(_thisObj);
}

Destructor for component "SPADDER" instance.

Definition at line 52 of file SPADDERPluginTester_i.cxx.

{
  std::cerr << "SPADDERPluginTester destruction" << std::endl;
}

Member Function Documentation

void SPADDERPluginTester_i::demo ( CORBA::Double  a,
CORBA::Double  b,
CORBA::Double &  c 
)

This test is just to check the component SPADDER.

Definition at line 60 of file SPADDERPluginTester_i.cxx.

{
  beginService("SPADDERPluginTester_i::demo");
  try {
    //BODY
    
    std::cerr << "a: " << a << std::endl;
    std::cerr << "b: " << b << std::endl;
    c=a+b;
    std::cerr << "c: " << c << std::endl;
    
  }
  catch ( const SALOME_Exception & ex) {
    SALOME::ExceptionStruct es;
    es.text=CORBA::string_dup(ex.what());
    es.type=SALOME::INTERNAL_ERROR;
    throw SALOME::SALOME_Exception(es);
  }
  catch ( const SALOME::SALOME_Exception & ex) {
    throw;
  }
  catch (...) {
    std::cerr << "unknown exception" << std::endl;
    SALOME::ExceptionStruct es;
    es.text=CORBA::string_dup(" unknown exception");
    es.type=SALOME::INTERNAL_ERROR;
    throw SALOME::SALOME_Exception(es);
  }
  endService("SPADDERPluginTester_i::demo");
}

Definition at line 97 of file SPADDERPluginTester_i.cxx.

{
  beginService("SPADDERPluginTester_i::testplugin");

  Engines::SalomeLauncher_ptr salomeLauncher = KERNEL::getSalomeLauncher();

  endService("SPADDERPluginTester_i::testplugin");
  return true;
}
bool SPADDERPluginTester_i::testsmesh ( CORBA::Long  studyId)

This test checks the constructor of the basic classes of the SMESH plugin for PADDER.

Definition at line 119 of file SPADDERPluginTester_i.cxx.

{
  beginService("SPADDERPluginTester_i::testsmesh");

  // Resolve the SMESH engine and the SALOME study
  // _WARN_ The SMESH engine should have been loaded first
  SMESH_Gen_i* smeshGen_i = SMESH_Gen_i::GetSMESHGen();
  CORBA::Object_var anObject = smeshGen_i->GetNS()->Resolve("/myStudyManager");
  SALOMEDS::StudyManager_var aStudyMgr = SALOMEDS::StudyManager::_narrow(anObject);
  SALOMEDS::Study_var myStudy = aStudyMgr->GetStudyByID(studyId);

  //
  // _MEM_ CAUTION: SMESH_Gen define a data structure for local usage
  // while SMESH_Gen_i is the implementation of the SMESH_Gen IDL
  // interface.
  //

  endService("SPADDERPluginTester_i::testsmesh");
  return true;
}

The documentation for this class was generated from the following files: