Go Back   ZeroC Forums > Help Center

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 09-15-2008
soff.dong soff.dong is offline
Registered User
 
Name: qiao dong
Organization: accurad
Project: v6's net project
 
Join Date: Jun 2008
Location: china xian
Posts: 12
Send a message via MSN to soff.dong
-->
Wink 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();
Reply With Quote
  #2 (permalink)  
Old 09-15-2008
matthew's Avatar
matthew matthew is online now
ZeroC Staff
 
Name: Matthew Newhook
Organization: ZeroC, Inc.
Project: Internet Communications Engine
 
Join Date: Feb 2003
Location: NL, Canada
Posts: 1,088
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".
Reply With Quote
  #3 (permalink)  
Old 09-15-2008
soff.dong soff.dong is offline
Registered User
 
Name: qiao dong
Organization: accurad
Project: v6's net project
 
Join Date: Jun 2008
Location: china xian
Posts: 12
Send a message via MSN to soff.dong
-->
i get it.
tks matth.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT -4. The time now is 11:38 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0
(c) 2008 ZeroC, Inc.