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

Diff of /nfo/perl/libs/Data/Storage/Container.pm

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

revision 1.4 by jonen, Wed Dec 4 07:38:07 2002 UTC revision 1.5 by joko, Sun Jan 19 02:39:57 2003 UTC
# Line 3  Line 3 
3  #  $Id$  #  $Id$
4  #  #
5  #  $Log$  #  $Log$
6    #  Revision 1.5  2003/01/19 02:39:57  joko
7    #  + moved 'deep_copy' from module 'libp' to module 'Data::Transform::Deep'
8    #  + preserved order for hashes '$self->{config}' and '$self->{locator}' by using Tie::IxHash
9    #
10  #  Revision 1.4  2002/12/04 07:38:07  jonen  #  Revision 1.4  2002/12/04 07:38:07  jonen
11  #  + deep copy  #  + deep copy
12  #  #
# Line 31  use warnings; Line 35  use warnings;
35  # get logger instance  # get logger instance
36  my $logger = Log::Dispatch::Config->instance;  my $logger = Log::Dispatch::Config->instance;
37    
38  use libp qw( deep_copy );  
39    # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   main
40    use Tie::IxHash;
41  use Data::Dumper;  use Data::Dumper;
42    
43    use Data::Transform::Deep qw( deep_copy );
44  use Data::Storage;  use Data::Storage;
45  #use Data::Storage::Locator;  #use Data::Storage::Locator;
46    
# Line 46  sub new { Line 54  sub new {
54    $logger->debug( __PACKAGE__ . "->new( @args )" );    $logger->debug( __PACKAGE__ . "->new( @args )" );
55    
56    my $self = { @_ };    my $self = { @_ };
57    return bless $self, $class;    bless $self, $class;
58      
59      # preserve order of configuration variables
60      #$self->{config} = {};
61      tie %{$self->{config}}, 'Tie::IxHash';
62      tie %{$self->{locator}}, 'Tie::IxHash';
63      
64      return $self;
65  }  }
66    
67  sub addConfig {  sub addConfig {
# Line 116  sub initLocator { Line 131  sub initLocator {
131  sub initLocators {  sub initLocators {
132    my $self = shift;    my $self = shift;
133    foreach (keys %{$self->{config}}) {    foreach (keys %{$self->{config}}) {
134        #print $_, "\n";
135      $self->initLocator($_, $self->{config}->{$_}) if !/^_/;      $self->initLocator($_, $self->{config}->{$_}) if !/^_/;
136    }    }
137    #print "locs: ", Dumper($self->{locator});    #print "locs: ", Dumper($self->{locator});
# Line 202  sub initStorage { Line 218  sub initStorage {
218  sub initStorages {  sub initStorages {
219    my $self = shift;    my $self = shift;
220    foreach (keys %{$self->{locator}}) {    foreach (keys %{$self->{locator}}) {
221        #print $_, "\n";
222      $self->initStorage($_);      $self->initStorage($_);
223    }    }
224  }  }

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

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