Changes to allow interoperability between 64 and 32 processes. Pointer type is a customization of all templated code size_type's and difference_type's.

[SVN r70069]
This commit is contained in:
Ion Gaztañaga
2011-03-17 16:42:30 +00:00
parent 283d21330b
commit b5eb07ba3e
32 changed files with 359 additions and 144 deletions

View File

@@ -45,7 +45,7 @@ bool test_priority_order()
//We test that the queue is ordered by priority and in the
//same priority, is a FIFO
std::size_t recvd = 0;
message_queue::size_type recvd = 0;
unsigned int priority = 0;
std::size_t tstamp;
@@ -131,23 +131,23 @@ bool test_serialize_db()
//Data control data sending through the message queue
std::size_t sent = 0;
std::size_t recvd = 0;
std::size_t total_recvd = 0;
message_queue::size_type recvd = 0;
message_queue::size_type total_recvd = 0;
unsigned int priority;
//Send whole first buffer through the mq1, read it
//through mq2 to the second buffer
while(1){
//Send a fragment of buffer1 through mq1
std::size_t bytes_to_send = MaxMsgSize < (db_origin.get_size() - sent) ?
std::size_t bytes_to_send = MaxMsgSize < (db_origin.get_size() - sent) ?
MaxMsgSize : (db_origin.get_size() - sent);
mq1.send( &static_cast<char*>(db_origin.get_address())[sent]
, bytes_to_send
, 0);
sent += bytes_to_send;
//Receive the fragment through mq2 to buffer_destiny
mq2.receive( &buffer_destiny[total_recvd]
, BufferSize - recvd
mq2.receive( &buffer_destiny[total_recvd]
, BufferSize - recvd
, recvd
, priority);
total_recvd += recvd;
@@ -163,7 +163,7 @@ bool test_serialize_db()
managed_external_buffer db_destiny(open_only, &buffer_destiny[0], BufferSize);
//Let's find the map
std::pair<MyMap *, std::size_t> ret = db_destiny.find<MyMap>("MyMap");
std::pair<MyMap *, managed_external_buffer::size_type> ret = db_destiny.find<MyMap>("MyMap");
MyMap *map2 = ret.first;
//Check if we have found it
@@ -182,7 +182,8 @@ bool test_serialize_db()
}
//Now let's compare all db values
for(std::size_t i = 0, num_elements = map1->size(); i < num_elements; ++i){
MyMap::size_type num_elements = map1->size();
for(std::size_t i = 0; i < num_elements; ++i){
if((*map1)[i] != (*map2)[i]){
return false;
}
@@ -206,7 +207,7 @@ static boost::interprocess::message_queue *pmessage_queue;
void receiver()
{
std::size_t recvd_size;
boost::interprocess::message_queue::size_type recvd_size;
unsigned int priority;
int nummsg = NumMsg;