30 #ifndef _CORBA_TYPE_MANIPULATION_HXX_
31 #define _CORBA_TYPE_MANIPULATION_HXX_
37 #include <omniORB4/CORBA.h>
65 template <
typename T >
92 return new T (* data);
124 template <
typename T>
190 std::cerr <<
"[atom_manipulation] Data : " << data << std::endl;
197 template <
typename seq_T,
typename elem_T>
210 CORBA::Long len = data.length();
211 CORBA::Long max = data.maximum();
233 std::cout <<
"----seq_u_manipulation::get_data(..)-- MARK 1 ------------------" << std::endl;
235 if ( data.release() ) {
236 InnerType * p_data =
const_cast<seq_T &
>(data).get_buffer(
true);
242 std::cout <<
"----seq_u_manipulation::get_data(..)-- MARK 1(0 copy) bis ------" << p_data <<
"------------" << std::endl;
244 return new seq_T (max, len, p_data,
true);
248 std::cout <<
"----seq_u_manipulation::get_data(..)-- MARK 1(recopie) bis ------" << &data <<
"------------" << std::endl;
251 return new seq_T(data);
256 return data->length();
270 return new seq_T (*data) ;
273 return new seq_T (data);
286 p_data = data->get_buffer(
true);
289 p_data = data->get_buffer(
false);
296 seq_T::freebuf(dataPtr);
301 return seq_T::allocbuf(
size);
310 bool giveOwnerShip =
false ) {
323 template <
typename T >
324 static inline void copy(
Type data, T *
const idata,
size_t isize ) {
328 for (
size_t i = 0; i< isize; ++i)
349 static inline void copy(
Type data,
char* *
const idata,
size_t isize ) {
355 for (
size_t i = 0; i< isize; ++i)
356 strcpy(idata[i],dataPtr[i]);
362 std::cerr <<
"[seq_u_manipulation] Data length: " << data.length() << std::endl;
364 std::cerr <<
"[seq_u_manipulation] Data max: " << data.maximum() << std::endl;
377 template <
typename seq_T,
typename elem_T>
392 CORBA::Long len = data.length();
396 if ( data.release() ) {
397 InnerType * p_data =
const_cast<seq_T &
>(data).get_buffer(
true);
403 std::cout <<
"----seq_u_manipulation::get_data(..)-- MARK 1bis Pas de Duplication -----------" << std::endl;
405 return new seq_T (len, p_data,
true);
409 std::cout <<
"----seq_u_manipulation::get_data(..)-- MARK 1bis Duplication pour en devenir propriétaire -----------" << std::endl;
412 return new seq_T(data);
416 return data->length();
422 return new seq_T (* data);
425 return new seq_T (data);
443 p_data = data->get_buffer(
true);
446 p_data = data->get_buffer(
false);
454 seq_T::freebuf(dataPtr);
459 return seq_T::allocbuf(
size);
468 bool giveOwnerShip =
false ) {
474 tmp =
new seq_T(
size,data,giveOwnerShip);
483 std::cerr <<
"[seq_b_manipulation] Data length: " << data.length() << std::endl;
Definition: CorbaTypeManipulator.hxx:126
static Type clone(Type data)
Definition: CorbaTypeManipulator.hxx:161
static void dump(CorbaInType data)
Definition: CorbaTypeManipulator.hxx:189
static InnerType *const getPointer(Type &data, bool getOwnerShip=false)
Definition: CorbaTypeManipulator.hxx:139
static size_t size(Type data)
Definition: CorbaTypeManipulator.hxx:184
T InnerType
Definition: CorbaTypeManipulator.hxx:131
T Type
Definition: CorbaTypeManipulator.hxx:128
static void delete_data(Type)
Definition: CorbaTypeManipulator.hxx:181
static Type get_data(CorbaInType data)
Definition: CorbaTypeManipulator.hxx:135
T CorbaInType
Definition: CorbaTypeManipulator.hxx:130
Definition: CorbaTypeManipulator.hxx:378
seq_T * Type
Definition: CorbaTypeManipulator.hxx:381
static void relPointer(InnerType *dataPtr)
Definition: CorbaTypeManipulator.hxx:453
const seq_T & CorbaInType
Definition: CorbaTypeManipulator.hxx:382
static Type clone(Type data)
Definition: CorbaTypeManipulator.hxx:421
static void dump(CorbaInType data)
Definition: CorbaTypeManipulator.hxx:481
static InnerType *const getPointer(Type data, bool getOwnerShip=false)
Definition: CorbaTypeManipulator.hxx:440
elem_T InnerType
Definition: CorbaTypeManipulator.hxx:383
static size_t size(Type data)
Definition: CorbaTypeManipulator.hxx:415
static Type get_data(CorbaInType data)
Definition: CorbaTypeManipulator.hxx:391
static InnerType * allocPointer(size_t size)
Definition: CorbaTypeManipulator.hxx:458
static void delete_data(Type data)
Definition: CorbaTypeManipulator.hxx:429
static Type create(size_t size, InnerType *const data=NULL, bool giveOwnerShip=false)
Definition: CorbaTypeManipulator.hxx:467
static Type clone(CorbaInType data)
Definition: CorbaTypeManipulator.hxx:424
Definition: CorbaTypeManipulator.hxx:198
static Type clone(CorbaInType data)
Definition: CorbaTypeManipulator.hxx:272
static Type get_data(CorbaInType data)
Definition: CorbaTypeManipulator.hxx:209
static void dump(CorbaInType data)
Definition: CorbaTypeManipulator.hxx:360
static InnerType *const getPointer(Type data, bool ownerShip=false)
Definition: CorbaTypeManipulator.hxx:283
static InnerType * allocPointer(size_t size)
Definition: CorbaTypeManipulator.hxx:300
seq_T * Type
Definition: CorbaTypeManipulator.hxx:201
static void copy(Type data, char **const idata, size_t isize)
Definition: CorbaTypeManipulator.hxx:349
static void relPointer(InnerType *dataPtr)
Definition: CorbaTypeManipulator.hxx:295
static void copy(Type data, T *const idata, size_t isize)
Definition: CorbaTypeManipulator.hxx:324
const seq_T & CorbaInType
Definition: CorbaTypeManipulator.hxx:202
static Type create(size_t size, InnerType *const data=NULL, bool giveOwnerShip=false)
Definition: CorbaTypeManipulator.hxx:309
static void delete_data(Type data)
Definition: CorbaTypeManipulator.hxx:260
elem_T InnerType
Definition: CorbaTypeManipulator.hxx:203
static Type clone(Type data)
Definition: CorbaTypeManipulator.hxx:269
static size_t size(Type data)
Definition: CorbaTypeManipulator.hxx:255
Definition: CorbaTypeManipulator.hxx:67
static void relPointer(InnerType *dataPtr)
Definition: CorbaTypeManipulator.hxx:86
static Type create(size_t size=1)
Definition: CorbaTypeManipulator.hxx:99
static Type clone(CorbaInType data)
Definition: CorbaTypeManipulator.hxx:94
static void dump(CorbaInType data)
Definition: CorbaTypeManipulator.hxx:114
static size_t size(Type data)
Definition: CorbaTypeManipulator.hxx:109
T InnerType
Definition: CorbaTypeManipulator.hxx:73
static void delete_data(Type data)
Definition: CorbaTypeManipulator.hxx:104
T * Type
Definition: CorbaTypeManipulator.hxx:69
static Type clone(Type data)
Definition: CorbaTypeManipulator.hxx:91
static InnerType *const getPointer(Type data, bool ownerShip=false)
Definition: CorbaTypeManipulator.hxx:82
static Type get_data(CorbaInType data)
Definition: CorbaTypeManipulator.hxx:77
const T & CorbaInType
Definition: CorbaTypeManipulator.hxx:72
bool VerbosityActivated()
Called by any log message macros to decide about log output in Release and Debug mode dynamically rel...
Definition: libSALOMELog.cxx:48
tmp
Definition: TestSalomeSDS1.py:63