Back to index

salome-med  6.5.0
Functions
MEDMEM_InvokingDriverFromStandardObjectMethod.cxx File Reference
#include "MEDMEM_Exception.hxx"
#include "MEDMEM_define.hxx"
#include "MEDMEM_Field.hxx"
#include "MEDMEM_Mesh.hxx"

Go to the source code of this file.

Functions

 main ()

Function Documentation

main ( void  )

Definition at line 32 of file MEDMEM_InvokingDriverFromStandardObjectMethod.cxx.

        {
  
  const char * fileName   = "pointe.med";
  const char * fileName2  = "fieldCellDoubleOfpointe.med";
  const char * fieldName  = "fieldcelldoublescalar";
  const char * meshName   = "maa1";
    
  try {
    // Test creation of drivers from the standard driver method of an object
    FIELD<double> * myField = new FIELD<double>();
    int myDriver1 = myField->addDriver(MED_DRIVER, fileName, fieldName);
    myField->read();
    //This test failed due to inadequate Support implementation
    myField->rmDriver();  // TESTER LA VALIDITE DE myDriver2 !!!!

    int myDriver2 = myField->addDriver(MED_DRIVER, fileName2, fieldName);
    myField->write(myDriver2);
    //This test failed due to inadequate Support implementation
    myField->rmDriver(myDriver2);

    MESH * myMesh  = new MESH();
    int myDriver3  = myMesh->addDriver(MED_DRIVER, fileName, meshName);
    myMesh->read();
    myMesh->rmDriver();


    myMesh->removeReference();
    myField->removeReference();

  } catch (MEDEXCEPTION& ex){
    MESSAGE_MED(ex.what()) ;
  }
}

Here is the call graph for this function: