PATCH: _narrow for perl bindings
- From: Alex Hornby <alex anvil co uk>
- To: orbit-list gnome org
- Subject: PATCH: _narrow for perl bindings
- Date: Thu, 12 Apr 2001 17:08:27 +0100 (BST)
Hello,
Here is a patch that adds a form of _narrow to the perl bindings.
Why would you want to do that you ask, surely the perl bindings handle
that automatically? Well if you only have the base idl file loaded and
you want to call base methods on a derived interface, then at the
moment CORBA::ORBit forces you to do a load_idl to bring it in. Having
a narrow allows you to avoid that overhead and the uncertainty of
trying to guess a file name for the derived interfaces IDL from an
repository id.
I use this to monitor servers with a common base interface, but I'm
sure there are other uses as well :)
This patch adds an _narrow method to CORBA::Object that takes the
desired repository id as an argument.
Regards,
Alex Hornby
--- ORBit.pm Thu Apr 12 16:34:09 2001
+++ ORBit.pm.orig Thu Apr 12 16:03:24 2001
@@ -112,15 +112,6 @@
use Carp;
use vars qw($AUTOLOAD);
-
-sub _narrow {
- no strict qw(refs);
-
- my $self = shift;
- my $new_id = shift;
- $ {ref($self)."::_narrow($new_id)"};
-}
-
sub AUTOLOAD {
my ($self, @rest) = @_;
--- ORBit.xs.orig Thu Apr 12 15:49:55 2001
+++ ORBit.xs Thu Apr 12 16:47:02 2001
@@ -206,6 +206,16 @@
RETVAL
void
+_narrow (self, repoid)
+ CORBA::Object self;
+ char * repoid;
+ CODE:
+ {
+ g_free(self->object_id);
+ self->object_id = g_strdup(repoid);
+ }
+
+void
DESTROY (self)
CORBA::Object self
CODE:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]