omniORBpy / IDL mapping question...

Dag Sunde dag at orion.no
Tue Sep 26 06:21:32 EDT 2000


In my IDL file I have a fragment that looks like:

  interface MarketInterface
  {
    readonly attribute CosNaming::Name CorbaName;
    readonly attribute string NamingDef;

    attribute string MarketNameLong;
    attribute string MarketNameShort;

    ...
  };


This ends up as the following in the generated Python-stubs
from the IDL-compiler:

class MarketInterface :
  ...

  # MarketInterface operations and attributes
  MarketInterface._d__get_CorbaName = ((),(_0_CosNaming._d_Name,),None)
  MarketInterface._d__get_NamingDef =
((),((omniORB.tcInternal.tv_string,0),),None)
  MarketInterface._d__get_MarketNameLong =
((),((omniORB.tcInternal.tv_string,0),),None)
  MarketInterface._d__set_MarketNameLong =
(((omniORB.tcInternal.tv_string,0),),(),None)
  MarketInterface._d__get_MarketNameShort =
((),((omniORB.tcInternal.tv_string,0),),None)
  MarketInterface._d__set_MarketNameShort =
(((omniORB.tcInternal.tv_string,0),),(),None)

and:

# MarketInterface object reference
class _objref_MarketInterface (CORBA.Object):

    def _get_CorbaName(self, *args):
        return _omnipy.invoke(self, "_get_CorbaName",
            _0_marketInterfaces.MarketInterface._d__get_CorbaName, args)

    def _get_NamingDef(self, *args):
        return _omnipy.invoke(self, "_get_NamingDef",
            _0_marketInterfaces.MarketInterface._d__get_NamingDef, args)

    def _get_MarketNameLong(self, *args):
        return _omnipy.invoke(self, "_get_MarketNameLong",
            _0_marketInterfaces.MarketInterface._d__get_MarketNameLong,
args)

    def _set_MarketNameLong(self, *args):
        return _omnipy.invoke(self, "_set_MarketNameLong",
            _0_marketInterfaces.MarketInterface._d__set_MarketNameLong,
args)

    def _get_MarketNameShort(self, *args):
        return _omnipy.invoke(self, "_get_MarketNameShort",
            _0_marketInterfaces.MarketInterface._d__get_MarketNameShort,
args)

    def _set_MarketNameShort(self, *args):
        return _omnipy.invoke(self, "_set_MarketNameShort",
            _0_marketInterfaces.MarketInterface._d__set_MarketNameShort,
args)


My problem is: how do I implement the Attributes from the IDL-file, so they
behave
like attributes when I'm implementing the "MarketInterface" - interface?


ie. Mymarket.CorbaName = "Test" or sName = MyMarket.CorbaName ???

TIA...

Dag






More information about the Python-list mailing list