generation of perl server and client from idl



I am a new user of CORBA::ORBit (perl), and I found it very nice ---
everything I have tried work as advertised.

I was wondering if there is a tool that would generate perl server and
client given the idl. This would use default values as appropriate. This
would also serve as a template for futher development. As a part of the code
generation process it would be nice to have a xxx_types.pm file, where xxx
is the idl module name. This file would hold methods that would return
references to structs with default values. For example:
Given an idl file xxx.idl as follows:
module xxx
{
       struct A {
            int i;
            string str;
        };
        struct B {
             string str;
        };
        interface Hello
        {
                void echo (in A a, out B b);
        };

}; 
The xxx_types.pm file would have:
package xxx_types;
sub A
{
     return
     {
          i=>0,
          str=>'',
     };
}

sub B
{
     return
     {
          str=>'',
     };
}
Now a client perl pgm could use these as follows:
use xxx_type;
...
my $xxx = $orb->string_to_object($ior);

my $a=xxx_types::A;
my ($b)=$xxx->echo($a);

The object implementation code on the server side would look some thing like
this:
use xxx_types;
package Hello;
use CORBA::ORBit idl => [ qw(./xxx.idl) ];
@Hello::ISA = qw(POA_xxx::Hello);
sub new 
{
# standard stuff here
}

sub echo
{
    my ($self, $a)= _;
    my $b=xxx_types::B;
# impl stuff here
    return($b);
}

In summary, the expectation is that all the above code would be generated
from the idl file and the developer can the go edit it as appropriate.

-Roy







[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]