Archived
This forum has been archived. Please start a new discussion on GitHub.
ICE forward decls
PeteH
in Help Center
While slice2cpp processes the following two ice modules successfully, it implements the classes IA::__U__As and IB::__U__Bs in a.h and b.h causing compile errors.
How can I avoid this without merging all the ice modules into one?
a.ice
How can I avoid this without merging all the ice modules into one?
a.ice
module IA
{
interface A;
sequence<A*> As;
};
module IB
{
interface B;
sequence<B*> Bs;
};
module IA
{
interface A
{
As GetAs();
IB::Bs GetBs();
};
};
b.ice
module IB
{
interface B;
sequence<B*> Bs;
};
module IA
{
interface A;
sequence<A*> As;
};
module IB
{
interface B
{
Bs GetBs();
IA::As GetAs();
};
};
0
Comments
-
You should put the common types into a slice file and #include it from the other files.
ie:
seqtypes.icemodule IA { interface A; sequence<A*> As; }; module IB { interface B; sequence<B*> Bs; };
a.ice#include <seqtypes.ice> module IA { interface A { As GetAs(); IB::Bs GetBs(); }; };0 -
Thanks, but this doesn't really help in my case

The problem is that I wanted further modules based on a.ice and b.ice. So if I build somethhing like atypes.ice and btypes.ice and include both of these in both a.ice and b.ice, i can compile all ice files correctly.
Now if I add a1.ice like so:#include <a.ice> module IA { interface A1 extends A { As booh(); IB::Bs baah(); }; };
It won't compile because slice basically ignores the #include <a.ice>.0
