# $Id: IOP.pm 1354 2006-06-14 00:27:26Z rvosa $ # Subversion: $Rev: 117 $ # Copyright (c) 1997 Lunatech Research / Bart Schuller # See the file "Artistic" in the distribution for licensing and # (lack of) warranties. # We need these definitions somewhere, and everybody uses this module... use Log::Log4perl; use COPE::CORBA::ORB; Log::Log4perl::init( COPE::CORBA::ORB->LOGPERLCONF ); package CORBA::_Struct; use base; my $logger = Log::Log4perl::get_logger('CORBA._Struct'); sub new { $logger->info("Creating new \"CORBA::_Struct\""); my $class = shift; my %self = @_; bless \%self, $class; } package CORBA::_Union; $logger = Log::Log4perl::get_logger('CORBA._Union'); sub new { $logger->info("Creating new \"CORBA::_Union\""); my $class = shift; my @self = @_; bless \@self, $class; } # module IOP package IOP; use COPE::CORBA::TypeCode; $logger = Log::Log4perl::get_logger('IOP'); # const ProfileId TAG_INTERNET_IOP sub TAG_INTERNET_IOP () { $logger->info(0); 0 } #$IOP::ServiceID_tc = # CORBA::TypeCode::_create_alias_tc('', 'ServiceID', $CORBA::_tc_ulong); use strict; no strict 'refs'; # struct ServiceContext package IOP::ServiceContext; use COPE::CORBA::TypeCode; use base 'CORBA::_Struct'; use fields qw(context_id context_data); $logger = Log::Log4perl::get_logger('IOP.ServiceContext'); sub new { $logger->info("Creating new \"IOP::ServiceContext\" object"); my $class = shift; my IOP::ServiceContext $self = bless [ \%{"$class\::FIELDS"} ], $class; while ( my $key = shift ) { $self->{$key} = shift; } return $self; } sub _marshal { $logger->info("Marshalling"); my IOP::ServiceContext $self = pop; # sic CORBA::ORB::_marshal_ulong( @_, $self->{'context_id'} ); CORBA::ORB::_marshal_octet_sequence( @_, $self->{'context_data'} ); } #$IOP::ServiceContext::_tc = # CORBA::TypeCode::_create_struct_tc('', 'ServiceContext', # [context_id => $IOP::ServiceID_tc, # context_data => CORBA::TypeCode::_create_sequence_tc(0, # $CORBA::_tc_octet) # ]); sub _unmarshal { $logger->info("Unmarshalling"); return bless [ \%IOP::TaggedProfile::FIELDS, CORBA::ORB::_unmarshal_long(@_), CORBA::ORB::_unmarshal_octet_sequence(@_) ], 'IOP::ServiceContext'; } # module IOP package IOP; use COPE::CORBA::TypeCode; #$IOP::ServiceContextList_tc = CORBA::TypeCode::_create_alias_tc('', # 'ServiceContextList', # CORBA::TypeCode::_create_sequence_tc(0,$IOP::ServiceContext::_tc)); $IOP::TransactionService = \0; # struct TaggedProfile package IOP::TaggedProfile; use base 'CORBA::_Struct'; use fields qw(tag profile_data); @IOP::TaggedProfile::ISA = qw(CORBA::_Struct); $logger = Log::Log4perl::get_logger('IOP.TaggedProfile'); sub new { $logger->info("Creating \"IOP::TaggedProfile\" object"); my $class = shift; my IOP::TaggedProfile $self = bless [ \%{"$class\::FIELDS"} ], $class; while ( my $key = shift ) { $self->{$key} = shift; } return $self; } sub _unmarshal { $logger->info("Unmarshalling"); return bless [ \%IOP::TaggedProfile::FIELDS, CORBA::ORB::_unmarshal_long(@_), CORBA::ORB::_unmarshal_octet_sequence(@_) ], 'IOP::TaggedProfile'; } sub _marshal { $logger->info("Marshalling"); my IOP::TaggedProfile $self = pop; # sic CORBA::ORB::_marshal_long( @_, $self->{tag} ); CORBA::ORB::_marshal_octet_sequence( @_, $self->{profile_data} ); } # struct IOR package IOP::IOR; use base 'CORBA::_Struct'; use fields qw(type_id profiles); $logger = Log::Log4perl::get_logger('IOP.IOR'); sub new { $logger->info("Creating new \"IOR::IOR\" object"); my $class = shift; my IOP::IOR $self = bless [ \%{"$class\::FIELDS"} ], $class; while ( my $key = shift ) { $self->{$key} = shift; } return $self; } sub _unmarshal { $logger->info("Unmarshalling"); return bless [ \%IOP::IOR::FIELDS, CORBA::ORB::_unmarshal_string(@_), CORBA::ORB::_unmarshal_sequence( @_, \&IOP::TaggedProfile::_unmarshal ) ], 'IOP::IOR'; } sub _marshal { $logger->info("Marshalling"); my IOP::IOR $self = pop; # sic CORBA::MARSHAL->new->throw() unless defined($self); CORBA::ORB::_marshal_string( @_, $self->{type_id} ); CORBA::ORB::_marshal_sequence( @_, $self->{profiles}, \&IOP::TaggedProfile::_marshal ); } # module IIOP # struct Version package IIOP::Version; use base 'CORBA::_Struct'; use fields qw(major minor); $logger = Log::Log4perl::get_logger('IIOP.Version'); sub new { $logger->info("Creating new \"IIOP::Version\" object"); my $class = shift; my IIOP::Version $self = bless [ \%{"$class\::FIELDS"} ], $class; while ( my $key = shift ) { $self->{$key} = shift; } return $self; } sub _unmarshal { $logger->info("Unmarshalling"); return bless [ \%IIOP::Version::FIELDS, CORBA::ORB::_unmarshal_char(@_), CORBA::ORB::_unmarshal_char(@_) ], 'IIOP::Version'; } sub _marshal { $logger->info("Marshalling"); my IIOP::Version $self = pop; # sic CORBA::ORB::_marshal_char( @_, $self->{major} ); CORBA::ORB::_marshal_char( @_, $self->{minor} ); } # struct ProfileBody package IIOP::ProfileBody; use base 'CORBA::_Struct'; use fields qw(iiop_version host port object_key); $logger = Log::Log4perl::get_logger('IIOP.ProfileBody'); sub new { $logger->info("Creating new \"IIOP::ProfileBody\" object"); my $class = shift; my IIOP::ProfileBody $self = bless [ \%{"$class\::FIELDS"} ], $class; while ( my $key = shift ) { $self->{$key} = shift; } return $self; } sub _unmarshal { $logger->info("Unmarshalling"); return bless [ \%IIOP::ProfileBody::FIELDS, IIOP::Version::_unmarshal(@_), CORBA::ORB::_unmarshal_string(@_), CORBA::ORB::_unmarshal_ushort(@_), CORBA::ORB::_unmarshal_octet_sequence(@_) ], 'IIOP::ProfileBody'; } sub _marshal { $logger->info("Marshalling"); my IIOP::ProfileBody $self = pop; # sic IIOP::Version::_marshal( @_, $self->{iiop_version} ); CORBA::ORB::_marshal_string( @_, $self->{host} ); CORBA::ORB::_marshal_ushort( @_, $self->{port} ); CORBA::ORB::_marshal_octet_sequence( @_, $self->{object_key} ); } 1; __END__ =head1 NAME IIOP::ProfileBody A class to ... =head1 SYNOPSIS use IIOP::ProfileBody; =head1 DESCRIPTION The IIOP::ProfileBody class implements ... =head1 OPTIONS -D - show debugging information -h - show help -v - show version Other options ... =head1 SUBROUTINES =head2 new (constructor) Parameters: class Insert description of constructor here... =head2 new (constructor) Parameters: class Insert description of constructor here... =head2 new (constructor) Parameters: class Insert description of constructor here... =head2 _marshal Parameters: none Insert description of subroutine here... =head2 _unmarshal (constructor) Parameters: none Insert description of constructor here... =head2 new (constructor) Parameters: class Insert description of constructor here... =head2 _unmarshal (constructor) Parameters: none Insert description of constructor here... =head2 _marshal Parameters: none Insert description of subroutine here... =head2 new (constructor) Parameters: class Insert description of constructor here... =head2 _unmarshal (constructor) Parameters: none Insert description of constructor here... =head2 _marshal Parameters: none Insert description of subroutine here... =head2 new (constructor) Parameters: class Insert description of constructor here... =head2 _unmarshal (constructor) Parameters: none Insert description of constructor here... =head2 _marshal Parameters: none Insert description of subroutine here... =head2 new (constructor) Parameters: class Insert description of constructor here... =head2 _unmarshal (constructor) Parameters: none Insert description of constructor here... =head2 _marshal Parameters: none Insert description of subroutine here... =head1 FILES Files used by the IIOP::ProfileBody class ... =head1 SEE ALSO Related information ... =head1 WARNINGS ... =head1 NOTES ... =head1 BUGS What? =cut