Back to index

salome-med  6.5.0
Public Member Functions
MEDMEM::FIELDTEMPLATE_I< T, INTERLACING_TAG > Class Template Reference

#include <MEDMEM_FieldTemplate_i.hxx>

List of all members.

Public Member Functions

 FIELDTEMPLATE_I ()
 Default constructor.
 ~FIELDTEMPLATE_I ()
 Destructor.
 FIELDTEMPLATE_I (MEDMEM::FIELD< T, INTERLACING_TAG > *f, bool ownCppPtr=false)
 Default constructor.
 FIELDTEMPLATE_I (FIELDTEMPLATE_I &f)
 Constructor par recopie.
FIELDI_TRAITS< T,
INTERLACING_TAG >::SeqType * 
getValue (SALOME_MED::medModeSwitch mode) throw (SALOME::SALOME_Exception)
 CORBA: Accessor for Field's values.
FIELDI_TRAITS< T,
INTERLACING_TAG >
::SenderPtrType 
getSenderForValue (SALOME_MED::medModeSwitch mode) throw (SALOME::SALOME_Exception)
 CORBA: Accessor for Field's values.

Detailed Description

template<class T, class INTERLACING_TAG = FullInterlace>
class MEDMEM::FIELDTEMPLATE_I< T, INTERLACING_TAG >

Definition at line 39 of file MEDMEM_FieldTemplate_i.hxx.


Constructor & Destructor Documentation

template<class T , class INTERLACING_TAG >
MEDMEM::FIELDTEMPLATE_I< T, INTERLACING_TAG >::FIELDTEMPLATE_I ( )

Default constructor.

Definition at line 60 of file MEDMEM_FieldTemplate_i.hxx.

                                                     : FIELD_i()
  {
  }
template<class T , class INTERLACING_TAG >
MEDMEM::FIELDTEMPLATE_I< T, INTERLACING_TAG >::~FIELDTEMPLATE_I ( )

Destructor.

Definition at line 69 of file MEDMEM_FieldTemplate_i.hxx.

  {
  }
template<class T , class INTERLACING_TAG >
MEDMEM::FIELDTEMPLATE_I< T, INTERLACING_TAG >::FIELDTEMPLATE_I ( MEDMEM::FIELD< T, INTERLACING_TAG > *  f,
bool  ownCppPtr = false 
)

Default constructor.

Definition at line 88 of file MEDMEM_FieldTemplate_i.hxx.

                                                                                                       :FIELD_i(f,ownCppPtr)
  {
  }
template<class T , class INTERLACING_TAG >
MEDMEM::FIELDTEMPLATE_I< T, INTERLACING_TAG >::FIELDTEMPLATE_I ( FIELDTEMPLATE_I< T, INTERLACING_TAG > &  f)

Constructor par recopie.

Definition at line 78 of file MEDMEM_FieldTemplate_i.hxx.

                                                                                            :
    FIELD_i(fd)
  {
  }

Member Function Documentation

template<class T , class INTERLACING_TAG >
FIELDI_TRAITS< T, INTERLACING_TAG >::SenderPtrType MEDMEM::FIELDTEMPLATE_I< T, INTERLACING_TAG >::getSenderForValue ( SALOME_MED::medModeSwitch  mode) throw (SALOME::SALOME_Exception)

CORBA: Accessor for Field's values.

