[omniORB] omniORBpy and attributes in IDL (server side)

Richard Gruet rgruet@ina.fr
Thu, 30 Dec 1999 11:58:35 +0100


--------------18426228C7ED9E1DD3444ECC
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Thorsten Roskowetz wrote:

> can someone please enlighten me on how to implement
> interface attributes server-side with omniORBpy?
> The Python Language Mapping only mentions attributes
> client side (basically an attribute is mapped to two
> methods on the corresponding Python stub class, an
> accessor an a modifier prefixed with '_get_' and
> '_set_' respectively).

It's exactly the same on the server side. In your implementation class,
for a given attribute XXX,
you just have to define a pair of methods:

class MyInterfaceImpl(POA_MyModule.MyInterface):
    ...
    def _get_XXX(self):
        return theValueOfXXX

    def _set_XXX(self, value):
        # sets XXX to value

Cheers,

Richard

--------------18426228C7ED9E1DD3444ECC
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Thorsten Roskowetz wrote:
<blockquote TYPE=CITE><i>can someone please enlighten me on how to implement</i>
<br><i>interface attributes server-side with omniORBpy?</i>
<br><i>The Python Language Mapping only mentions attributes</i>
<br><i>client side (basically an attribute is mapped to two</i>
<br><i>methods on the corresponding Python stub class, an</i>
<br><i>accessor an a modifier prefixed with '_get_' and</i>
<br><i>'_set_' respectively).</i></blockquote>
It's exactly the same on the server side. In your implementation class,
for a given attribute XXX,
<br>you just have to define a pair of methods:
<p>class MyInterfaceImpl(POA_MyModule.MyInterface):
<br>&nbsp;&nbsp;&nbsp; ...
<br>&nbsp;&nbsp;&nbsp; def _get_XXX(self):
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return theValueOfXXX
<p>&nbsp;&nbsp;&nbsp; def _set_XXX(self, value):
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # sets XXX to value
<p>Cheers,
<p>Richard</html>

--------------18426228C7ED9E1DD3444ECC--