/[cvs]/nfo/perl/libs/Data/Storage/Result/Tangram.pm
ViewVC logotype

Diff of /nfo/perl/libs/Data/Storage/Result/Tangram.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.5 by joko, Wed Apr 9 02:09:47 2003 UTC revision 1.7 by joko, Wed Jun 25 22:59:59 2003 UTC
# Line 3  Line 3 
3  #  $Id$  #  $Id$
4  #  #
5  #  $Log$  #  $Log$
6    #  Revision 1.7  2003/06/25 22:59:59  joko
7    #  tweaked behaviour: only "->close" result if it is of type "Tangram::Cursor"
8    #
9    #  Revision 1.6  2003/04/09 07:11:01  joko
10    #  minor fix
11    #
12  #  Revision 1.5  2003/04/09 02:09:47  joko  #  Revision 1.5  2003/04/09 02:09:47  joko
13  #  bugfix: check for existance of '->close'-method before calling it on the 'RESULTHANDLE'-instance  #  bugfix: check for existance of '->close'-method before calling it on the 'RESULTHANDLE'-instance
14  #  #
# Line 33  use Data::Mungle::Compare::Struct qw( is Line 39  use Data::Mungle::Compare::Struct qw( is
39    
40  sub DESTROY {  sub DESTROY {
41    my $self = shift;    my $self = shift;
42      
43      my $is_object = 0;
44      
45    #$logger->debug( __PACKAGE__ . "->" . "DESTROY" );    #$logger->debug( __PACKAGE__ . "->" . "DESTROY" );
46    $self->{RESULTHANDLE} && $self->{RESULTHANDLE}->can('close') && $self->{RESULTHANDLE}->close();    #eval {
47      #print "ref: ", ref($self->{RESULTHANDLE}), "\n";
48      
49      # object handle destructor
50      if ($self->{resulthandle_type} eq 'Tangram::Cursor') {
51        #$self->{RESULTHANDLE} && ref($self->{RESULTHANDLE}) &&
52        #ref($self->{RESULTHANDLE}) && $self->{RESULTHANDLE}->can('close') && $self->{RESULTHANDLE}->close();
53        $self->{RESULTHANDLE}->close();
54      }
55      
56      # delete ref?
57      delete $self->{RESULTHANDLE};
58  }  }
59    
60  sub getNextEntry {  sub getNextEntry {
# Line 46  sub getNextEntry { Line 66  sub getNextEntry {
66    # is result already opened?    # is result already opened?
67    if ($self->{open}) {    if ($self->{open}) {
68      $self->{entry_count}++;      $self->{entry_count}++;
69        
70        # NEW as of 2003-06-24: RESULTHANDLE == ARRAY
71        return $self->{RESULTHANDLE}->[$self->{entry_count}] if (ref($self->{RESULTHANDLE}) eq 'ARRAY');
72        
73      return $self->{RESULTHANDLE}->next()      return $self->{RESULTHANDLE}->next()
74        if $self->{resulthandle_type} eq 'Tangram::Cursor';        if $self->{resulthandle_type} eq 'Tangram::Cursor';
75      return $self->{members}->[$self->{entry_count}]      return $self->{members}->[$self->{entry_count}]
# Line 56  sub getNextEntry { Line 80  sub getNextEntry {
80      $self->{entry_count} = 0;      $self->{entry_count} = 0;
81      $self->{open} = 1;      $self->{open} = 1;
82    
83        # NEW as of 2003-06-24: RESULTHANDLE == ARRAY
84        return $self->{RESULTHANDLE}->[$self->{entry_count}] if (ref($self->{RESULTHANDLE}) eq 'ARRAY');
85    
86      return $self->{RESULTHANDLE}->execute()      return $self->{RESULTHANDLE}->execute()
87        if $self->{resulthandle_type} eq 'Tangram::Cursor';        if $self->{resulthandle_type} eq 'Tangram::Cursor';
88      #print Dumper($self->{RESULTHANDLE}->members()); exit;      #print Dumper($self->{RESULTHANDLE}->members()); exit;
# Line 70  sub getNextEntry { Line 97  sub getNextEntry {
97  sub getStatus {  sub getStatus {
98    my $self = shift;    my $self = shift;
99    my $status;    my $status;
100      
101      $self->{resulthandle_type} ||= '';
102      
103    if ($self->{resulthandle_type} eq 'Tangram::Cursor') {    if ($self->{resulthandle_type} eq 'Tangram::Cursor') {
104  =pod  =pod
105      print Dumper($self->{RESULTHANDLE});      print Dumper($self->{RESULTHANDLE});

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.7

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed