| 1 | # $Id: IOP.pm,v 1.2 1997/05/17 12:00:34 schuller Exp $ | ||
| 2 | # Copyright (c) 1997 Lunatech Research / Bart Schuller <schuller@lunatech.com> | ||
| 3 | # See the file "Artistic" in the distribution for licensing and | ||
| 4 | # (lack of) warranties. | ||
| 5 | |||
| 6 | # module IOP | ||
| 7 | package IOP; | ||
| 8 | use COPE::CORBA::ORB; | ||
| 9 | use COPE::CORBA::TypeCode; | ||
| 10 | |||
| 11 | # const ProfileId TAG_INTERNET_IOP | ||
| 12 | sub TAG_INTERNET_IOP () { 0 } | ||
| 13 | |||
| 14 | $IOP::ServiceID_tc = _create_alias_tc('', 'ServiceID', $CORBA::_tc_ulong); | ||
| 15 | use strict; | ||
| 16 | |||
| 17 | # struct ServiceContext | ||
| 18 | package IOP::ServiceContext; | ||
| 19 | use COPE::CORBA::TypeCode; | ||
| 20 | @IOP::ServiceContext::ISA=qw(CORBA::_Struct); | ||
| 21 | sub _marshal { | ||
| 22 | my($self) = pop; # sic | ||
| 23 | CORBA::ORB::_marshal_ulong(@_, $self->{context_id}); | ||
| 24 | CORBA::ORB::_marshal_octet_sequence(@_, $self->{context_data}); | ||
| 25 | } | ||
| 26 | |||
| 27 | $IOP::ServiceContext::_tc = _create_struct_tc('', 'ServiceContext', | ||
| 28 | [ | ||
| 29 | context_id => $IOP::ServiceID_tc, | ||
| 30 | context_data => _create_sequence_tc(0,$CORBA::_tc_octet) | ||
| 31 | ] | ||
| 32 | ); | ||
| 33 | |||
| 34 | # module IOP | ||
| 35 | package IOP; | ||
| 36 | use COPE::CORBA::TypeCode; | ||
| 37 | $IOP::ServiceContextList_tc = _create_alias_tc('', | ||
| 38 | 'ServiceContextList', | ||
| 39 | _create_sequence_tc(0,$IOP::ServiceContext::_tc) | ||
| 40 | ); | ||
| 41 | $IOP::TransactionService = \0; | ||
| 42 | |||
| 43 | # struct TaggedProfile | ||
| 44 | package IOP::TaggedProfile; | ||
| 45 | @IOP::TaggedProfile::ISA = qw(CORBA::_Struct); | ||
| 46 | sub _unmarshal { | ||
| 47 | my $self = {}; | ||
| 48 | $self->{tag} = CORBA::ORB::_unmarshal_long(@_); | ||
| 49 | $self->{profile_data} = CORBA::ORB::_unmarshal_octet_sequence(@_); | ||
| 50 | return bless $self, 'IOP::TaggedProfile'; | ||
| 51 | } | ||
| 52 | |||
| 53 | sub _marshal { | ||
| 54 | my $self = pop; # sic | ||
| 55 | CORBA::ORB::_marshal_long(@_, $self->{tag}); | ||
| 56 | CORBA::ORB::_marshal_octet_sequence(@_, $self->{profile_data}); | ||
| 57 | } | ||
| 58 | |||
| 59 | # struct IOR | ||
| 60 | package IOP::IOR; | ||
| 61 | @IOP::IOR::ISA = qw(CORBA::_Struct); | ||
| 62 | sub _unmarshal { | ||
| 63 | my $self = {}; | ||
| 64 | $self->{type_id} = CORBA::ORB::_unmarshal_string(@_); | ||
| 65 | $self->{profiles} = CORBA::ORB::_unmarshal_sequence( | ||
| 66 | @_, \&IOP::TaggedProfile::_unmarshal); | ||
| 67 | return bless $self, 'IOP::IOR'; | ||
| 68 | } | ||
| 69 | |||
| 70 | sub _marshal { | ||
| 71 | my $self = pop; # sic | ||
| 72 | CORBA::ORB::_marshal_string(@_, $self->{type_id}, length($self->{type_id})); | ||
| 73 | CORBA::ORB::_marshal_sequence(@_, $self->{profiles}, \&IOP::TaggedProfile::_marshal); | ||
| 74 | } | ||
| 75 | |||
| 76 | # module IIOP | ||
| 77 | # struct Version | ||
| 78 | package IIOP::Version; | ||
| 79 | @IIOP::Version::ISA = qw(CORBA::_Struct); | ||
| 80 | sub _unmarshal { | ||
| 81 | my $self = {}; | ||
| 82 | $self->{major} = CORBA::ORB::_unmarshal_char(@_); | ||
| 83 | $self->{minor} = CORBA::ORB::_unmarshal_char(@_); | ||
| 84 | return bless $self, 'IIOP::Version'; | ||
| 85 | } | ||
| 86 | |||
| 87 | sub _marshal { | ||
| 88 | my $self = pop; # sic | ||
| 89 | CORBA::ORB::_marshal_char(@_, $self->{major}); | ||
| 90 | CORBA::ORB::_marshal_char(@_, $self->{minor}); | ||
| 91 | } | ||
| 92 | |||
| 93 | # struct ProfileBody | ||
| 94 | package IIOP::ProfileBody; | ||
| 95 | @IIOP::ProfileBody::ISA = qw(CORBA::_Struct); | ||
| 96 | sub _unmarshal { | ||
| 97 | my $self = {}; | ||
| 98 | $self->{iiop_version} = IIOP::Version::_unmarshal(@_); | ||
| 99 | $self->{host} = CORBA::ORB::_unmarshal_string(@_); | ||
| 100 | $self->{port} = CORBA::ORB::_unmarshal_ushort(@_); | ||
| 101 | $self->{object_key} = CORBA::ORB::_unmarshal_octet_sequence(@_); | ||
| 102 | return bless $self, 'IIOP::ProfileBody'; | ||
| 103 | } | ||
| 104 | |||
| 105 | sub _marshal { | ||
| 106 | my($self) = pop; # sic | ||
| 107 | IIOP::Version::_marshal(@_, $self->{iiop_version}); | ||
| 108 | CORBA::ORB::_marshal_string(@_, $self->{host}); | ||
| 109 | CORBA::ORB::_marshal_ushort(@_, $self->{port}); | ||
| 110 | CORBA::ORB::_marshal_octet_sequence(@_, $self->{object_key}); | ||
| 111 | } | ||
| 112 | |||
| 113 | 1; |