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