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