30 #ifndef _COPY_TO_USER_SPACE_HXX_
31 #define _COPY_TO_USER_SPACE_HXX_
46 template <
bool zerocopy,
typename DataManipulator >
49 template <
class T1,
class T2>
50 static void apply( T1 * & data, T2 & corbaData,
size_t nRead ){
52 typedef typename DataManipulator::InnerType InnerType;
85 InnerType * dataPtr = DataManipulator::getPointer(corbaData,
false);
102 template <
typename DataManipulator>
106 template <
class T1,
class T2>
107 static void apply( T1 * &data, T2 & corbaData,
size_t nRead){
109 typedef typename DataManipulator::InnerType InnerType;
113 InnerType * dataPtr = NULL;
116 dataPtr = DataManipulator::getPointer(corbaData,
false);
117 std::cerr <<
"-------- Copy2UserSpace<false> MARK 1a --dataPtr("<<dataPtr<<
")[0.."<<
118 DataManipulator::size(corbaData) <<
"] : ----------------" << std::endl;
119 std::copy(dataPtr,dataPtr+DataManipulator::size(corbaData),std::ostream_iterator<T1>(std::cerr,
" "));
120 for (
int i=0; i< DataManipulator::size(corbaData); ++i)
121 fprintf(stderr,
"pointer[%d]=%p ",i, dataPtr[i]);
122 std::cerr << std::endl;
126 std::cerr <<
"-------- Copy2UserSpace<false> MARK 1b --data("<<tmpData<<
")[0.."<<
127 DataManipulator::size(corbaData) <<
"] : ----------------" << std::endl;
128 std::copy(tmpData,tmpData+DataManipulator::size(corbaData),std::ostream_iterator<T1>(std::cerr,
" "));
129 for (
int i=0; i< DataManipulator::size(corbaData); ++i)
130 fprintf(stderr,
"pointer[%d]=%p ",i, tmpData[i]);
131 std::cerr << std::endl;
143 DataManipulator::copy(corbaData,data,nRead);
147 std::cerr <<
"-------- Copy2UserSpace<false> MARK 1c --data("<<tmpData<<
")[0.."<<
148 DataManipulator::size(corbaData) <<
"] : ----------------" << std::endl;
149 std::copy(tmpData,tmpData+DataManipulator::size(corbaData),std::ostream_iterator<T1>(std::cerr,
" "));
150 for (
int i=0; i< DataManipulator::size(corbaData); ++i)
151 fprintf(stderr,
"pointer[%d]=%p ",i, tmpData[i]);
152 std::cerr << std::endl;
161 template <
bool rel,
typename DataManipulator >
163 template <
typename T>
166 typedef typename DataManipulator::Type
DataType;
177 template <
typename DataManipulator>
180 template <
typename T>
181 static void apply(T * dataPtr) {
delete[] dataPtr; }