Go Back   ZeroC Forums > Help Center

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 08-04-2003
sylvain sylvain is offline
Registered User
 
Name: Sylvain Fasel
Organization: university of Geneva
Project: quantum cryptographic systems
 
Join Date: Feb 2003
Location: Geneva (Switzerland)
Posts: 33
c++ metadata

Hi!

Just a little question: How could I use metadata when compiling a .ice file using slice2cpp?

I am trying to instruct the slice2cpp compiler to use a multimap instead of a map to implement a dictionary.

I tried different variant, including:

["c++:multimap"] dictionary<string,string> myDict;

["cpp:::std::multimap"] dictionary<string,string> myDict;

and stuff like that, following the example at the top of page 123 of Ice-1.1.0b.pdf, but nothing worked.

Thanks in advance for your help!
Reply With Quote
  #2 (permalink)  
Old 08-04-2003
mes's Avatar
mes mes is offline
ZeroC Staff
 
Name: Mark Spruiell
Organization: ZeroC, Inc.
Project: Ice Developer
 
Join Date: Feb 2003
Location: California
Posts: 962
Hi,

Currently you can only modify the Java language mapping in this way.

- Mark
Reply With Quote
  #3 (permalink)  
Old 08-05-2003
sylvain sylvain is offline
Registered User
 
Name: Sylvain Fasel
Organization: university of Geneva
Project: quantum cryptographic systems
 
Join Date: Feb 2003
Location: Geneva (Switzerland)
Posts: 33
Ok, I was not aware of that.

Are you planning to include this feature in the next release of Ice?

Thanks!
Reply With Quote
  #4 (permalink)  
Old 08-05-2003
marc's Avatar
marc marc is offline
ZeroC Staff
 
Name: Marc Laukien
Organization: ZeroC, Inc.
Project: The Internet Communications Engine
 
Join Date: Feb 2003
Location: Florida
Posts: 1,772
A multimap is problematic, because it is not a mapping change. It is really a type change. In order to support multimaps, we would have to add a new Slice type.

But multimaps can be emulated by using a map with a sequence of values as value type. Can't you use this in your case?
Reply With Quote
  #5 (permalink)  
Old 08-05-2003
sylvain sylvain is offline
Registered User
 
Name: Sylvain Fasel
Organization: university of Geneva
Project: quantum cryptographic systems
 
Join Date: Feb 2003
Location: Geneva (Switzerland)
Posts: 33
That's true: a multimap is in fact a new type, not another "interface" for the same type, I did not realize it.

I wil use a dictionary<key,sequence<value> > instead. Thanks.

But things like using a std::list instead of a std::vector for sequence<> could be useful sometimes, no?

Another type of container I like to use are the "set" kind, because the auto-sorting and enhanced find capabilities are sometimes of great use (afaik with my little programming experience).

I would be happy if a could use slice metadata to instruct slice2cpp to use a "vectorized" set for the sequence instead of a vector. "Vectorized" means that I could write a little wrapper for a set that implement push_back and other methods of the vector interface in addition to the set interface, so that Ice doesn't even see it is not a real vector.

Can this be a cause of troubles?
Reply With Quote
  #6 (permalink)  
Old 08-06-2003
marc's Avatar
marc marc is offline
ZeroC Staff
 
Name: Marc Laukien
Organization: ZeroC, Inc.
Project: The Internet Communications Engine
 
Join Date: Feb 2003
Location: Florida
Posts: 1,772
Yes, metadata to map a sequence to a list instead of a vector would be useful. Another item to put on our todo list

A "set" container would be a new Slice type, because it's not just a different mapping of sequence. On the other hand, a sequence could be mapped to a multiset, if the sorting is done during unmarshaling. But that's of course not as efficient as having a separate type, which gurantees that the marshalled format is sorted.

But sorting in general is a problem for middleware such as Slice. What sorting criteria should be used? This is really part of implementation, not of specification.
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Metadata directives bartley Help Center 1 02-03-2006 01:35 PM
package metadata directive - ClassCast Exception vsonnathi Bug Reports 1 09-28-2004 10:46 AM
Reference for Metadata tags Nis Baggesen Help Center 3 09-13-2004 08:04 AM


All times are GMT -4. The time now is 11:08 AM.


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