Go Back   ZeroC Forums > Help Center

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 05-18-2006
tkrieger 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 12:24 PM.
Reply With Quote
  #2 (permalink)  
Old 05-18-2006
dwayne's Avatar
dwayne 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: 215
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
Reply With Quote
  #3 (permalink)  
Old 05-18-2006
tkrieger 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
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
null sequence in C# chris92 Help Center 3 09-29-2006 09:58 AM
Memory problem using dictionary or array as parameters enrico Help Center 6 03-27-2006 12:35 PM
Why class cannot be a key for a dictionary? DeepDiver Comments 1 10-05-2005 03:17 PM
Questions about sanity-check of sequence sizes during sequence unmarshaling rc_hz Help Center 4 06-22-2005 10:33 PM
Dictionary mapping in cpp DeepDiver Comments 1 04-07-2005 09:06 AM


All times are GMT -4. The time now is 12:43 AM.


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.