Definition at line 157 of file MEDMEM_FieldTemplate_i.hxx.

  {
    if (_fieldTptr==NULL)
      THROW_SALOME_CORBA_EXCEPTION("No associated Field", \
                                   SALOME::INTERNAL_ERROR);
    typename FIELDI_TRAITS<T,INTERLACING_TAG>::SenderPtrType ret;
    try
      {
        medModeSwitch modemed=convertIdlModeToMedMode(mode);
        // ::FIELD<T> *ptrD=dynamic_cast< ::FIELD<T>* >(_fieldTptr);
        // the alternative is not safe but the dynamic_cast fails using the python API
        MEDMEM::FIELD<T, INTERLACING_TAG> *ptrD=static_cast< MEDMEM::FIELD<T, INTERLACING_TAG>* >(_fieldTptr);
        int nbval=ptrD->getValueLength();
        if(ptrD->getInterlacingType()==modemed)
          {
            const T* values =ptrD->getValue();
            ret=SenderFactory::buildSender(*this,values,nbval);
          }
        else
          {
            T *values;
            if  ( ptrD->getGaussPresence() ) 
              {
                typename MEDMEM_ArrayInterface<T,INTERLACING_TAG,Gauss>::Array * myArray = ptrD->getArrayGauss();
                int size=myArray->getArraySize();
                values=new T[size];
                delete ArrayConvert(*myArray,values);
                
              }
            else 
              {
                typename MEDMEM_ArrayInterface<T,INTERLACING_TAG,NoGauss>::Array * myArray = ptrD->getArrayNoGauss();
                int size=myArray->getArraySize();
                values=new T[size];
                delete ArrayConvert(*myArray,values);
              }
            ret=SenderFactory::buildSender(*this,values,nbval);
          }
      }
    catch (MEDEXCEPTION &ex)
      {
        MESSAGE("Unable to acces Field ");
        THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR);
      }
    return ret;
  }

Here is the call graph for this function:

template<class T , class INTERLACING_TAG >
FIELDI_TRAITS< T, INTERLACING_TAG >::SeqType * MEDMEM::FIELDTEMPLATE_I< T, INTERLACING_TAG >::getValue ( SALOME_MED::medModeSwitch  mode) throw (SALOME::SALOME_Exception)

CORBA: Accessor for Field's values.

Definition at line 98 of file MEDMEM_FieldTemplate_i.hxx.

  {
    if (_fieldTptr==NULL)
      THROW_SALOME_CORBA_EXCEPTION("No associated Field", \
                                   SALOME::INTERNAL_ERROR);
    typename FIELDI_TRAITS<T,INTERLACING_TAG>::SeqVarType myseq = new typename FIELDI_TRAITS<T,INTERLACING_TAG>::SeqType;
    try
      {
        medModeSwitch modemed=convertIdlModeToMedMode(mode);
        //              ::FIELD<T> *ptrD=dynamic_cast< ::FIELD<T>* >(_fieldTptr);
        // the alternative is not safe but the dynamic_cast fails using the python API
        MEDMEM::FIELD<T, INTERLACING_TAG> *ptrD = static_cast<MEDMEM::FIELD<T, INTERLACING_TAG>* >(_fieldTptr);
        int nbval=ptrD->getValueLength();
        if(ptrD->getInterlacingType()==modemed)
          {
            const T* values =ptrD->getValue();
            myseq->length(nbval);
            for (int i=0; i<nbval; i++)
              {
                myseq[i]=values[i];
              }
          }
        else
          {
            T *values;
            if  ( ptrD->getGaussPresence() ) 
              {
                typename MEDMEM_ArrayInterface<T,INTERLACING_TAG,Gauss>::Array * myArray = ptrD->getArrayGauss();
                int size=myArray->getArraySize();
                values=new T[size];
                delete ArrayConvert(*myArray,values);
              }
            else 
              {
                typename MEDMEM_ArrayInterface<T,INTERLACING_TAG,NoGauss>::Array * myArray = ptrD->getArrayNoGauss();
                int size=myArray->getArraySize();
                values=new T[size];
                delete ArrayConvert(*myArray,values);
              }
            for (int i=0; i<nbval; i++)
              {
                myseq[i]=values[i];
              }
          }
      }
    catch (MEDEXCEPTION &ex)
      {
        MESSAGE("Unable to acces Field ");
        THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR);
      }
    return myseq._retn();
  }

Here is the call graph for this function:


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