Back to index

salome-kernel  6.5.0
Public Types | Static Public Member Functions
seq_b_manipulation< seq_T, elem_T > Class Template Reference

#include <CorbaTypeManipulator.hxx>

List of all members.

Public Types

typedef seq_T * Type
typedef const seq_T & CorbaInType
typedef elem_T InnerType

Static Public Member Functions

static Type get_data (CorbaInType data)
static size_t size (Type data)
static Type clone (Type data)
static Type clone (CorbaInType data)
static void delete_data (Type data)
static InnerType *const getPointer (Type data, bool getOwnerShip=false)
static void relPointer (InnerType *dataPtr)
static InnerTypeallocPointer (size_t size)
static Type create (size_t size, InnerType *const data=NULL, bool giveOwnerShip=false)
static void dump (CorbaInType data)

Detailed Description

template<typename seq_T, typename elem_T>
class seq_b_manipulation< seq_T, elem_T >

Definition at line 378 of file CorbaTypeManipulator.hxx.


Member Typedef Documentation

template<typename seq_T , typename elem_T >
typedef const seq_T& seq_b_manipulation< seq_T, elem_T >::CorbaInType

Definition at line 382 of file CorbaTypeManipulator.hxx.

template<typename seq_T , typename elem_T >
typedef elem_T seq_b_manipulation< seq_T, elem_T >::InnerType

Definition at line 383 of file CorbaTypeManipulator.hxx.

template<typename seq_T , typename elem_T >
typedef seq_T* seq_b_manipulation< seq_T, elem_T >::Type

Definition at line 381 of file CorbaTypeManipulator.hxx.


Member Function Documentation

template<typename seq_T , typename elem_T >
static InnerType* seq_b_manipulation< seq_T, elem_T >::allocPointer ( size_t  size) [inline, static]

Definition at line 458 of file CorbaTypeManipulator.hxx.

                                                        {
    return seq_T::allocbuf(size);
  }
template<typename seq_T , typename elem_T >
static Type seq_b_manipulation< seq_T, elem_T >::clone ( Type  data) [inline, static]

Definition at line 421 of file CorbaTypeManipulator.hxx.

                                      {
    return new seq_T (* data);
  }
template<typename seq_T , typename elem_T >
static Type seq_b_manipulation< seq_T, elem_T >::clone ( CorbaInType  data) [inline, static]

Definition at line 424 of file CorbaTypeManipulator.hxx.

                                             {
    return new seq_T (data);
  }
template<typename seq_T , typename elem_T >
static Type seq_b_manipulation< seq_T, elem_T >::create ( size_t  size,
InnerType *const  data = NULL,
bool  giveOwnerShip = false 
) [inline, static]

Definition at line 467 of file CorbaTypeManipulator.hxx.

                                                         { 
    Type tmp;
    if (!data) {
      tmp = new seq_T();
      tmp->length(size);
    } else {
      tmp = new seq_T(size,data,giveOwnerShip); 
    }
    return tmp;
  } 
template<typename seq_T , typename elem_T >
static void seq_b_manipulation< seq_T, elem_T >::delete_data ( Type  data) [inline, static]

Definition at line 429 of file CorbaTypeManipulator.hxx.

                                            {
    delete data;
  }

Here is the caller graph for this function:

template<typename seq_T , typename elem_T >
static void seq_b_manipulation< seq_T, elem_T >::dump ( CorbaInType  data) [inline, static]

Definition at line 481 of file CorbaTypeManipulator.hxx.

                                             {
    // Affiche la longueur des donnees
    std::cerr << "[seq_b_manipulation] Data length: " << data.length() << std::endl;
  }
template<typename seq_T , typename elem_T >
static Type seq_b_manipulation< seq_T, elem_T >::get_data ( CorbaInType  data) [inline, static]

Definition at line 391 of file CorbaTypeManipulator.hxx.

                                                {
    CORBA::Long len = data.length();
    // Récupère et devient propriétaire des données reçues dans la séquence 
    // la séquence sera désalloué (mais pas le buffer)
    // au retour de la méthode put (car mapping de type IN : const seq & )
     if ( data.release() ) {
       InnerType * p_data = const_cast<seq_T &>(data).get_buffer(true);

    // Crée une nouvelle sequence propriétaire des données du buffer (généralement pas de recopie)
    // Les données seront automatiquement désallouées par appel interne à la méthode freebuf
    // lors de la destruction de l'objet par appel à delete_data.
#ifdef MYDEBUG
    std::cout << "----seq_u_manipulation::get_data(..)-- MARK 1bis Pas de Duplication  -----------" << std::endl;
#endif
       return new seq_T (len, p_data, true);
     }
#ifdef MYDEBUG
    std::cout << "----seq_u_manipulation::get_data(..)-- MARK 1bis Duplication pour en devenir propriétaire -----------" << std::endl;
#endif
    // Crée une nouvelle sequence propriétaire des données du buffer (avec recopie)    
    return new seq_T(data);

  }
template<typename seq_T , typename elem_T >
static InnerType* const seq_b_manipulation< seq_T, elem_T >::getPointer ( Type  data,
bool  getOwnerShip = false 
) [inline, static]

Definition at line 440 of file CorbaTypeManipulator.hxx.

                                                                                   {
    InnerType * p_data;
    if (getOwnerShip) {
      p_data = data->get_buffer(true);
      delete_data(data);
    } else
      p_data = data->get_buffer(false);
    return p_data;
  }

Here is the call graph for this function:

template<typename seq_T , typename elem_T >
static void seq_b_manipulation< seq_T, elem_T >::relPointer ( InnerType dataPtr) [inline, static]

Definition at line 453 of file CorbaTypeManipulator.hxx.

                                                     {
    seq_T::freebuf(dataPtr);
  }
template<typename seq_T , typename elem_T >
static size_t seq_b_manipulation< seq_T, elem_T >::size ( Type  data) [inline, static]

Definition at line 415 of file CorbaTypeManipulator.hxx.

                                       { 
    return data->length();
  } 

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