About slice module

JanggwanJanggwan Member Janggwan ImOrganization: KAISTProject: Internet of Things architecture
How can I use the structures (struct) or interfaces defined in other modules?

I want to create my module in which the interfaces or the structures referring to other interfaces or the structures defined in other modules, possibly in other .ice files.

I am using slice2java Eclipse plugin.

In my newly created .ice file, I cannot include my other .ice files which are located in the same directory.
In addition, I cannot reuse any modules I previously defined.

Please help.

Comments

  • xdmxdm La Coruña, SpainAdministrators, ZeroC Staff Jose Gutierrez de la ConchaOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    In my newly created .ice file, I cannot include my other .ice files which are located in the same directory.

    You need to use the -I option of the slice compiler, see "Configuring Project Settings" in http://www.zeroc.com/eclipse.html for how to do that with eclipse.
    In addition, I cannot reuse any modules I previously defined.

    Not sure what you mean. You can use the same module in several slice files, just reopen it.
    File: A.ice
    module Foo
    {
      struct Bar{int y, int x};
    };
    
    File: B.ice
    
    module Foo
    {
      interface test
      {
         void doSomeThingCool(Bar arg1);
      };
    };
    

    Hope this help,
    Jose
  • JanggwanJanggwan Member Janggwan ImOrganization: KAISTProject: Internet of Things architecture
    Instead of adding struct or interfaces into existing module

    Instead of adding struct or interfaces into existing module by reopening it,

    I want to create new module.

    Inside the newly created module, I wanted to create new interface inherited from the other interface defined in other module.

    The only thing I can do is reopening the module and adding into it ?
  • dwaynedwayne St. John's, NewfoundlandMember Dwayne BooneOrganization: ZeroC, Inc.Project: Internet Communications Engine
    You can use types from other modules by scoping them properly, For example
    module AModule
    {
    interface AIface
    {
        void AMethod();
    };
    };
    
    module BModule
    {
    interface BIface extends AModule::AIface
    {
        void BMethods();
    };
    };
    
  • JanggwanJanggwan Member Janggwan ImOrganization: KAISTProject: Internet of Things architecture
    Thanks

    Thanks. That's what I wanted!
Sign In or Register to comment.