Go Back   ZeroC Forums > Help Center

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 02-22-2005
Venkat Seeth Venkat Seeth is offline
Registered User
 
 
Join Date: Feb 2005
Posts: 32
How to use Slice defined Types in another definition

Hi there,

I've defined few types in Slice in one Java module. I'll need to use these types in a Slice definition of a different module.

Java Module Foo
<CODE>
module Foo {
class FooClass {
string foostr;
};
};
</CODE>

Java Module Bar
<CODE>
module Bar {
class BarClass {
FooClass foo;
};
};
</CODE>

Any help is greatly appreciated?

Thanks,
Venkat
Reply With Quote
  #2 (permalink)  
Old 02-22-2005
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,781
In Slice code, use Foo::FooClass, just like in C++. In Java code, use Foo.FooClass.
Reply With Quote
  #3 (permalink)  
Old 02-22-2005
Venkat Seeth Venkat Seeth is offline
Registered User
 
 
Join Date: Feb 2005
Posts: 32
Marc, thanks for the reply.

slice2java compiler complains that:
`com' is not defined.

Should I use "::" as the package separator instead of "."?

Venkat
Reply With Quote
  #4 (permalink)  
Old 02-22-2005
Venkat Seeth Venkat Seeth is offline
Registered User
 
 
Join Date: Feb 2005
Posts: 32
One more clarification, the slice definitions for Foo and bar are in different files, namely Foo.ice and Bar.ice in separate namespaces.

Thanks,
venkat
Reply With Quote
  #5 (permalink)  
Old 02-22-2005
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,781
In Slice, you must use "::" as scope operator, not ".". If the Slice definitions are in separate files, then you must use a #include statement to include the definitions where required.
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
Slice Types from An external Library zhi Help Center 1 01-12-2007 04:45 AM
Problems with user-defined types davidcr1983 Help Center 3 07-14-2006 03:12 PM
Using types defined by other libraries in slice. Genia4 Help Center 3 10-17-2005 08:34 PM
bug about exception definition canyoudink Bug Reports 3 07-06-2005 10:33 AM
Class definition and visibility in c++ aseco Help Center 1 05-09-2005 07:22 PM


All times are GMT -4. The time now is 09:54 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.