New Starter with Ice needs assistance on Slice syntax

in Help Center
Hello,
This question has probably been answered before on the forum, but due to the broad nature of the query I was unable to find exactly the right post. I am just getting started with Ice and am trying to create the Slice file. My object model is similar to the following:
struct a {
string someValue;
sequence<b> setOfBs;
}
struct b {
string otherValue;
a parentA;
}
interface doSomething {
void doX(a value);
void doY(b value);
}
I have attempted to model the above as interfaces with forward declarations, as structs, putting each struct in its own file, putting all the structs together and then referencing it with an include, and non of this is working.
Can the kind forum members please advise on the best Slice file format for the above? Should the structures be struct, class, or interface? Should I use forward delcarations to get around the mutual dependency or is there another mechanism? Should each object be in a single file for the common module, or do they have to be separate with includes?
Thanks in advance,
Ian Meyers
This question has probably been answered before on the forum, but due to the broad nature of the query I was unable to find exactly the right post. I am just getting started with Ice and am trying to create the Slice file. My object model is similar to the following:
struct a {
string someValue;
sequence<b> setOfBs;
}
struct b {
string otherValue;
a parentA;
}
interface doSomething {
void doX(a value);
void doY(b value);
}
I have attempted to model the above as interfaces with forward declarations, as structs, putting each struct in its own file, putting all the structs together and then referencing it with an include, and non of this is working.
Can the kind forum members please advise on the best Slice file format for the above? Should the structures be struct, class, or interface? Should I use forward delcarations to get around the mutual dependency or is there another mechanism? Should each object be in a single file for the common module, or do they have to be separate with includes?
Thanks in advance,
Ian Meyers
0
Comments
For example:
You could also use:
Of course, if you can write your code without circular dependencies, then I would do so, but sometimes this is not possible.
Operator.ice
:49: `softwareVersions' has changed meaning
given:
where line 49 is 'SoftwareVersions softwareVersions;' for example. I appreciate I need to sort the sequence of Member type, which has been omitted for brevity. Can you please advise on what the above error means?
In your example, the identifier "SoftwareVersions" is used first as a class name and then redefined as a data member. To make the error go away, use identifiers that do not differ by capitalization only.