[omniORB] Problem passing an array of structs
W T Meyer
meyer at iastate.edu
Mon May 7 16:40:02 BST 2007
I'm trying to pass a fixed-length array of structs and I'm getting a
cryptic error message. I see others have posted similar - but not
identical - problems and it is not clear to me what the solution or
workaround is. Can someone provide some insight?
Here is my IDL:
------------
module CoRCC {
enum vmeType {SBC, ROD, TIM, EMPTY, OTHER, UNKNOWNTYPE};
enum vmeModStatus {OK, WARNING, ERROR, UNKNOWNSTATUS};
struct slotInfo {
vmeType contents;
long serNo;
vmeModStatus status;
long revision;
};
typedef slotInfo crateInfo[22];
interface RCC {
long scanCrate(out crateInfo modList);
}; /* end of interface RCC */
}; /* end of module CoRCC */
-----------
In my server application, everything compiles and links with no
warnings or errors.
When I try to build a client, I get the following error message:
-------------
CoRCCClient.cc:92: choosing `T& _CORBA_Array_Fix_Var<T_Helper,
T>::operator[](long unsigned int) [with T_Helper =
CoRCC::crateInfo_copyHelper, T = CoRCC::crateInfo_slice]' over `operator[]'
CoRCCClient.cc:92: because worst conversion for the former is better than
worst conversion for the latter
-------------
The relevant part of the client code is as follows:
-------------
int ScanCrate(int rccHandle) {
int status = 0;
int serNo;
CoRCC::crateInfo_var modList = new CoRCC::crateInfo();
status = rccref[rccHandle]->scanCrate(modList);
for (int i=2; i<NSLOTS+1; i++) {
cout << "Slot Number " << i << endl;
serNo = modList[i].serNo; //<<<< This is line 92,
where the error is
}
return status;
}
More information about the omniORB-list
mailing list