[omniORB] About the TypeCode
m.soukhanov@geosys.ru
m.soukhanov@geosys.ru
Fri, 01 Mar 2002 12:35:57 +0300
Hello!
28.02.2002 22:45:14, zhang ji <zsfunl@yahoo.com> wrote:
>OpenGIS(http://www.opengis.org) issued one idl file
>for CORBA which make different geo-data(vector data)
>have a unify interface. The advantage is the clients
>can access different geo-data format based on the open
>standard interfaces from the idl file.
We have successfully used the specification for some time.
>What I do is that I want to implement the idl file
>under omniORB environment. The idl file consists of
>one module where includes all the interfaces inside.
>Some of the content like below:
>"
>module OGIS {
>// Forward declarations of interfaces
>interface Geometry; // forward declarations
>interface FeaturePropertySetIterator;
>.....
>// Common structures
>typedef sequence<FeatureType> FeatureTypeSeq;
>struct PropertyDef {
>Istring name;
>TypeCode type; /*?omniidl can not recognise?*/
>boolean required;
>};
>enum ValueType { /*?conflict with omni keywords?*
>TypeBoolean, TypeChar, TypeOctet, TypeShort,
>.....
>TypeNumeric, TypeWKSGeometry
>};
>............
>"
>
>The questions I met is
>after i compile it with omniidl -bcxx ogis.idl
>There are two errors like below(the error lines
>indicated above with /*??*/):
>"
>ogis.idl:38: Error in look-up of `TypeCode':
>`TypeCode' not found
>ogis.idl:406: Identifier `ValueType' clashes with
>keyword `valuetype'
>"
Really, those are minor errors in the original OpenGIS IDL definition, probably because it is rather old by now.
>My solutions are
>1.I made the module OGIS contained by module CORBA
>like below,The omniidl can recognise the TypeCode:
>module CORBA
>{
> module OGIS {...}
>}
>
>2.i renamed the ValueType as another name(ValueTypes,
>e.g.).
You can get away with less significant changes:
1. Add explicit CORBA:: module scope for TypeCode:
struct PropertyDef {
Istring name;
CORBA::TypeCode type;
boolean required;
};
2. Add a leading underscore -- the standard CORBA way of resolving clashes with keywords:
enum _ValueType {
...
};
>But both above changed the idl file from OpenGIS
>issued original idl file. So I do not think the
>solution is good for me.
>Any advices and comments on the problems are welcomed!
Those are OpenGIS faults of not keeping its specification up-to-date with recent CORBA changes, methinks. I can not see any other solutions before they issue the next revision od IDL.
Best regards,
Mikhail
Dr. Mikhail Soukhanov <mailto:m.soukhanov@geosys.ru.>
Laboratorija Geoinformatiki, VNIIgeosistem
Warszawskoje chaussee 8, Moskva M-105, 113105 Rossija
Tel.: +7(095) 954-21-50 (x101), fax.: +7(095) 958-35-22
W.W.W.: <http://www.geosys.ru./>