Archived
This forum has been archived. Please start a new discussion on GitHub.
How to use pair?
how to use pair just like pair<const Ice::Byte*, const Ice::Byte*> byteArr;
i need copy huge big data soon,want use it.
by the way,looks like also need [cpp:array] in .ice,why?
ths guy .
and .ice & .cpp under.
Throughput.ice:
sequence<byte> ByteSeq;
const int ByteSeqSize = 500000;
client.cpp
ByteSeq byteSeq(ByteSeqSize);
pair<const Ice::Byte*, const Ice::Byte*> byteArr;
byteArr.first = &byteSeq[0];
byteArr.second = byteArr.first + byteSeq.size();
i need copy huge big data soon,want use it.
by the way,looks like also need [cpp:array] in .ice,why?
ths guy .
and .ice & .cpp under.
Throughput.ice:
sequence<byte> ByteSeq;
const int ByteSeqSize = 500000;
client.cpp
ByteSeq byteSeq(ByteSeqSize);
pair<const Ice::Byte*, const Ice::Byte*> byteArr;
byteArr.first = &byteSeq[0];
byteArr.second = byteArr.first + byteSeq.size();
0
Comments
-
The default mapping for sequence<byte> in C++ is std::vector. Although this is convenient, it is not the most efficient mapping. Therefore we provided the cpp:array mapping to map a sequence<byte> to a C++ pair. You can find more information http://www.zeroc.com/doc/Ice-3.2.1/manual/Cpp.7.7.html. Look at the section "Array Mapping for Sequences".0
-
i get it.
tks matth.0