3 |
# $Id$ |
# $Id$ |
4 |
# |
# |
5 |
# $Log$ |
# $Log$ |
6 |
|
# Revision 1.29 2003/02/21 01:47:18 joko |
7 |
|
# purged old code |
8 |
|
# minor cosmetics |
9 |
|
# |
10 |
# Revision 1.28 2003/02/20 20:20:26 joko |
# Revision 1.28 2003/02/20 20:20:26 joko |
11 |
# tried to get auto-disconnect working again - failed with that |
# tried to get auto-disconnect working again - failed with that |
12 |
# |
# |
129 |
use Data::Storage::Result::Tangram; |
use Data::Storage::Result::Tangram; |
130 |
use Data::Compare::Struct qw( isEmpty ); |
use Data::Compare::Struct qw( isEmpty ); |
131 |
use Data::Transform::Deep qw( expand ); |
use Data::Transform::Deep qw( expand ); |
|
#use Data::Transform::Encode qw( var2utf8 ); |
|
132 |
|
|
133 |
# get logger instance |
# get logger instance |
134 |
my $logger = Log::Dispatch::Config->instance; |
my $logger = Log::Dispatch::Config->instance; |
644 |
# build options (a callback to unload autovivified objects) for 'expand' |
# build options (a callback to unload autovivified objects) for 'expand' |
645 |
# TODO: use $logger to write to debug here! |
# TODO: use $logger to write to debug here! |
646 |
my $cb; # = sub {}; |
my $cb; # = sub {}; |
647 |
|
|
648 |
|
# deactivated way to get rid of used instances, if requested |
649 |
=pod |
=pod |
650 |
if ($options->{destroy}) { |
if ($options->{destroy}) { |
651 |
$options->{cb}->{destroy} = sub { |
$options->{cb}->{destroy} = sub { |
652 |
print "================ DESTROY", "\n"; |
print "================ DESTROY", "\n"; |
653 |
my $object = shift; |
my $object = shift; |
654 |
#print Dumper($object); |
#print Dumper($object); |
655 |
$self->{_COREHANDLE}->unload($object); |
$self->{_COREHANDLE}->unload($object); |
656 |
#undef($object); |
#undef($object); |
657 |
}; |
}; |
658 |
} |
} |
659 |
=cut |
=cut |
660 |
|
|
661 |
my $hash = expand($obj, $options); |
my $hash = expand($obj, $options); |
662 |
#$options->{cb}->{destroy}->($obj); |
|
663 |
#$self->{_COREHANDLE}->unload($obj); |
# old (unsuccessful) attempts to get rid of used instances, if requested |
664 |
|
|
665 |
# convert values in hash to utf8 to be ready for (e.g.) encapsulation in XML |
# V1: |
666 |
# now done in expand |
#$options->{cb}->{destroy}->($obj); |
667 |
#var2utf8($hash) if ($options->{utf8}); |
#$self->{_COREHANDLE}->unload($obj); |
668 |
|
|
669 |
# old (wrong) attempts to get rid of used instances, if requested |
# V2: |
670 |
#$obj->clear_refs; |
#$obj->clear_refs; |
671 |
#$self->{COREHANDLE}->unload($obj) if($options->{destroy}); |
#$self->{COREHANDLE}->unload($obj) if($options->{destroy}); |
672 |
#$obj->DESTROY; |
#$obj->DESTROY; |