I’m new to CORBA and is trying to create a Corba interface for my QT Application. I checked the data types that you could use with CORBA, but I’m not sure if I could use a QT object as a parameter in a CORBA function. What I would want to pass is QWSPointerCalibrationData. Let’s say I have a CORBA server code :
//pass data.screenPoints and data.devPoints
CORBA::Boolean Calibrate( QWSPointerCalibrationData data )
{
...
}
- Is this possible?
- If yes, how do I declare it in the IDL file?
- if not, what CORBA data type can I use so I could pass these type of data?
As you have the code, this is not possible. You have to specify IDL types equivalent to those that you’re using in your application, and also provide (sigh, yes) conversion functions between those types defined in CORBA IDL and the ones defined in your application. As an advantage, you blind your application to future changes in the communication (or RPC) technology, as you’re using internally your own types. In this case, looking at the documentation, the
QWSPointerCalibrationDatatype has two data members:Then you should declare in your IDL first the
QPointtype and then theQWSPointerCalibrationData(I prepend the names withC_to denote CORBA types):Then, your server method has to be:
and you have to write the
convert_from_CORBA_QWSPointerCalibrationDatafunction yourself (and the corresponding that converts that type to the CORBA counterpart). There are some tools available to do that conversion, but yes, it is a pity, that must be done.