NAME
idl2pysrv - IDL compiler to Python RPC-GIOP skeleton server
SYNOPSIS
idl2pysrv [options] spec.idl
OPTIONS
All options are forwarded to C preprocessor, except -h -i -J -v -x.
With the GNU C Compatible Compiler Processor, useful options are :
Specific options :
- -h
-
Display help.
- -i directory
-
Specify a path for import (only for version IDL 3.0).
- -J directory
-
Specify a path for Python package.
- -v
-
Display version.
- -x
-
Enable export (only for version IDL 3.0).
DESCRIPTION
idl2pysrv parses the given input file (IDL) and generates :
a set of Python sources : an optional _spec_skel.py and pkg_skel/__init__.py for each package
setup_skel.py
idl2pysrv is a Perl OO application what uses the visitor design pattern. The parser is generated by Parse::Yapp.
idl2pysrv needs a cpp executable.
CORBA Specifications, including IDL (Interface Language Definition) and Python Language Mapping are available on <http://www.omg.org/>.
INSTALLATION
After standard Perl installation, you must install the Python package PyIDL :
setup.py install
TUTORIAL
RPC-GIOP
RPC-GIOP is an another RPC (Remote Procedure Call) mecanism.
RPC-GIOP reuses a subset of CORBA GIOP messages, but don't deal with any CORBA ORB (Object Request Broker). RPC-GIOP reuses the CORBA CDR (Common Data Representation) transfer syntax.
An interface (a set of operations) is defined with CORBA IDL (Interface Definition Language). And this package supplies an client stub generator idl2pycli and an server skeleton generator idl2pysrv.
RPC-GIOP has a lot of common properties with CORBA GIOP :
needs a reliable transport layer (typically TCP/IP)
uses a binary format (CDR)
is interoperable (byte-order)
EXAMPLE 1
Use rpc1 as current directory.
The file Calc.idl describes the interface of a simple calculator.
Nota : the IDL interface Calc is in the global scope.
First, run :
idl2pysrv Calc.idl
Second, install :
python setup_skel.py install
Third, create your implementation MyCalc.py which inherits of _Calc_skel.py
from _Calc_skel import *
class MyCalc(Calc_skel):
def Add(self, val1, val2):
...
Fourth, create a server server.py that registers your implementation (a server could register several interfaces).
servant = RPC_GIOP.Servant()
myCalc = MyCalc()
servant.Register('IDL:Calc:1.0', myCalc)
Fifth, run the server and the client (see idl2pycli).
SEE ALSO
cpp, idl2html, idl2pycli, idl2py
COPYRIGHT
(c) 2005-2007 Francois PERRAD, France. All rights reserved.
This program and all CORBA::Python modules are distributed under the terms of the Artistic Licence.
AUTHOR
Francois PERRAD, francois.perrad@gadz.org