Home Help Center

How to use pair?

soff.dongsoff.dong Member qiao dongOrganization: accuradProject: v6's net project ✭✭
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();

Comments

  • matthewmatthew NL, CanadaMember Matthew NewhookOrganization: ZeroC, Inc.Project: Internet Communications Engine ✭✭✭
    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".
  • soff.dongsoff.dong Member qiao dongOrganization: accuradProject: v6's net project ✭✭
    i get it.
    tks matth.
Sign In or Register to comment.