3 |
# $Id$ |
# $Id$ |
4 |
# |
# |
5 |
# $Log$ |
# $Log$ |
6 |
|
# Revision 1.5 2003/04/09 02:09:47 joko |
7 |
|
# bugfix: check for existance of '->close'-method before calling it on the 'RESULTHANDLE'-instance |
8 |
|
# |
9 |
|
# Revision 1.4 2003/03/27 15:31:15 joko |
10 |
|
# fixes to modules regarding new namespace(s) below Data::Mungle::* |
11 |
|
# |
12 |
|
# Revision 1.3 2003/01/31 06:34:49 joko |
13 |
|
# + fixes to 'getNextEntry' and 'getStatus' |
14 |
|
# |
15 |
|
# Revision 1.2 2002/12/05 08:01:26 joko |
16 |
|
# + sub getStatus utilizing isEmpty to determine if result is set/unset and/or filled/unfilled |
17 |
|
# |
18 |
# Revision 1.1 2002/11/29 04:55:45 joko |
# Revision 1.1 2002/11/29 04:55:45 joko |
19 |
# + initial check-in |
# + initial check-in |
20 |
# |
# |
29 |
|
|
30 |
use base ("Data::Storage::Result::Abstract"); |
use base ("Data::Storage::Result::Abstract"); |
31 |
use Data::Dumper; |
use Data::Dumper; |
32 |
|
use Data::Mungle::Compare::Struct qw( isEmpty ); |
33 |
|
|
34 |
sub DESTROY { |
sub DESTROY { |
35 |
my $self = shift; |
my $self = shift; |
36 |
#$logger->debug( __PACKAGE__ . "->" . "DESTROY" ); |
#$logger->debug( __PACKAGE__ . "->" . "DESTROY" ); |
37 |
$self->{RESULTHANDLE} && $self->{RESULTHANDLE}->close(); |
$self->{RESULTHANDLE} && $self->{RESULTHANDLE}->can('close') && $self->{RESULTHANDLE}->close(); |
38 |
} |
} |
39 |
|
|
40 |
sub getNextEntry { |
sub getNextEntry { |
51 |
return $self->{members}->[$self->{entry_count}] |
return $self->{members}->[$self->{entry_count}] |
52 |
if $self->{resulthandle_type} eq 'Set::Object'; |
if $self->{resulthandle_type} eq 'Set::Object'; |
53 |
|
|
54 |
|
# open result! |
55 |
} else { |
} else { |
|
# open result |
|
|
$self->{open} = 1; |
|
56 |
$self->{entry_count} = 0; |
$self->{entry_count} = 0; |
57 |
|
$self->{open} = 1; |
58 |
|
|
59 |
return $self->{RESULTHANDLE}->execute() |
return $self->{RESULTHANDLE}->execute() |
60 |
if $self->{resulthandle_type} eq 'Tangram::Cursor'; |
if $self->{resulthandle_type} eq 'Tangram::Cursor'; |
61 |
#print Dumper($self->{RESULTHANDLE}->members()); exit; |
#print Dumper($self->{RESULTHANDLE}->members()); exit; |
67 |
} |
} |
68 |
} |
} |
69 |
|
|
70 |
sub getStatus { } |
sub getStatus { |
71 |
|
my $self = shift; |
72 |
|
my $status; |
73 |
|
if ($self->{resulthandle_type} eq 'Tangram::Cursor') { |
74 |
|
=pod |
75 |
|
print Dumper($self->{RESULTHANDLE}); |
76 |
|
$status = { |
77 |
|
err => $self->{RESULTHANDLE}->err, |
78 |
|
errstr => $self->{RESULTHANDLE}->errstr, |
79 |
|
state => $self->{RESULTHANDLE}->state, |
80 |
|
}; |
81 |
|
=cut |
82 |
|
} |
83 |
|
if ($self->{resulthandle_type} eq 'Set::Object') { |
84 |
|
#print Dumper($self->{RESULTHANDLE}->members()); |
85 |
|
$status = { |
86 |
|
empty => isEmpty($self->{RESULTHANDLE}), |
87 |
|
}, |
88 |
|
} |
89 |
|
return $status; |
90 |
|
} |
91 |
|
|
92 |
|
|
93 |
1; |
1; |