30 #ifndef _COPY_TO_CORBA_SPACE_HXX_
31 #define _COPY_TO_CORBA_SPACE_HXX_
36 #include "CalciumPortTraits.hxx"
40 template <
bool zerocopy,
typename DataManipulator>
43 template <
class T1,
class T2>
44 static void apply( T1 * & corbaData, T2
const & data,
size_t nRead){
49 typedef typename DataManipulator::InnerType InnerType;
52 std::cerr <<
"-------- Copy2CorbaSpace<true> MARK 1 ------------------" << std::endl;
58 corbaData = DataManipulator::create(nRead,const_cast<T2 * > (&data),
false);
60 std::cerr <<
"-------- Copy2CorbaSpace<true> MARK 2 --(dataPtr : "
61 << DataManipulator::getPointer(corbaData,
false)<<
")----------------" << std::endl;
68 template <
typename DataManipulator>
struct
71 template <
class T1,
class T2>
72 static void apply( T1 * & corbaData, T2
const & data,
size_t nRead){
77 typedef typename DataManipulator::InnerType InnerType;
79 corbaData = DataManipulator::create(nRead);
80 InnerType * dataPtr = DataManipulator::getPointer(corbaData,
false);
83 std::cerr <<
"-------- Copy2CorbaSpace<false> MARK 1 --(dataPtr : " <<
84 dataPtr<<
")----------------" << std::endl;
87 std::copy(&data,&data+nRead,dataPtr);
90 std::cerr <<
"-------- Copy2CorbaSpace<false> MARK 2 --(nRead: "<<nRead<<
")-------------" << std::endl;
92 std::cerr <<
"-------- Copy2CorbaSpace<false> MARK 3 : " ;
93 std::copy(dataPtr,dataPtr+nRead,std::ostream_iterator<InnerType>(std::cout,
" "));
94 std::cout << std::endl;
95 std::cerr <<
"-------- Copy2CorbaSpace<false> MARK 4 --(data : " <<data<<
") :" ;
96 for (
int i=0; i<nRead; ++i)
97 std::cerr << (*corbaData)[i] <<
" ";
98 std::cout << std::endl;