Results 1 to 3 of 3

Thread: C# and dictionary/sequence problem on ICE 3.0.1

  1. #1
    tkrieger is offline Registered User
    Name: Thomas Krieger
    Organization: Analytic Pipe GmbH
    Project: BISS
    Join Date
    May 2006
    Location
    Germany
    Posts
    17

    C# and dictionary/sequence problem on ICE 3.0.1

    Hi,

    i try now my first project with ice and try to compile, with slice2cs, following files:

    NodeReferenceIce.ice:
    #include "XmlElementIce.ice"

    module BISS
    {
    module Information
    {
    class NodeReferenceIce extends Datatypes::XmlElementIce
    {
    string ipAddress;
    dictionary<int ,string> portList;
    };
    };
    };

    The included file XmlElementIce.ice follows here:

    module BISS
    {
    module Information
    {
    module Datatypes
    {
    class XmlElementIce
    {
    string name;
    int mapId;
    int typeId;
    };

    class IntegerIce extends XmlElementIce
    {
    int val;
    };

    class DateTimeIce extends XmlElementIce
    {
    long ticks;
    };
    };
    };
    };

    every time i try to compile this two files i got an syntax error on line 10 in the NodeReferenceIce.ice file. Here is the dictionary entry and even if i replace it with an sequence i got a syntax.

    In the manual this is the definition for dictionary entrys so i don't now whats wrong!

    I have ICE 3.0.1 and .NET 1.1

    Best Regards

    Thomas Krieger

    ------------------------------------
    Thomas Krieger
    Analytic Pipe GmbH
    http://www.analyticpipe.de
    Last edited by tkrieger; 05-18-2006 at 11:24 AM.

  2. #2
    dwayne's Avatar
    dwayne is offline ZeroC Staff
    Name: Dwayne Boone
    Organization: ZeroC, Inc.
    Project: Internet Communications Engine
    Join Date
    Jan 2005
    Location
    St. John's, Newfoundland
    Posts
    397
    Hi Thomas,

    You cannot define a dictionary type inside of a class definition. Instead you need to define the type outside the class and then use the type to declare a data member in your class. Your slice should look something like this...

    Code:
    module BISS
    {
    module Information
    {
    
    dictionary<int ,string> portList;  // Define the dictionary type.
    
    class NodeReferenceIce extends Datatypes::XmlElementIce
    {
        string ipAddress;
        portList  ports; // Declare a portList dictionary data member.
    };
    
    };
    };
    Regards,
    Dwayne

  3. #3
    tkrieger is offline Registered User
    Name: Thomas Krieger
    Organization: Analytic Pipe GmbH
    Project: BISS
    Join Date
    May 2006
    Location
    Germany
    Posts
    17

    Thanks...

    Ok this makes sense...thanks for your quick good answer!

    Greetings

    Thomas Krieger
    ------------------------------------------
    Thomas Krieger
    Analytic Pipe GmbH
    http://www.analyticpipe.de

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. C++ mapping for a dictionary with an enum as the key
    By mefoster in forum Help Center
    Replies: 3
    Last Post: 10-14-2009, 10:38 AM
  2. Replies: 6
    Last Post: 03-27-2006, 11:35 AM
  3. Why class cannot be a key for a dictionary?
    By DeepDiver in forum Comments
    Replies: 1
    Last Post: 10-05-2005, 02:17 PM
  4. Replies: 4
    Last Post: 06-22-2005, 09:33 PM
  5. Dictionary mapping in cpp
    By DeepDiver in forum Comments
    Replies: 1
    Last Post: 04-07-2005, 08:06 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •